@kingstinct/react-native-healthkit 8.7.2 → 9.0.0

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 (449) hide show
  1. package/ReactNativeHealthkit.podspec +36 -0
  2. package/app.plugin.js +43 -33
  3. package/ios/Bridge.h +8 -0
  4. package/ios/CategoryTypeModule.swift +128 -0
  5. package/ios/CharacteristicTypeModule.swift +78 -0
  6. package/ios/Constants.swift +2 -0
  7. package/ios/CoreModule.swift +376 -0
  8. package/ios/CorrelationTypeModule.swift +153 -0
  9. package/ios/HeartbeatSeriesModule.swift +189 -0
  10. package/ios/Helpers.swift +529 -251
  11. package/ios/QuantityTypeModule.swift +461 -0
  12. package/ios/Serializers.swift +211 -124
  13. package/ios/SourceProxy.swift +35 -0
  14. package/ios/StateOfMindModule.swift +160 -0
  15. package/ios/WorkoutProxy.swift +405 -0
  16. package/ios/WorkoutSessionModule.swift +182 -0
  17. package/ios/WorkoutsModule.swift +357 -0
  18. package/package.json +43 -127
  19. package/react-native.config.js +16 -0
  20. package/src/hooks/useHealthkitAuthorization.test.ts +47 -29
  21. package/src/hooks/useHealthkitAuthorization.ts +21 -15
  22. package/src/hooks/useIsHealthDataAvailable.test.ts +17 -7
  23. package/src/hooks/useIsHealthDataAvailable.ts +7 -7
  24. package/src/hooks/useMostRecentCategorySample.ts +10 -12
  25. package/src/hooks/useMostRecentQuantitySample.ts +17 -36
  26. package/src/hooks/useMostRecentWorkout.ts +16 -38
  27. package/src/hooks/useSources.ts +8 -12
  28. package/src/hooks/useStatisticsForQuantity.ts +19 -14
  29. package/src/hooks/useSubscribeToChanges.ts +9 -13
  30. package/src/index.ios.ts +232 -0
  31. package/src/index.ts +444 -0
  32. package/src/modules.ts +43 -0
  33. package/src/specs/CategoryTypeModule.nitro.ts +64 -0
  34. package/src/specs/CharacteristicTypeModule.nitro.ts +22 -0
  35. package/src/specs/CoreModule.nitro.ts +107 -0
  36. package/src/specs/CorrelationTypeModule.nitro.ts +23 -0
  37. package/src/specs/HeartbeatSeriesModule.nitro.ts +19 -0
  38. package/src/specs/QuantityTypeModule.nitro.ts +60 -0
  39. package/src/specs/SourceProxy.nitro.ts +13 -0
  40. package/src/specs/StateOfMindModule.nitro.ts +23 -0
  41. package/src/specs/WorkoutProxy.nitro.ts +18 -0
  42. package/src/specs/WorkoutSessionModule.nitro.ts +71 -0
  43. package/src/specs/WorkoutsModule.nitro.ts +32 -0
  44. package/src/test-setup.ts +68 -54
  45. package/src/test-utils.ts +3 -2
  46. package/src/types/Auth.ts +17 -0
  47. package/src/types/Background.ts +9 -0
  48. package/src/types/CategoryType.ts +249 -0
  49. package/src/types/CategoryTypeIdentifier.ts +99 -0
  50. package/src/types/Characteristics.ts +53 -0
  51. package/src/types/Constants.ts +25 -0
  52. package/src/types/CorrelationType.ts +31 -0
  53. package/src/types/Device.ts +13 -0
  54. package/src/types/HeartbeatSeries.ts +29 -0
  55. package/src/types/InterfaceVerification.ts +164 -0
  56. package/src/types/InterfaceVerificationExample.ts +89 -0
  57. package/src/types/QuantitySample.ts +30 -0
  58. package/src/types/QuantityType.ts +192 -0
  59. package/src/types/QuantityTypeIdentifier.ts +758 -0
  60. package/src/types/QueryOptions.ts +69 -0
  61. package/src/types/README-InterfaceVerification.md +103 -0
  62. package/src/types/Shared.ts +79 -0
  63. package/src/types/Source.ts +11 -0
  64. package/src/types/StateOfMind.ts +110 -0
  65. package/src/types/Subscriptons.ts +10 -0
  66. package/src/types/Units.ts +190 -0
  67. package/src/types/WeatherCondition.ts +31 -0
  68. package/src/types/WorkoutKit.ts +18 -0
  69. package/src/types/Workouts.ts +282 -0
  70. package/src/utils/getMostRecentCategorySample.ts +7 -11
  71. package/src/utils/getMostRecentQuantitySample.ts +8 -18
  72. package/src/utils/getMostRecentWorkout.ts +7 -17
  73. package/src/utils/getPreferredUnit.ts +12 -8
  74. package/src/utils/subscribeToChanges.ts +9 -26
  75. package/LICENSE +0 -21
  76. package/README.md +0 -179
  77. package/ios/ReactNativeHealthkit-Bridging-Header.h +0 -2
  78. package/ios/ReactNativeHealthkit.m +0 -271
  79. package/ios/ReactNativeHealthkit.swift +0 -2333
  80. package/ios/ReactNativeHealthkit.xcodeproj/project.pbxproj +0 -279
  81. package/kingstinct-react-native-healthkit.podspec +0 -21
  82. package/lib/commonjs/hooks/useHealthkitAuthorization.js +0 -39
  83. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +0 -1
  84. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +0 -72
  85. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +0 -1
  86. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +0 -27
  87. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +0 -1
  88. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +0 -41
  89. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +0 -1
  90. package/lib/commonjs/hooks/useMostRecentCategorySample.js +0 -23
  91. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +0 -1
  92. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +0 -37
  93. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +0 -1
  94. package/lib/commonjs/hooks/useMostRecentWorkout.js +0 -48
  95. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +0 -1
  96. package/lib/commonjs/hooks/useSources.js +0 -22
  97. package/lib/commonjs/hooks/useSources.js.map +0 -1
  98. package/lib/commonjs/hooks/useStatisticsForQuantity.js +0 -28
  99. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +0 -1
  100. package/lib/commonjs/hooks/useSubscribeToChanges.js +0 -28
  101. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +0 -1
  102. package/lib/commonjs/index.ios.js +0 -531
  103. package/lib/commonjs/index.ios.js.map +0 -1
  104. package/lib/commonjs/index.js +0 -22
  105. package/lib/commonjs/index.js.map +0 -1
  106. package/lib/commonjs/index.native.js +0 -235
  107. package/lib/commonjs/index.native.js.map +0 -1
  108. package/lib/commonjs/index.web.js +0 -22
  109. package/lib/commonjs/index.web.js.map +0 -1
  110. package/lib/commonjs/native-types.js +0 -1575
  111. package/lib/commonjs/native-types.js.map +0 -1
  112. package/lib/commonjs/test-setup.js +0 -57
  113. package/lib/commonjs/test-setup.js.map +0 -1
  114. package/lib/commonjs/test-utils.js +0 -18
  115. package/lib/commonjs/test-utils.js.map +0 -1
  116. package/lib/commonjs/types.js +0 -17
  117. package/lib/commonjs/types.js.map +0 -1
  118. package/lib/commonjs/utils/deleteQuantitySample.js +0 -11
  119. package/lib/commonjs/utils/deleteQuantitySample.js.map +0 -1
  120. package/lib/commonjs/utils/deleteSamples.js +0 -18
  121. package/lib/commonjs/utils/deleteSamples.js.map +0 -1
  122. package/lib/commonjs/utils/deleteWorkoutSample.js +0 -11
  123. package/lib/commonjs/utils/deleteWorkoutSample.js.map +0 -1
  124. package/lib/commonjs/utils/deserializeCategorySample.js +0 -13
  125. package/lib/commonjs/utils/deserializeCategorySample.js.map +0 -1
  126. package/lib/commonjs/utils/deserializeCategorySample.test.js +0 -26
  127. package/lib/commonjs/utils/deserializeCategorySample.test.js.map +0 -1
  128. package/lib/commonjs/utils/deserializeCorrelation.js +0 -26
  129. package/lib/commonjs/utils/deserializeCorrelation.js.map +0 -1
  130. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +0 -15
  131. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
  132. package/lib/commonjs/utils/deserializeSample.js +0 -15
  133. package/lib/commonjs/utils/deserializeSample.js.map +0 -1
  134. package/lib/commonjs/utils/deserializeWorkout.js +0 -15
  135. package/lib/commonjs/utils/deserializeWorkout.js.map +0 -1
  136. package/lib/commonjs/utils/ensureMetadata.js +0 -11
  137. package/lib/commonjs/utils/ensureMetadata.js.map +0 -1
  138. package/lib/commonjs/utils/ensureTotals.js +0 -11
  139. package/lib/commonjs/utils/ensureTotals.js.map +0 -1
  140. package/lib/commonjs/utils/ensureUnit.js +0 -17
  141. package/lib/commonjs/utils/ensureUnit.js.map +0 -1
  142. package/lib/commonjs/utils/getDateOfBirth.js +0 -14
  143. package/lib/commonjs/utils/getDateOfBirth.js.map +0 -1
  144. package/lib/commonjs/utils/getMostRecentCategorySample.js +0 -17
  145. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +0 -1
  146. package/lib/commonjs/utils/getMostRecentQuantitySample.js +0 -21
  147. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +0 -1
  148. package/lib/commonjs/utils/getMostRecentWorkout.js +0 -19
  149. package/lib/commonjs/utils/getMostRecentWorkout.js.map +0 -1
  150. package/lib/commonjs/utils/getPreferredUnit.js +0 -14
  151. package/lib/commonjs/utils/getPreferredUnit.js.map +0 -1
  152. package/lib/commonjs/utils/getPreferredUnits.js +0 -14
  153. package/lib/commonjs/utils/getPreferredUnits.js.map +0 -1
  154. package/lib/commonjs/utils/getPreferredUnitsTyped.js +0 -33
  155. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +0 -1
  156. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +0 -21
  157. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +0 -1
  158. package/lib/commonjs/utils/getWorkoutPlanById.js +0 -13
  159. package/lib/commonjs/utils/getWorkoutPlanById.js.map +0 -1
  160. package/lib/commonjs/utils/prepareOptions.js +0 -25
  161. package/lib/commonjs/utils/prepareOptions.js.map +0 -1
  162. package/lib/commonjs/utils/queryCategorySamples.js +0 -17
  163. package/lib/commonjs/utils/queryCategorySamples.js.map +0 -1
  164. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +0 -21
  165. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +0 -1
  166. package/lib/commonjs/utils/queryCorrelationSamples.js +0 -17
  167. package/lib/commonjs/utils/queryCorrelationSamples.js.map +0 -1
  168. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +0 -17
  169. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +0 -1
  170. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -21
  171. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
  172. package/lib/commonjs/utils/queryQuantitySamples.js +0 -19
  173. package/lib/commonjs/utils/queryQuantitySamples.js.map +0 -1
  174. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +0 -23
  175. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
  176. package/lib/commonjs/utils/querySources.js +0 -14
  177. package/lib/commonjs/utils/querySources.js.map +0 -1
  178. package/lib/commonjs/utils/queryStateOfMindSamples.js +0 -22
  179. package/lib/commonjs/utils/queryStateOfMindSamples.js.map +0 -1
  180. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js +0 -16
  181. package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
  182. package/lib/commonjs/utils/queryStatisticsForQuantity.js +0 -29
  183. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +0 -1
  184. package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js +0 -26
  185. package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
  186. package/lib/commonjs/utils/queryWorkouts.js +0 -22
  187. package/lib/commonjs/utils/queryWorkouts.js.map +0 -1
  188. package/lib/commonjs/utils/requestAuthorization.js +0 -22
  189. package/lib/commonjs/utils/requestAuthorization.js.map +0 -1
  190. package/lib/commonjs/utils/saveCategorySample.js +0 -20
  191. package/lib/commonjs/utils/saveCategorySample.js.map +0 -1
  192. package/lib/commonjs/utils/saveCorrelationSample.js +0 -35
  193. package/lib/commonjs/utils/saveCorrelationSample.js.map +0 -1
  194. package/lib/commonjs/utils/saveQuantitySample.js +0 -16
  195. package/lib/commonjs/utils/saveQuantitySample.js.map +0 -1
  196. package/lib/commonjs/utils/saveStateOfMindSample.js +0 -17
  197. package/lib/commonjs/utils/saveStateOfMindSample.js.map +0 -1
  198. package/lib/commonjs/utils/saveWorkoutRoute.js +0 -26
  199. package/lib/commonjs/utils/saveWorkoutRoute.js.map +0 -1
  200. package/lib/commonjs/utils/saveWorkoutSample.js +0 -36
  201. package/lib/commonjs/utils/saveWorkoutSample.js.map +0 -1
  202. package/lib/commonjs/utils/serializeDate.js +0 -9
  203. package/lib/commonjs/utils/serializeDate.js.map +0 -1
  204. package/lib/commonjs/utils/serializeDate.test.js +0 -17
  205. package/lib/commonjs/utils/serializeDate.test.js.map +0 -1
  206. package/lib/commonjs/utils/startWatchApp.js +0 -11
  207. package/lib/commonjs/utils/startWatchApp.js.map +0 -1
  208. package/lib/commonjs/utils/subscribeToChanges.js +0 -27
  209. package/lib/commonjs/utils/subscribeToChanges.js.map +0 -1
  210. package/lib/module/hooks/useHealthkitAuthorization.js +0 -32
  211. package/lib/module/hooks/useHealthkitAuthorization.js.map +0 -1
  212. package/lib/module/hooks/useHealthkitAuthorization.test.js +0 -68
  213. package/lib/module/hooks/useHealthkitAuthorization.test.js.map +0 -1
  214. package/lib/module/hooks/useIsHealthDataAvailable.js +0 -21
  215. package/lib/module/hooks/useIsHealthDataAvailable.js.map +0 -1
  216. package/lib/module/hooks/useIsHealthDataAvailable.test.js +0 -37
  217. package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +0 -1
  218. package/lib/module/hooks/useMostRecentCategorySample.js +0 -16
  219. package/lib/module/hooks/useMostRecentCategorySample.js.map +0 -1
  220. package/lib/module/hooks/useMostRecentQuantitySample.js +0 -30
  221. package/lib/module/hooks/useMostRecentQuantitySample.js.map +0 -1
  222. package/lib/module/hooks/useMostRecentWorkout.js +0 -41
  223. package/lib/module/hooks/useMostRecentWorkout.js.map +0 -1
  224. package/lib/module/hooks/useSources.js +0 -15
  225. package/lib/module/hooks/useSources.js.map +0 -1
  226. package/lib/module/hooks/useStatisticsForQuantity.js +0 -21
  227. package/lib/module/hooks/useStatisticsForQuantity.js.map +0 -1
  228. package/lib/module/hooks/useSubscribeToChanges.js +0 -21
  229. package/lib/module/hooks/useSubscribeToChanges.js.map +0 -1
  230. package/lib/module/index.ios.js +0 -209
  231. package/lib/module/index.ios.js.map +0 -1
  232. package/lib/module/index.js +0 -4
  233. package/lib/module/index.js.map +0 -1
  234. package/lib/module/index.native.js +0 -160
  235. package/lib/module/index.native.js.map +0 -1
  236. package/lib/module/index.web.js +0 -4
  237. package/lib/module/index.web.js.map +0 -1
  238. package/lib/module/native-types.js +0 -1606
  239. package/lib/module/native-types.js.map +0 -1
  240. package/lib/module/test-setup.js +0 -54
  241. package/lib/module/test-setup.js.map +0 -1
  242. package/lib/module/test-utils.js +0 -11
  243. package/lib/module/test-utils.js.map +0 -1
  244. package/lib/module/types.js +0 -67
  245. package/lib/module/types.js.map +0 -1
  246. package/lib/module/utils/deleteQuantitySample.js +0 -4
  247. package/lib/module/utils/deleteQuantitySample.js.map +0 -1
  248. package/lib/module/utils/deleteSamples.js +0 -11
  249. package/lib/module/utils/deleteSamples.js.map +0 -1
  250. package/lib/module/utils/deleteWorkoutSample.js +0 -4
  251. package/lib/module/utils/deleteWorkoutSample.js.map +0 -1
  252. package/lib/module/utils/deserializeCategorySample.js +0 -7
  253. package/lib/module/utils/deserializeCategorySample.js.map +0 -1
  254. package/lib/module/utils/deserializeCategorySample.test.js +0 -22
  255. package/lib/module/utils/deserializeCategorySample.test.js.map +0 -1
  256. package/lib/module/utils/deserializeCorrelation.js +0 -19
  257. package/lib/module/utils/deserializeCorrelation.js.map +0 -1
  258. package/lib/module/utils/deserializeHeartbeatSeriesSample.js +0 -9
  259. package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
  260. package/lib/module/utils/deserializeSample.js +0 -9
  261. package/lib/module/utils/deserializeSample.js.map +0 -1
  262. package/lib/module/utils/deserializeWorkout.js +0 -9
  263. package/lib/module/utils/deserializeWorkout.js.map +0 -1
  264. package/lib/module/utils/ensureMetadata.js +0 -5
  265. package/lib/module/utils/ensureMetadata.js.map +0 -1
  266. package/lib/module/utils/ensureTotals.js +0 -5
  267. package/lib/module/utils/ensureTotals.js.map +0 -1
  268. package/lib/module/utils/ensureUnit.js +0 -10
  269. package/lib/module/utils/ensureUnit.js.map +0 -1
  270. package/lib/module/utils/getDateOfBirth.js +0 -7
  271. package/lib/module/utils/getDateOfBirth.js.map +0 -1
  272. package/lib/module/utils/getMostRecentCategorySample.js +0 -10
  273. package/lib/module/utils/getMostRecentCategorySample.js.map +0 -1
  274. package/lib/module/utils/getMostRecentQuantitySample.js +0 -14
  275. package/lib/module/utils/getMostRecentQuantitySample.js.map +0 -1
  276. package/lib/module/utils/getMostRecentWorkout.js +0 -12
  277. package/lib/module/utils/getMostRecentWorkout.js.map +0 -1
  278. package/lib/module/utils/getPreferredUnit.js +0 -7
  279. package/lib/module/utils/getPreferredUnit.js.map +0 -1
  280. package/lib/module/utils/getPreferredUnits.js +0 -7
  281. package/lib/module/utils/getPreferredUnits.js.map +0 -1
  282. package/lib/module/utils/getPreferredUnitsTyped.js +0 -26
  283. package/lib/module/utils/getPreferredUnitsTyped.js.map +0 -1
  284. package/lib/module/utils/getRequestStatusForAuthorization.js +0 -14
  285. package/lib/module/utils/getRequestStatusForAuthorization.js.map +0 -1
  286. package/lib/module/utils/getWorkoutPlanById.js +0 -6
  287. package/lib/module/utils/getWorkoutPlanById.js.map +0 -1
  288. package/lib/module/utils/prepareOptions.js +0 -18
  289. package/lib/module/utils/prepareOptions.js.map +0 -1
  290. package/lib/module/utils/queryCategorySamples.js +0 -10
  291. package/lib/module/utils/queryCategorySamples.js.map +0 -1
  292. package/lib/module/utils/queryCategorySamplesWithAnchor.js +0 -14
  293. package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +0 -1
  294. package/lib/module/utils/queryCorrelationSamples.js +0 -10
  295. package/lib/module/utils/queryCorrelationSamples.js.map +0 -1
  296. package/lib/module/utils/queryHeartbeatSeriesSamples.js +0 -10
  297. package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +0 -1
  298. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -14
  299. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
  300. package/lib/module/utils/queryQuantitySamples.js +0 -12
  301. package/lib/module/utils/queryQuantitySamples.js.map +0 -1
  302. package/lib/module/utils/queryQuantitySamplesWithAnchor.js +0 -16
  303. package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
  304. package/lib/module/utils/querySources.js +0 -7
  305. package/lib/module/utils/querySources.js.map +0 -1
  306. package/lib/module/utils/queryStateOfMindSamples.js +0 -14
  307. package/lib/module/utils/queryStateOfMindSamples.js.map +0 -1
  308. package/lib/module/utils/queryStatisticsCollectionForQuantity.js +0 -9
  309. package/lib/module/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
  310. package/lib/module/utils/queryStatisticsForQuantity.js +0 -22
  311. package/lib/module/utils/queryStatisticsForQuantity.js.map +0 -1
  312. package/lib/module/utils/queryWorkoutSamplesWithAnchor.js +0 -19
  313. package/lib/module/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
  314. package/lib/module/utils/queryWorkouts.js +0 -15
  315. package/lib/module/utils/queryWorkouts.js.map +0 -1
  316. package/lib/module/utils/requestAuthorization.js +0 -15
  317. package/lib/module/utils/requestAuthorization.js.map +0 -1
  318. package/lib/module/utils/saveCategorySample.js +0 -13
  319. package/lib/module/utils/saveCategorySample.js.map +0 -1
  320. package/lib/module/utils/saveCorrelationSample.js +0 -28
  321. package/lib/module/utils/saveCorrelationSample.js.map +0 -1
  322. package/lib/module/utils/saveQuantitySample.js +0 -9
  323. package/lib/module/utils/saveQuantitySample.js.map +0 -1
  324. package/lib/module/utils/saveStateOfMindSample.js +0 -10
  325. package/lib/module/utils/saveStateOfMindSample.js.map +0 -1
  326. package/lib/module/utils/saveWorkoutRoute.js +0 -19
  327. package/lib/module/utils/saveWorkoutRoute.js.map +0 -1
  328. package/lib/module/utils/saveWorkoutSample.js +0 -29
  329. package/lib/module/utils/saveWorkoutSample.js.map +0 -1
  330. package/lib/module/utils/serializeDate.js +0 -3
  331. package/lib/module/utils/serializeDate.js.map +0 -1
  332. package/lib/module/utils/serializeDate.test.js +0 -14
  333. package/lib/module/utils/serializeDate.test.js.map +0 -1
  334. package/lib/module/utils/startWatchApp.js +0 -4
  335. package/lib/module/utils/startWatchApp.js.map +0 -1
  336. package/lib/module/utils/subscribeToChanges.js +0 -20
  337. package/lib/module/utils/subscribeToChanges.js.map +0 -1
  338. package/lib/typescript/example-expo/App.d.ts +0 -2
  339. package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +0 -8
  340. package/lib/typescript/src/hooks/useHealthkitAuthorization.test.d.ts +0 -1
  341. package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +0 -7
  342. package/lib/typescript/src/hooks/useIsHealthDataAvailable.test.d.ts +0 -1
  343. package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +0 -7
  344. package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +0 -7
  345. package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +0 -10
  346. package/lib/typescript/src/hooks/useSources.d.ts +0 -3
  347. package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +0 -4
  348. package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +0 -3
  349. package/lib/typescript/src/index.d.ts +0 -3
  350. package/lib/typescript/src/index.ios.d.ts +0 -198
  351. package/lib/typescript/src/index.native.d.ts +0 -41
  352. package/lib/typescript/src/index.web.d.ts +0 -3
  353. package/lib/typescript/src/native-types.d.ts +0 -1764
  354. package/lib/typescript/src/test-setup.d.ts +0 -1
  355. package/lib/typescript/src/test-utils.d.ts +0 -2
  356. package/lib/typescript/src/types.d.ts +0 -111
  357. package/lib/typescript/src/utils/deleteQuantitySample.d.ts +0 -4
  358. package/lib/typescript/src/utils/deleteSamples.d.ts +0 -8
  359. package/lib/typescript/src/utils/deleteWorkoutSample.d.ts +0 -3
  360. package/lib/typescript/src/utils/deserializeCategorySample.d.ts +0 -4
  361. package/lib/typescript/src/utils/deserializeCategorySample.test.d.ts +0 -1
  362. package/lib/typescript/src/utils/deserializeCorrelation.d.ts +0 -4
  363. package/lib/typescript/src/utils/deserializeHeartbeatSeriesSample.d.ts +0 -4
  364. package/lib/typescript/src/utils/deserializeSample.d.ts +0 -4
  365. package/lib/typescript/src/utils/deserializeWorkout.d.ts +0 -4
  366. package/lib/typescript/src/utils/ensureMetadata.d.ts +0 -2
  367. package/lib/typescript/src/utils/ensureTotals.d.ts +0 -2
  368. package/lib/typescript/src/utils/ensureUnit.d.ts +0 -3
  369. package/lib/typescript/src/utils/getDateOfBirth.d.ts +0 -2
  370. package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +0 -4
  371. package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +0 -4
  372. package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +0 -5
  373. package/lib/typescript/src/utils/getPreferredUnit.d.ts +0 -4
  374. package/lib/typescript/src/utils/getPreferredUnits.d.ts +0 -4
  375. package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +0 -9
  376. package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +0 -3
  377. package/lib/typescript/src/utils/getWorkoutPlanById.d.ts +0 -5
  378. package/lib/typescript/src/utils/prepareOptions.d.ts +0 -9
  379. package/lib/typescript/src/utils/queryCategorySamples.d.ts +0 -5
  380. package/lib/typescript/src/utils/queryCategorySamplesWithAnchor.d.ts +0 -10
  381. package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +0 -5
  382. package/lib/typescript/src/utils/queryHeartbeatSeriesSamples.d.ts +0 -10
  383. package/lib/typescript/src/utils/queryHeartbeatSeriesSamplesWithAnchor.d.ts +0 -10
  384. package/lib/typescript/src/utils/queryQuantitySamples.d.ts +0 -7
  385. package/lib/typescript/src/utils/queryQuantitySamplesWithAnchor.d.ts +0 -12
  386. package/lib/typescript/src/utils/querySources.d.ts +0 -4
  387. package/lib/typescript/src/utils/queryStateOfMindSamples.d.ts +0 -7
  388. package/lib/typescript/src/utils/queryStatisticsCollectionForQuantity.d.ts +0 -3
  389. package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +0 -14
  390. package/lib/typescript/src/utils/queryWorkoutSamplesWithAnchor.d.ts +0 -9
  391. package/lib/typescript/src/utils/queryWorkouts.d.ts +0 -4
  392. package/lib/typescript/src/utils/requestAuthorization.d.ts +0 -4
  393. package/lib/typescript/src/utils/saveCategorySample.d.ts +0 -11
  394. package/lib/typescript/src/utils/saveCorrelationSample.d.ts +0 -8
  395. package/lib/typescript/src/utils/saveQuantitySample.d.ts +0 -7
  396. package/lib/typescript/src/utils/saveStateOfMindSample.d.ts +0 -11
  397. package/lib/typescript/src/utils/saveWorkoutRoute.d.ts +0 -3
  398. package/lib/typescript/src/utils/saveWorkoutSample.d.ts +0 -11
  399. package/lib/typescript/src/utils/serializeDate.d.ts +0 -2
  400. package/lib/typescript/src/utils/serializeDate.test.d.ts +0 -1
  401. package/lib/typescript/src/utils/startWatchApp.d.ts +0 -3
  402. package/lib/typescript/src/utils/subscribeToChanges.d.ts +0 -3
  403. package/src/index.ios.tsx +0 -292
  404. package/src/index.native.tsx +0 -233
  405. package/src/index.tsx +0 -5
  406. package/src/index.web.tsx +0 -5
  407. package/src/native-types.ts +0 -2471
  408. package/src/types.ts +0 -156
  409. package/src/utils/deleteQuantitySample.ts +0 -14
  410. package/src/utils/deleteSamples.ts +0 -23
  411. package/src/utils/deleteWorkoutSample.ts +0 -7
  412. package/src/utils/deserializeCategorySample.test.ts +0 -24
  413. package/src/utils/deserializeCategorySample.ts +0 -12
  414. package/src/utils/deserializeCorrelation.ts +0 -28
  415. package/src/utils/deserializeHeartbeatSeriesSample.ts +0 -12
  416. package/src/utils/deserializeSample.ts +0 -17
  417. package/src/utils/deserializeWorkout.ts +0 -14
  418. package/src/utils/ensureMetadata.ts +0 -5
  419. package/src/utils/ensureTotals.ts +0 -5
  420. package/src/utils/ensureUnit.ts +0 -19
  421. package/src/utils/getDateOfBirth.ts +0 -8
  422. package/src/utils/getPreferredUnits.ts +0 -14
  423. package/src/utils/getPreferredUnitsTyped.ts +0 -38
  424. package/src/utils/getRequestStatusForAuthorization.ts +0 -21
  425. package/src/utils/getWorkoutPlanById.ts +0 -7
  426. package/src/utils/prepareOptions.ts +0 -19
  427. package/src/utils/queryCategorySamples.ts +0 -29
  428. package/src/utils/queryCategorySamplesWithAnchor.ts +0 -39
  429. package/src/utils/queryCorrelationSamples.ts +0 -29
  430. package/src/utils/queryHeartbeatSeriesSamples.ts +0 -29
  431. package/src/utils/queryHeartbeatSeriesSamplesWithAnchor.ts +0 -33
  432. package/src/utils/queryQuantitySamples.ts +0 -38
  433. package/src/utils/queryQuantitySamplesWithAnchor.ts +0 -46
  434. package/src/utils/querySources.ts +0 -21
  435. package/src/utils/queryStateOfMindSamples.ts +0 -14
  436. package/src/utils/queryStatisticsCollectionForQuantity.ts +0 -38
  437. package/src/utils/queryStatisticsForQuantity.ts +0 -38
  438. package/src/utils/queryWorkoutSamplesWithAnchor.ts +0 -46
  439. package/src/utils/queryWorkouts.ts +0 -28
  440. package/src/utils/requestAuthorization.ts +0 -19
  441. package/src/utils/saveCategorySample.ts +0 -31
  442. package/src/utils/saveCorrelationSample.ts +0 -43
  443. package/src/utils/saveQuantitySample.ts +0 -29
  444. package/src/utils/saveStateOfMindSample.ts +0 -38
  445. package/src/utils/saveWorkoutRoute.ts +0 -21
  446. package/src/utils/saveWorkoutSample.ts +0 -42
  447. package/src/utils/serializeDate.test.ts +0 -16
  448. package/src/utils/serializeDate.ts +0 -5
  449. package/src/utils/startWatchApp.ts +0 -7
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- function deserializeQuantitySample(sample) {
8
- return {
9
- ...sample,
10
- startDate: new Date(sample.startDate),
11
- endDate: new Date(sample.endDate)
12
- };
13
- }
14
- var _default = exports.default = deserializeQuantitySample;
15
- //# sourceMappingURL=deserializeSample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["deserializeQuantitySample","sample","startDate","Date","endDate","_default","exports","default"],"sources":["deserializeSample.ts"],"sourcesContent":["import type { HKQuantitySampleRaw, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\nimport type { HKQuantitySample } from '../types'\n\nfunction deserializeQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n sample: HKQuantitySampleRaw<TIdentifier, TUnit>,\n): HKQuantitySample<TIdentifier, TUnit> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nexport default deserializeQuantitySample\n"],"mappings":";;;;;;AAGA,SAASA,yBAAyBA,CAIhCC,MAA+C,EACT;EACtC,OAAO;IACL,GAAGA,MAAM;IACTC,SAAS,EAAE,IAAIC,IAAI,CAACF,MAAM,CAACC,SAAS,CAAC;IACrCE,OAAO,EAAE,IAAID,IAAI,CAACF,MAAM,CAACG,OAAO;EAClC,CAAC;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcP,yBAAyB","ignoreList":[]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- function deserializeWorkout(sample) {
8
- return {
9
- ...sample,
10
- startDate: new Date(sample.startDate),
11
- endDate: new Date(sample.endDate)
12
- };
13
- }
14
- var _default = exports.default = deserializeWorkout;
15
- //# sourceMappingURL=deserializeWorkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["deserializeWorkout","sample","startDate","Date","endDate","_default","exports","default"],"sources":["deserializeWorkout.ts"],"sourcesContent":["import type { EnergyUnit, HKWorkoutRaw, LengthUnit } from '../native-types'\nimport type { HKWorkout } from '../types'\n\nfunction deserializeWorkout<TEnergy extends EnergyUnit, TDistance extends LengthUnit>(\n sample: HKWorkoutRaw<TEnergy, TDistance>,\n): HKWorkout<TEnergy, TDistance> {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nexport default deserializeWorkout\n"],"mappings":";;;;;;AAGA,SAASA,kBAAkBA,CACzBC,MAAwC,EACT;EAC/B,OAAO;IACL,GAAGA,MAAM;IACTC,SAAS,EAAE,IAAIC,IAAI,CAACF,MAAM,CAACC,SAAS,CAAC;IACrCE,OAAO,EAAE,IAAID,IAAI,CAACF,MAAM,CAACG,OAAO;EAClC,CAAC;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcP,kBAAkB","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- function ensureMetadata(metadata) {
8
- return metadata || {};
9
- }
10
- var _default = exports.default = ensureMetadata;
11
- //# sourceMappingURL=ensureMetadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ensureMetadata","metadata","_default","exports","default"],"sources":["ensureMetadata.ts"],"sourcesContent":["function ensureMetadata<TMetadata>(metadata?: TMetadata) {\n return metadata || ({} as TMetadata)\n}\n\nexport default ensureMetadata\n"],"mappings":";;;;;;AAAA,SAASA,cAAcA,CAAYC,QAAoB,EAAE;EACvD,OAAOA,QAAQ,IAAK,CAAC,CAAe;AACtC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcJ,cAAc","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- function ensureTotals(totals) {
8
- return totals || {};
9
- }
10
- var _default = exports.default = ensureTotals;
11
- //# sourceMappingURL=ensureTotals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ensureTotals","totals","_default","exports","default"],"sources":["ensureTotals.ts"],"sourcesContent":["function ensureTotals<TTotals>(totals?: TTotals) {\n return totals || ({} as TTotals)\n}\n\nexport default ensureTotals\n"],"mappings":";;;;;;AAAA,SAASA,YAAYA,CAAUC,MAAgB,EAAE;EAC/C,OAAOA,MAAM,IAAK,CAAC,CAAa;AAClC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcJ,YAAY","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const ensureUnit = async (type, providedUnit) => {
10
- if (providedUnit) {
11
- return providedUnit;
12
- }
13
- const unit = await _nativeTypes.default.getPreferredUnits([type]);
14
- return unit[type];
15
- };
16
- var _default = exports.default = ensureUnit;
17
- //# sourceMappingURL=ensureUnit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","ensureUnit","type","providedUnit","unit","Native","getPreferredUnits","_default","exports"],"sources":["ensureUnit.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\n\nconst ensureUnit = async <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n type: TIdentifier,\n providedUnit?: TUnit,\n) => {\n if (providedUnit) {\n return providedUnit\n }\n const unit = await Native.getPreferredUnits([type])\n return unit[type] as TUnit\n}\n\nexport default ensureUnit\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIpC,MAAMG,UAAU,GAAG,MAAAA,CAIjBC,IAAiB,EACjBC,YAAoB,KACjB;EACH,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,MAAMC,IAAI,GAAG,MAAMC,oBAAM,CAACC,iBAAiB,CAAC,CAACJ,IAAI,CAAC,CAAC;EACnD,OAAOE,IAAI,CAACF,IAAI,CAAC;AACnB,CAAC;AAAA,IAAAK,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEcC,UAAU","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const getDateOfBirth = async () => {
10
- const dateOfBirth = await _nativeTypes.default.getDateOfBirth();
11
- return new Date(dateOfBirth);
12
- };
13
- var _default = exports.default = getDateOfBirth;
14
- //# sourceMappingURL=getDateOfBirth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","getDateOfBirth","dateOfBirth","Native","Date","_default","exports"],"sources":["getDateOfBirth.ts"],"sourcesContent":["import Native from '../native-types'\n\nconst getDateOfBirth = async () => {\n const dateOfBirth = await Native.getDateOfBirth()\n return new Date(dateOfBirth)\n}\n\nexport default getDateOfBirth\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,cAAc,GAAG,MAAAA,CAAA,KAAY;EACjC,MAAMC,WAAW,GAAG,MAAMC,oBAAM,CAACF,cAAc,CAAC,CAAC;EACjD,OAAO,IAAIG,IAAI,CAACF,WAAW,CAAC;AAC9B,CAAC;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcC,cAAc","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _queryCategorySamples = _interopRequireDefault(require("./queryCategorySamples"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- async function getMostRecentCategorySample(identifier) {
10
- const samples = await (0, _queryCategorySamples.default)(identifier, {
11
- limit: 1,
12
- ascending: false
13
- });
14
- return samples[0] ?? null;
15
- }
16
- var _default = exports.default = getMostRecentCategorySample;
17
- //# sourceMappingURL=getMostRecentCategorySample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_queryCategorySamples","_interopRequireDefault","require","e","__esModule","default","getMostRecentCategorySample","identifier","samples","queryCategorySamples","limit","ascending","_default","exports"],"sources":["getMostRecentCategorySample.ts"],"sourcesContent":["import queryCategorySamples from './queryCategorySamples'\n\nimport type { HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\nasync function getMostRecentCategorySample<\n T extends HKCategoryTypeIdentifier\n>(\n identifier: T,\n): Promise<HKCategorySample<T> | null> {\n const samples = await queryCategorySamples(identifier, {\n limit: 1,\n ascending: false,\n })\n\n return samples[0] ?? null\n}\n\nexport default getMostRecentCategorySample\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAyD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKzD,eAAeG,2BAA2BA,CAGxCC,UAAa,EACwB;EACrC,MAAMC,OAAO,GAAG,MAAM,IAAAC,6BAAoB,EAACF,UAAU,EAAE;IACrDG,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,OAAOH,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI;AAC3B;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEcC,2BAA2B","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _queryQuantitySamples = _interopRequireDefault(require("./queryQuantitySamples"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- async function getMostRecentQuantitySample(identifier, unit) {
10
- const samples = await (0, _queryQuantitySamples.default)(identifier, {
11
- limit: 1,
12
- unit
13
- });
14
- const lastSample = samples[0];
15
- if (lastSample) {
16
- return lastSample;
17
- }
18
- return null;
19
- }
20
- var _default = exports.default = getMostRecentQuantitySample;
21
- //# sourceMappingURL=getMostRecentQuantitySample.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_queryQuantitySamples","_interopRequireDefault","require","e","__esModule","default","getMostRecentQuantitySample","identifier","unit","samples","queryQuantitySamples","limit","lastSample","_default","exports"],"sources":["getMostRecentQuantitySample.ts"],"sourcesContent":["import queryQuantitySamples from './queryQuantitySamples'\n\nimport type { HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\nimport type { HKQuantitySample } from '../types'\n\nasync function getMostRecentQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n unit: TUnit,\n): Promise<HKQuantitySample<TIdentifier, TUnit> | null> {\n const samples = await queryQuantitySamples(identifier, {\n limit: 1,\n unit,\n })\n\n const lastSample = samples[0]\n\n if (lastSample) {\n return lastSample as HKQuantitySample<TIdentifier, TUnit>\n }\n return null\n}\n\nexport default getMostRecentQuantitySample\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAyD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKzD,eAAeG,2BAA2BA,CAIxCC,UAAuB,EACvBC,IAAW,EAC2C;EACtD,MAAMC,OAAO,GAAG,MAAM,IAAAC,6BAAoB,EAACH,UAAU,EAAE;IACrDI,KAAK,EAAE,CAAC;IACRH;EACF,CAAC,CAAC;EAEF,MAAMI,UAAU,GAAGH,OAAO,CAAC,CAAC,CAAC;EAE7B,IAAIG,UAAU,EAAE;IACd,OAAOA,UAAU;EACnB;EACA,OAAO,IAAI;AACb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEcC,2BAA2B","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _queryWorkouts = _interopRequireDefault(require("./queryWorkouts"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const getMostRecentWorkout = async options => {
10
- const workouts = await (0, _queryWorkouts.default)({
11
- limit: 1,
12
- ascending: false,
13
- energyUnit: options === null || options === void 0 ? void 0 : options.energyUnit,
14
- distanceUnit: options === null || options === void 0 ? void 0 : options.distanceUnit
15
- });
16
- return workouts[0] || null;
17
- };
18
- var _default = exports.default = getMostRecentWorkout;
19
- //# sourceMappingURL=getMostRecentWorkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_queryWorkouts","_interopRequireDefault","require","e","__esModule","default","getMostRecentWorkout","options","workouts","queryWorkouts","limit","ascending","energyUnit","distanceUnit","_default","exports"],"sources":["getMostRecentWorkout.ts"],"sourcesContent":["import queryWorkouts from './queryWorkouts'\n\nimport type { EnergyUnit, LengthUnit } from '../native-types'\nimport type { HKWorkout, QueryWorkoutsOptions } from '../types'\n\nexport type GetMostRecentWorkoutFn = <\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(\n options?: Pick<\n QueryWorkoutsOptions<TEnergy, TDistance>,\n 'distanceUnit' | 'energyUnit'\n >\n) => Promise<HKWorkout<TEnergy, TDistance> | null>;\n\nconst getMostRecentWorkout: GetMostRecentWorkoutFn = async (options) => {\n const workouts = await queryWorkouts({\n limit: 1,\n ascending: false,\n energyUnit: options?.energyUnit,\n distanceUnit: options?.distanceUnit,\n })\n\n return workouts[0] || null\n}\n\nexport default getMostRecentWorkout\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAe3C,MAAMG,oBAA4C,GAAG,MAAOC,OAAO,IAAK;EACtE,MAAMC,QAAQ,GAAG,MAAM,IAAAC,sBAAa,EAAC;IACnCC,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE,KAAK;IAChBC,UAAU,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,UAAU;IAC/BC,YAAY,EAAEN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM;EACzB,CAAC,CAAC;EAEF,OAAOL,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI;AAC5B,CAAC;AAAA,IAAAM,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcC,oBAAoB","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _getPreferredUnits = _interopRequireDefault(require("./getPreferredUnits"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const getPreferredUnit = async type => {
10
- const [unit] = await (0, _getPreferredUnits.default)([type]);
11
- return unit;
12
- };
13
- var _default = exports.default = getPreferredUnit;
14
- //# sourceMappingURL=getPreferredUnit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_getPreferredUnits","_interopRequireDefault","require","e","__esModule","default","getPreferredUnit","type","unit","getPreferredUnits","_default","exports"],"sources":["getPreferredUnit.ts"],"sourcesContent":["import getPreferredUnits from './getPreferredUnits'\n\nimport type { HKQuantityTypeIdentifier, HKUnit } from '../native-types'\n\nexport type GetPreferredUnitFn = (\n identifier: HKQuantityTypeIdentifier\n) => Promise<HKUnit | undefined>;\n\nconst getPreferredUnit: GetPreferredUnitFn = async (type) => {\n const [unit] = await getPreferredUnits([type])\n return unit\n}\n\nexport default getPreferredUnit\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQnD,MAAMG,gBAAoC,GAAG,MAAOC,IAAI,IAAK;EAC3D,MAAM,CAACC,IAAI,CAAC,GAAG,MAAM,IAAAC,0BAAiB,EAAC,CAACF,IAAI,CAAC,CAAC;EAC9C,OAAOC,IAAI;AACb,CAAC;AAAA,IAAAE,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcC,gBAAgB","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const getPreferredUnits = async identifiers => {
10
- const units = await _nativeTypes.default.getPreferredUnits(identifiers);
11
- return identifiers.map(i => units[i]);
12
- };
13
- var _default = exports.default = getPreferredUnits;
14
- //# sourceMappingURL=getPreferredUnits.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","getPreferredUnits","identifiers","units","Native","map","i","_default","exports"],"sources":["getPreferredUnits.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier, HKUnit } from '../native-types'\n\nexport type GetPreferredUnitsFn = (\n identifiers: readonly HKQuantityTypeIdentifier[]\n) => Promise<readonly HKUnit[]>;\n\nconst getPreferredUnits: GetPreferredUnitsFn = async (identifiers) => {\n const units = await Native.getPreferredUnits(identifiers)\n return identifiers.map((i) => units[i])\n}\n\nexport default getPreferredUnits\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQpC,MAAMG,iBAAsC,GAAG,MAAOC,WAAW,IAAK;EACpE,MAAMC,KAAK,GAAG,MAAMC,oBAAM,CAACH,iBAAiB,CAACC,WAAW,CAAC;EACzD,OAAOA,WAAW,CAACG,GAAG,CAAEC,CAAC,IAAKH,KAAK,CAACG,CAAC,CAAC,CAAC;AACzC,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEcC,iBAAiB","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireWildcard(require("../native-types"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
- async function getPreferredUnitsTyped(options) {
10
- let energyUnit = options === null || options === void 0 ? void 0 : options.energyUnit;
11
- let distanceUnit = options === null || options === void 0 ? void 0 : options.distanceUnit;
12
- if (!energyUnit || !distanceUnit) {
13
- const units = await _nativeTypes.default.getPreferredUnits([_nativeTypes.HKQuantityTypeIdentifier.distanceWalkingRunning, _nativeTypes.HKQuantityTypeIdentifier.activeEnergyBurned]);
14
- if (!energyUnit) {
15
- energyUnit = units[_nativeTypes.HKQuantityTypeIdentifier.activeEnergyBurned];
16
- }
17
- if (!distanceUnit) {
18
- distanceUnit = units[_nativeTypes.HKQuantityTypeIdentifier.distanceWalkingRunning];
19
- }
20
- }
21
- if (!energyUnit) {
22
- energyUnit = _nativeTypes.UnitOfEnergy.Kilocalories;
23
- }
24
- if (!distanceUnit) {
25
- distanceUnit = _nativeTypes.UnitOfLength.Meter;
26
- }
27
- return {
28
- energyUnit,
29
- distanceUnit
30
- };
31
- }
32
- var _default = exports.default = getPreferredUnitsTyped;
33
- //# sourceMappingURL=getPreferredUnitsTyped.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getPreferredUnitsTyped","options","energyUnit","distanceUnit","units","Native","getPreferredUnits","HKQuantityTypeIdentifier","distanceWalkingRunning","activeEnergyBurned","UnitOfEnergy","Kilocalories","UnitOfLength","Meter","_default","exports"],"sources":["getPreferredUnitsTyped.ts"],"sourcesContent":["import Native, { HKQuantityTypeIdentifier, UnitOfEnergy, UnitOfLength } from '../native-types'\n\nimport type { HKUnit } from '../native-types'\n\nasync function getPreferredUnitsTyped<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n>(options?: { readonly energyUnit?: TEnergy; readonly distanceUnit?: TDistance }) {\n let energyUnit = options?.energyUnit\n let distanceUnit = options?.distanceUnit\n\n if (!energyUnit || !distanceUnit) {\n const units = await Native.getPreferredUnits([\n HKQuantityTypeIdentifier.distanceWalkingRunning,\n HKQuantityTypeIdentifier.activeEnergyBurned,\n ])\n if (!energyUnit) {\n energyUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned] as\n | TEnergy\n | undefined\n }\n if (!distanceUnit) {\n distanceUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning] as\n | TDistance\n | undefined\n }\n }\n\n if (!energyUnit) {\n energyUnit = UnitOfEnergy.Kilocalories as TEnergy\n }\n if (!distanceUnit) {\n distanceUnit = UnitOfLength.Meter as TDistance\n }\n return { energyUnit, distanceUnit }\n}\n\nexport default getPreferredUnitsTyped\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8F,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAI9F,eAAekB,sBAAsBA,CAGnCC,OAA8E,EAAE;EAChF,IAAIC,UAAU,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,UAAU;EACpC,IAAIC,YAAY,GAAGF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,YAAY;EAExC,IAAI,CAACD,UAAU,IAAI,CAACC,YAAY,EAAE;IAChC,MAAMC,KAAK,GAAG,MAAMC,oBAAM,CAACC,iBAAiB,CAAC,CAC3CC,qCAAwB,CAACC,sBAAsB,EAC/CD,qCAAwB,CAACE,kBAAkB,CAC5C,CAAC;IACF,IAAI,CAACP,UAAU,EAAE;MACfA,UAAU,GAAGE,KAAK,CAACG,qCAAwB,CAACE,kBAAkB,CAEnD;IACb;IACA,IAAI,CAACN,YAAY,EAAE;MACjBA,YAAY,GAAGC,KAAK,CAACG,qCAAwB,CAACC,sBAAsB,CAEzD;IACb;EACF;EAEA,IAAI,CAACN,UAAU,EAAE;IACfA,UAAU,GAAGQ,yBAAY,CAACC,YAAuB;EACnD;EACA,IAAI,CAACR,YAAY,EAAE;IACjBA,YAAY,GAAGS,yBAAY,CAACC,KAAkB;EAChD;EACA,OAAO;IAAEX,UAAU;IAAEC;EAAa,CAAC;AACrC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEcS,sBAAsB","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const getRequestStatusForAuthorization = async (read, write = []) => {
10
- const readPermissions = read.reduce((obj, cur) => ({
11
- ...obj,
12
- [cur]: true
13
- }), {});
14
- const writePermissions = write.reduce((obj, cur) => ({
15
- ...obj,
16
- [cur]: true
17
- }), {});
18
- return _nativeTypes.default.getRequestStatusForAuthorization(writePermissions, readPermissions);
19
- };
20
- var _default = exports.default = getRequestStatusForAuthorization;
21
- //# sourceMappingURL=getRequestStatusForAuthorization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","getRequestStatusForAuthorization","read","write","readPermissions","reduce","obj","cur","writePermissions","Native","_default","exports"],"sources":["getRequestStatusForAuthorization.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type {\n HealthkitReadAuthorization, HealthkitWriteAuthorization, ReadPermissions, WritePermissions,\n} from '../native-types'\n\nconst getRequestStatusForAuthorization = async (\n read: readonly HealthkitReadAuthorization[],\n write: readonly HealthkitWriteAuthorization[] = [],\n) => {\n const readPermissions = read.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as ReadPermissions)\n\n const writePermissions = write.reduce((obj, cur) => ({ ...obj, [cur]: true }), {} as WritePermissions)\n\n return Native.getRequestStatusForAuthorization(\n writePermissions,\n readPermissions,\n )\n}\n\nexport default getRequestStatusForAuthorization\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMpC,MAAMG,gCAAgC,GAAG,MAAAA,CACvCC,IAA2C,EAC3CC,KAA6C,GAAG,EAAE,KAC/C;EACH,MAAMC,eAAe,GAAGF,IAAI,CAACG,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAoB,CAAC;EAEnG,MAAMC,gBAAgB,GAAGL,KAAK,CAACE,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAqB,CAAC;EAEtG,OAAOE,oBAAM,CAACR,gCAAgC,CAC5CO,gBAAgB,EAChBJ,eACF,CAAC;AACH,CAAC;AAAA,IAAAM,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEcC,gCAAgC","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- async function getWorkoutPlanById(workoutUUID) {
10
- return _nativeTypes.default.getWorkoutPlanById(workoutUUID);
11
- }
12
- var _default = exports.default = getWorkoutPlanById;
13
- //# sourceMappingURL=getWorkoutPlanById.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","getWorkoutPlanById","workoutUUID","Native","_default","exports"],"sources":["getWorkoutPlanById.ts"],"sourcesContent":["import Native from '../native-types'\n\nasync function getWorkoutPlanById(workoutUUID: string) {\n return Native.getWorkoutPlanById(workoutUUID)\n}\n\nexport default getWorkoutPlanById\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,eAAeG,kBAAkBA,CAACC,WAAmB,EAAE;EACrD,OAAOC,oBAAM,CAACF,kBAAkB,CAACC,WAAW,CAAC;AAC/C;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEcC,kBAAkB","ignoreList":[]}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _serializeDate = _interopRequireDefault(require("./serializeDate"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const prepareOptions = options => {
10
- const limit = !options.limit || options.limit === Infinity ? 0 : options.limit;
11
- const ascending = options.ascending ?? limit === 0;
12
- // eslint-disable-next-line no-nested-ternary
13
- const from = (0, _serializeDate.default)(options.from ? options.from : limit > 0 ? new Date(0) : undefined);
14
- const to = (0, _serializeDate.default)(options.to);
15
- const anchor = options.anchor ?? '';
16
- return {
17
- limit,
18
- ascending,
19
- from,
20
- to,
21
- anchor
22
- };
23
- };
24
- var _default = exports.default = prepareOptions;
25
- //# sourceMappingURL=prepareOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_serializeDate","_interopRequireDefault","require","e","__esModule","default","prepareOptions","options","limit","Infinity","ascending","from","serializeDate","Date","undefined","to","anchor","_default","exports"],"sources":["prepareOptions.ts"],"sourcesContent":["import serializeDate from './serializeDate'\n\nimport type { GenericQueryOptions } from '../types'\n\nconst prepareOptions = (options: GenericQueryOptions) => {\n const limit = !options.limit || options.limit === Infinity\n ? 0\n : options.limit\n const ascending = options.ascending ?? limit === 0\n // eslint-disable-next-line no-nested-ternary\n const from = serializeDate(options.from ? options.from : (limit > 0 ? new Date(0) : undefined))\n const to = serializeDate(options.to)\n const anchor = options.anchor ?? ''\n return {\n limit, ascending, from, to, anchor,\n }\n}\n\nexport default prepareOptions\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI3C,MAAMG,cAAc,GAAIC,OAA4B,IAAK;EACvD,MAAMC,KAAK,GAAG,CAACD,OAAO,CAACC,KAAK,IAAID,OAAO,CAACC,KAAK,KAAKC,QAAQ,GACtD,CAAC,GACDF,OAAO,CAACC,KAAK;EACjB,MAAME,SAAS,GAAGH,OAAO,CAACG,SAAS,IAAIF,KAAK,KAAK,CAAC;EAClD;EACA,MAAMG,IAAI,GAAG,IAAAC,sBAAa,EAACL,OAAO,CAACI,IAAI,GAAGJ,OAAO,CAACI,IAAI,GAAIH,KAAK,GAAG,CAAC,GAAG,IAAIK,IAAI,CAAC,CAAC,CAAC,GAAGC,SAAU,CAAC;EAC/F,MAAMC,EAAE,GAAG,IAAAH,sBAAa,EAACL,OAAO,CAACQ,EAAE,CAAC;EACpC,MAAMC,MAAM,GAAGT,OAAO,CAACS,MAAM,IAAI,EAAE;EACnC,OAAO;IACLR,KAAK;IAAEE,SAAS;IAAEC,IAAI;IAAEI,EAAE;IAAEC;EAC9B,CAAC;AACH,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEcC,cAAc","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeCategorySample = _interopRequireDefault(require("./deserializeCategorySample"));
8
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
9
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const queryCategorySamples = async (identifier, options) => {
12
- const opts = (0, _prepareOptions.default)(options);
13
- const raw = await _nativeTypes.default.queryCategorySamples(identifier, opts.from, opts.to, opts.limit, opts.ascending);
14
- return raw.map(_deserializeCategorySample.default);
15
- };
16
- var _default = exports.default = queryCategorySamples;
17
- //# sourceMappingURL=queryCategorySamples.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeCategorySample","_interopRequireDefault","require","_prepareOptions","_nativeTypes","e","__esModule","default","queryCategorySamples","identifier","options","opts","prepareOptions","raw","Native","from","to","limit","ascending","map","deserializeCategorySample","_default","exports"],"sources":["queryCategorySamples.ts"],"sourcesContent":["import deserializeCategorySample from './deserializeCategorySample'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { HKCategoryTypeIdentifier } from '../native-types'\nimport type { GenericQueryOptions, HKCategorySample } from '../types'\n\nexport type QueryCategorySamplesFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: Omit<GenericQueryOptions, 'anchor'>\n) => Promise<readonly HKCategorySample<T>[]>;\n\nconst queryCategorySamples: QueryCategorySamplesFn = async (\n identifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const raw = await Native.queryCategorySamples(\n identifier,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return raw.map(deserializeCategorySample)\n}\n\nexport default queryCategorySamples\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAUpC,MAAMG,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,IAAAC,uBAAc,EAACF,OAAO,CAAC;EACpC,MAAMG,GAAG,GAAG,MAAMC,oBAAM,CAACN,oBAAoB,CAC3CC,UAAU,EACVE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,SACP,CAAC;EAED,OAAOL,GAAG,CAACM,GAAG,CAACC,kCAAyB,CAAC;AAC3C,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcC,oBAAoB","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeCategorySample = _interopRequireDefault(require("./deserializeCategorySample"));
8
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
9
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const queryCategorySamplesWithAnchor = async (identifier, options) => {
12
- const opts = (0, _prepareOptions.default)(options);
13
- const raw = await _nativeTypes.default.queryCategorySamplesWithAnchor(identifier, opts.from, opts.to, opts.limit, opts.anchor);
14
- return {
15
- samples: raw.samples.map(_deserializeCategorySample.default),
16
- deletedSamples: raw.deletedSamples,
17
- newAnchor: raw.newAnchor
18
- };
19
- };
20
- var _default = exports.default = queryCategorySamplesWithAnchor;
21
- //# sourceMappingURL=queryCategorySamplesWithAnchor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeCategorySample","_interopRequireDefault","require","_prepareOptions","_nativeTypes","e","__esModule","default","queryCategorySamplesWithAnchor","identifier","options","opts","prepareOptions","raw","Native","from","to","limit","anchor","samples","map","deserializeCategorySample","deletedSamples","newAnchor","_default","exports"],"sources":["queryCategorySamplesWithAnchor.ts"],"sourcesContent":["import deserializeCategorySample from './deserializeCategorySample'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { HKCategoryTypeIdentifier, DeletedCategorySampleRaw } from '../native-types'\nimport type { GenericQueryOptions, HKCategorySample } from '../types'\n\nexport type QueryCategorySamplesWithAnchorResponse<T extends HKCategoryTypeIdentifier> = {\n readonly samples: readonly HKCategorySample<T>[],\n readonly deletedSamples: readonly DeletedCategorySampleRaw<T>[],\n readonly newAnchor: string\n}\n\nexport type QueryCategorySamplesWithAnchorFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: Omit<GenericQueryOptions, 'ascending'>\n) => Promise<QueryCategorySamplesWithAnchorResponse<T>>;\n\nconst queryCategorySamplesWithAnchor: QueryCategorySamplesWithAnchorFn = async (\n identifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const raw = await Native.queryCategorySamplesWithAnchor(\n identifier,\n opts.from,\n opts.to,\n opts.limit,\n opts.anchor,\n )\n\n return {\n samples: raw.samples.map(deserializeCategorySample),\n deletedSamples: raw.deletedSamples,\n newAnchor: raw.newAnchor,\n }\n}\n\nexport default queryCategorySamplesWithAnchor\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAgBpC,MAAMG,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,IAAAC,uBAAc,EAACF,OAAO,CAAC;EACpC,MAAMG,GAAG,GAAG,MAAMC,oBAAM,CAACN,8BAA8B,CACrDC,UAAU,EACVE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,MACP,CAAC;EAED,OAAO;IACLC,OAAO,EAAEN,GAAG,CAACM,OAAO,CAACC,GAAG,CAACC,kCAAyB,CAAC;IACnDC,cAAc,EAAET,GAAG,CAACS,cAAc;IAClCC,SAAS,EAAEV,GAAG,CAACU;EACjB,CAAC;AACH,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEcC,8BAA8B","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeCorrelation = _interopRequireDefault(require("./deserializeCorrelation"));
8
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
9
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const queryCorrelationSamples = async (typeIdentifier, options) => {
12
- const opts = (0, _prepareOptions.default)(options);
13
- const correlations = await _nativeTypes.default.queryCorrelationSamples(typeIdentifier, opts.from, opts.to);
14
- return correlations.map(_deserializeCorrelation.default);
15
- };
16
- var _default = exports.default = queryCorrelationSamples;
17
- //# sourceMappingURL=queryCorrelationSamples.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeCorrelation","_interopRequireDefault","require","_prepareOptions","_nativeTypes","e","__esModule","default","queryCorrelationSamples","typeIdentifier","options","opts","prepareOptions","correlations","Native","from","to","map","deserializeCorrelation","_default","exports"],"sources":["queryCorrelationSamples.ts"],"sourcesContent":["import deserializeCorrelation from './deserializeCorrelation'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { HKCorrelationTypeIdentifier } from '../native-types'\nimport type { GenericQueryOptions, HKCorrelation } from '../types'\n\nexport type QueryCorrelationSamplesFn = <\n TIdentifier extends HKCorrelationTypeIdentifier\n>(\n typeIdentifier: TIdentifier,\n options: Omit<GenericQueryOptions, 'anchor' | 'ascending' | 'limit'>\n) => Promise<readonly HKCorrelation<TIdentifier>[]>;\n\nconst queryCorrelationSamples: QueryCorrelationSamplesFn = async (\n typeIdentifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const correlations = await Native.queryCorrelationSamples(\n typeIdentifier,\n opts.from,\n opts.to,\n )\n\n return correlations.map(deserializeCorrelation)\n}\n\nexport default queryCorrelationSamples\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAYpC,MAAMG,uBAAkD,GAAG,MAAAA,CACzDC,cAAc,EACdC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,IAAAC,uBAAc,EAACF,OAAO,CAAC;EACpC,MAAMG,YAAY,GAAG,MAAMC,oBAAM,CAACN,uBAAuB,CACvDC,cAAc,EACdE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EACP,CAAC;EAED,OAAOH,YAAY,CAACI,GAAG,CAACC,+BAAsB,CAAC;AACjD,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEcC,uBAAuB","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeHeartbeatSeriesSample = _interopRequireDefault(require("./deserializeHeartbeatSeriesSample"));
8
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
9
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const queryHeartbeatSeriesSamples = async options => {
12
- const opts = (0, _prepareOptions.default)(options);
13
- const result = await _nativeTypes.default.queryHeartbeatSeriesSamples(opts.from, opts.to, opts.limit, opts.ascending);
14
- return result.map(_deserializeHeartbeatSeriesSample.default);
15
- };
16
- var _default = exports.default = queryHeartbeatSeriesSamples;
17
- //# sourceMappingURL=queryHeartbeatSeriesSamples.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeHeartbeatSeriesSample","_interopRequireDefault","require","_prepareOptions","_nativeTypes","e","__esModule","default","queryHeartbeatSeriesSamples","options","opts","prepareOptions","result","Native","from","to","limit","ascending","map","deserializeHeartbeatSeriesSample","_default","exports"],"sources":["queryHeartbeatSeriesSamples.ts"],"sourcesContent":["import deserializeHeartbeatSeriesSample from './deserializeHeartbeatSeriesSample'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { DeletedHeartbeatSeriesSampleRaw } from '../native-types'\nimport type { GenericQueryOptions, HKHeartbeatSeriesSample } from '../types'\n\nexport type QueryHeartbeatSeriesSamplesResponse = {\n readonly samples: readonly HKHeartbeatSeriesSample[],\n readonly deletedSamples: readonly DeletedHeartbeatSeriesSampleRaw[],\n readonly newAnchor: string\n}\n\nexport type QueryHeartbeatSeriesSamplesFn = (options: Omit<GenericQueryOptions, 'anchor'>) => Promise<readonly HKHeartbeatSeriesSample[]>;\n\nconst queryHeartbeatSeriesSamples: QueryHeartbeatSeriesSamplesFn = async (options) => {\n const opts = prepareOptions(options)\n\n const result = await Native.queryHeartbeatSeriesSamples(\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return result.map(deserializeHeartbeatSeriesSample)\n}\n\nexport default queryHeartbeatSeriesSamples\n"],"mappings":";;;;;;AAAA,IAAAA,iCAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAapC,MAAMG,2BAA0D,GAAG,MAAOC,OAAO,IAAK;EACpF,MAAMC,IAAI,GAAG,IAAAC,uBAAc,EAACF,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMC,oBAAM,CAACL,2BAA2B,CACrDE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,SACP,CAAC;EAED,OAAOL,MAAM,CAACM,GAAG,CAACC,yCAAgC,CAAC;AACrD,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEcC,2BAA2B","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeHeartbeatSeriesSample = _interopRequireDefault(require("./deserializeHeartbeatSeriesSample"));
8
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
9
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const queryHeartbeatSeriesSamplesWithAnchor = async options => {
12
- const opts = (0, _prepareOptions.default)(options);
13
- const result = await _nativeTypes.default.queryHeartbeatSeriesSamplesWithAnchor(opts.from, opts.to, opts.limit, opts.anchor);
14
- return {
15
- deletedSamples: result.deletedSamples,
16
- newAnchor: result.newAnchor,
17
- samples: result.samples.map(_deserializeHeartbeatSeriesSample.default)
18
- };
19
- };
20
- var _default = exports.default = queryHeartbeatSeriesSamplesWithAnchor;
21
- //# sourceMappingURL=queryHeartbeatSeriesSamplesWithAnchor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeHeartbeatSeriesSample","_interopRequireDefault","require","_prepareOptions","_nativeTypes","e","__esModule","default","queryHeartbeatSeriesSamplesWithAnchor","options","opts","prepareOptions","result","Native","from","to","limit","anchor","deletedSamples","newAnchor","samples","map","deserializeHeartbeatSeriesSample","_default","exports"],"sources":["queryHeartbeatSeriesSamplesWithAnchor.ts"],"sourcesContent":["import deserializeHeartbeatSeriesSample from './deserializeHeartbeatSeriesSample'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { DeletedHeartbeatSeriesSampleRaw } from '../native-types'\nimport type { GenericQueryOptions, HKHeartbeatSeriesSample } from '../types'\n\nexport type QueryHeartbeatSeriesSamplesResponse = {\n readonly samples: readonly HKHeartbeatSeriesSample[],\n readonly deletedSamples: readonly DeletedHeartbeatSeriesSampleRaw[],\n readonly newAnchor: string\n}\n\nexport type QueryHeartbeatSeriesSamplesFn = (options: Omit<GenericQueryOptions, 'ascending'>) => Promise<QueryHeartbeatSeriesSamplesResponse>;\n\nconst queryHeartbeatSeriesSamplesWithAnchor: QueryHeartbeatSeriesSamplesFn = async (options) => {\n const opts = prepareOptions(options)\n\n const result = await Native.queryHeartbeatSeriesSamplesWithAnchor(\n opts.from,\n opts.to,\n opts.limit,\n opts.anchor,\n )\n\n return {\n deletedSamples: result.deletedSamples,\n newAnchor: result.newAnchor,\n samples: result.samples.map(deserializeHeartbeatSeriesSample),\n }\n}\n\nexport default queryHeartbeatSeriesSamplesWithAnchor\n"],"mappings":";;;;;;AAAA,IAAAA,iCAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAapC,MAAMG,qCAAoE,GAAG,MAAOC,OAAO,IAAK;EAC9F,MAAMC,IAAI,GAAG,IAAAC,uBAAc,EAACF,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMC,oBAAM,CAACL,qCAAqC,CAC/DE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEN,MAAM,CAACM,cAAc;IACrCC,SAAS,EAAEP,MAAM,CAACO,SAAS;IAC3BC,OAAO,EAAER,MAAM,CAACQ,OAAO,CAACC,GAAG,CAACC,yCAAgC;EAC9D,CAAC;AACH,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEcC,qCAAqC","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeSample = _interopRequireDefault(require("./deserializeSample"));
8
- var _ensureUnit = _interopRequireDefault(require("./ensureUnit"));
9
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
10
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- const queryQuantitySamples = async (identifier, options) => {
13
- const unit = await (0, _ensureUnit.default)(identifier, options.unit);
14
- const opts = (0, _prepareOptions.default)(options);
15
- const result = await _nativeTypes.default.queryQuantitySamples(identifier, unit, opts.from, opts.to, opts.limit, opts.ascending);
16
- return result.map(_deserializeSample.default);
17
- };
18
- var _default = exports.default = queryQuantitySamples;
19
- //# sourceMappingURL=queryQuantitySamples.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeSample","_interopRequireDefault","require","_ensureUnit","_prepareOptions","_nativeTypes","e","__esModule","default","queryQuantitySamples","identifier","options","unit","ensureUnit","opts","prepareOptions","result","Native","from","to","limit","ascending","map","deserializeQuantitySample","_default","exports"],"sources":["queryQuantitySamples.ts"],"sourcesContent":["import deserializeQuantitySample from './deserializeSample'\nimport ensureUnit from './ensureUnit'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type {\n HKQuantityTypeIdentifier, UnitForIdentifier,\n} from '../native-types'\nimport type { GenericQueryOptions, HKQuantitySample } from '../types'\n\nexport type QueryQuantitySamplesFn = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n options: Omit<GenericQueryOptions, 'anchor'> & { readonly unit?: TUnit }\n) => Promise<readonly HKQuantitySample<TIdentifier>[]>;\n\nconst queryQuantitySamples: QueryQuantitySamplesFn = async (\n identifier,\n options,\n) => {\n const unit = await ensureUnit(identifier, options.unit)\n const opts = prepareOptions(options)\n\n const result = await Native.queryQuantitySamples(\n identifier,\n unit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return result.map(deserializeQuantitySample)\n}\n\nexport default queryQuantitySamples\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAepC,MAAMG,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAM,IAAAC,mBAAU,EAACH,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAME,IAAI,GAAG,IAAAC,uBAAc,EAACJ,OAAO,CAAC;EAEpC,MAAMK,MAAM,GAAG,MAAMC,oBAAM,CAACR,oBAAoB,CAC9CC,UAAU,EACVE,IAAI,EACJE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,SACP,CAAC;EAED,OAAOL,MAAM,CAACM,GAAG,CAACC,0BAAyB,CAAC;AAC9C,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEcC,oBAAoB","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _deserializeSample = _interopRequireDefault(require("./deserializeSample"));
8
- var _ensureUnit = _interopRequireDefault(require("./ensureUnit"));
9
- var _prepareOptions = _interopRequireDefault(require("./prepareOptions"));
10
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- const queryQuantitySamplesWithAnchor = async (identifier, options) => {
13
- const unit = await (0, _ensureUnit.default)(identifier, options.unit);
14
- const opts = (0, _prepareOptions.default)(options);
15
- const result = await _nativeTypes.default.queryQuantitySamplesWithAnchor(identifier, unit, opts.from, opts.to, opts.limit, opts.anchor);
16
- return {
17
- deletedSamples: result.deletedSamples,
18
- newAnchor: result.newAnchor,
19
- samples: result.samples.map(_deserializeSample.default)
20
- };
21
- };
22
- var _default = exports.default = queryQuantitySamplesWithAnchor;
23
- //# sourceMappingURL=queryQuantitySamplesWithAnchor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deserializeSample","_interopRequireDefault","require","_ensureUnit","_prepareOptions","_nativeTypes","e","__esModule","default","queryQuantitySamplesWithAnchor","identifier","options","unit","ensureUnit","opts","prepareOptions","result","Native","from","to","limit","anchor","deletedSamples","newAnchor","samples","map","deserializeQuantitySample","_default","exports"],"sources":["queryQuantitySamplesWithAnchor.ts"],"sourcesContent":["import deserializeQuantitySample from './deserializeSample'\nimport ensureUnit from './ensureUnit'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier, UnitForIdentifier, DeletedQuantitySampleRaw } from '../native-types'\nimport type { GenericQueryOptions, HKQuantitySample } from '../types'\n\nexport type QueryQuantitySamplesWithAnchorResponse<T extends HKQuantityTypeIdentifier> = {\n readonly samples: readonly HKQuantitySample<T>[],\n readonly deletedSamples: readonly DeletedQuantitySampleRaw<T>[],\n readonly newAnchor: string\n}\n\nexport type QueryQuantitySamplesWithAnchorFn = <\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n options: Omit<GenericQueryOptions, 'ascending'> & { readonly unit?: TUnit }\n) => Promise<QueryQuantitySamplesWithAnchorResponse<TIdentifier>>;\n\nconst queryQuantitySamplesWithAnchor: QueryQuantitySamplesWithAnchorFn = async (\n identifier,\n options,\n) => {\n const unit = await ensureUnit(identifier, options.unit)\n const opts = prepareOptions(options)\n\n const result = await Native.queryQuantitySamplesWithAnchor(\n identifier,\n unit,\n opts.from,\n opts.to,\n opts.limit,\n opts.anchor,\n )\n\n return {\n deletedSamples: result.deletedSamples,\n newAnchor: result.newAnchor,\n samples: result.samples.map(deserializeQuantitySample),\n }\n}\n\nexport default queryQuantitySamplesWithAnchor\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmBpC,MAAMG,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAM,IAAAC,mBAAU,EAACH,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAME,IAAI,GAAG,IAAAC,uBAAc,EAACJ,OAAO,CAAC;EAEpC,MAAMK,MAAM,GAAG,MAAMC,oBAAM,CAACR,8BAA8B,CACxDC,UAAU,EACVE,IAAI,EACJE,IAAI,CAACI,IAAI,EACTJ,IAAI,CAACK,EAAE,EACPL,IAAI,CAACM,KAAK,EACVN,IAAI,CAACO,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEN,MAAM,CAACM,cAAc;IACrCC,SAAS,EAAEP,MAAM,CAACO,SAAS;IAC3BC,OAAO,EAAER,MAAM,CAACQ,OAAO,CAACC,GAAG,CAACC,0BAAyB;EACvD,CAAC;AACH,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEcC,8BAA8B","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _nativeTypes = _interopRequireDefault(require("../native-types"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const querySources = async identifier => {
10
- const quantitySamples = await _nativeTypes.default.querySources(identifier);
11
- return quantitySamples;
12
- };
13
- var _default = exports.default = querySources;
14
- //# sourceMappingURL=querySources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_nativeTypes","_interopRequireDefault","require","e","__esModule","default","querySources","identifier","quantitySamples","Native","_default","exports"],"sources":["querySources.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type {\n HKQuantityTypeIdentifier,\n HKSource,\n HKCategoryTypeIdentifier,\n} from '../native-types'\n\nexport type QuerySourcesFn = <\n TIdentifier extends HKCategoryTypeIdentifier | HKQuantityTypeIdentifier\n>(\n identifier: TIdentifier\n) => Promise<readonly HKSource[]>;\n\nconst querySources: QuerySourcesFn = async (identifier) => {\n const quantitySamples = await Native.querySources(identifier)\n\n return quantitySamples\n}\n\nexport default querySources\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAcpC,MAAMG,YAA4B,GAAG,MAAOC,UAAU,IAAK;EACzD,MAAMC,eAAe,GAAG,MAAMC,oBAAM,CAACH,YAAY,CAACC,UAAU,CAAC;EAE7D,OAAOC,eAAe;AACxB,CAAC;AAAA,IAAAE,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcC,YAAY","ignoreList":[]}