@kingstinct/react-native-healthkit 7.3.2 → 8.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 (210) hide show
  1. package/README.md +1 -1
  2. package/ios/Constants.swift +1 -1
  3. package/ios/ReactNativeHealthkit.m +1 -1
  4. package/ios/ReactNativeHealthkit.swift +2 -2
  5. package/ios/Serializers.swift +12 -0
  6. package/lib/commonjs/hooks/useHealthkitAuthorization.js +2 -3
  7. package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +1 -1
  8. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +42 -19
  9. package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +1 -1
  10. package/lib/commonjs/hooks/useIsHealthDataAvailable.js +2 -3
  11. package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +1 -1
  12. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +17 -8
  13. package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +1 -1
  14. package/lib/commonjs/hooks/useMostRecentCategorySample.js +2 -3
  15. package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +1 -1
  16. package/lib/commonjs/hooks/useMostRecentQuantitySample.js +4 -3
  17. package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +1 -1
  18. package/lib/commonjs/hooks/useMostRecentWorkout.js +2 -3
  19. package/lib/commonjs/hooks/useMostRecentWorkout.js.map +1 -1
  20. package/lib/commonjs/hooks/useSources.js +2 -3
  21. package/lib/commonjs/hooks/useSources.js.map +1 -1
  22. package/lib/commonjs/hooks/useStatisticsForQuantity.js +2 -3
  23. package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +1 -1
  24. package/lib/commonjs/hooks/useSubscribeToChanges.js +2 -3
  25. package/lib/commonjs/hooks/useSubscribeToChanges.js.map +1 -1
  26. package/lib/commonjs/index.ios.js +18 -43
  27. package/lib/commonjs/index.ios.js.map +1 -1
  28. package/lib/commonjs/index.js +3 -4
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/index.native.js +46 -95
  31. package/lib/commonjs/index.native.js.map +1 -1
  32. package/lib/commonjs/index.web.js +3 -4
  33. package/lib/commonjs/index.web.js.map +1 -1
  34. package/lib/commonjs/native-types.js +65 -90
  35. package/lib/commonjs/native-types.js.map +1 -1
  36. package/lib/commonjs/test-setup.js +51 -0
  37. package/lib/commonjs/test-setup.js.map +1 -0
  38. package/lib/commonjs/test-utils.js +1 -2
  39. package/lib/commonjs/test-utils.js.map +1 -1
  40. package/lib/commonjs/types.js.map +1 -1
  41. package/lib/commonjs/utils/deleteQuantitySample.js +2 -3
  42. package/lib/commonjs/utils/deleteQuantitySample.js.map +1 -1
  43. package/lib/commonjs/utils/deleteSamples.js +2 -3
  44. package/lib/commonjs/utils/deleteSamples.js.map +1 -1
  45. package/lib/commonjs/utils/deserializeCategorySample.js +1 -2
  46. package/lib/commonjs/utils/deserializeCategorySample.js.map +1 -1
  47. package/lib/commonjs/utils/deserializeCategorySample.test.js +8 -4
  48. package/lib/commonjs/utils/deserializeCategorySample.test.js.map +1 -1
  49. package/lib/commonjs/utils/deserializeCorrelation.js +2 -3
  50. package/lib/commonjs/utils/deserializeCorrelation.js.map +1 -1
  51. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +1 -2
  52. package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
  53. package/lib/commonjs/utils/deserializeSample.js +1 -2
  54. package/lib/commonjs/utils/deserializeSample.js.map +1 -1
  55. package/lib/commonjs/utils/deserializeWorkout.js +1 -2
  56. package/lib/commonjs/utils/deserializeWorkout.js.map +1 -1
  57. package/lib/commonjs/utils/ensureMetadata.js +1 -2
  58. package/lib/commonjs/utils/ensureMetadata.js.map +1 -1
  59. package/lib/commonjs/utils/ensureTotals.js +1 -2
  60. package/lib/commonjs/utils/ensureTotals.js.map +1 -1
  61. package/lib/commonjs/utils/ensureUnit.js +2 -3
  62. package/lib/commonjs/utils/ensureUnit.js.map +1 -1
  63. package/lib/commonjs/utils/getDateOfBirth.js +2 -3
  64. package/lib/commonjs/utils/getDateOfBirth.js.map +1 -1
  65. package/lib/commonjs/utils/getMostRecentCategorySample.js +2 -3
  66. package/lib/commonjs/utils/getMostRecentCategorySample.js.map +1 -1
  67. package/lib/commonjs/utils/getMostRecentQuantitySample.js +2 -3
  68. package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +1 -1
  69. package/lib/commonjs/utils/getMostRecentWorkout.js +2 -3
  70. package/lib/commonjs/utils/getMostRecentWorkout.js.map +1 -1
  71. package/lib/commonjs/utils/getPreferredUnit.js +2 -3
  72. package/lib/commonjs/utils/getPreferredUnit.js.map +1 -1
  73. package/lib/commonjs/utils/getPreferredUnits.js +2 -3
  74. package/lib/commonjs/utils/getPreferredUnits.js.map +1 -1
  75. package/lib/commonjs/utils/getPreferredUnitsTyped.js +3 -4
  76. package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +1 -1
  77. package/lib/commonjs/utils/getRequestStatusForAuthorization.js +3 -5
  78. package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +1 -1
  79. package/lib/commonjs/utils/getWorkoutPlanById.js +2 -3
  80. package/lib/commonjs/utils/getWorkoutPlanById.js.map +1 -1
  81. package/lib/commonjs/utils/prepareOptions.js +3 -3
  82. package/lib/commonjs/utils/prepareOptions.js.map +1 -1
  83. package/lib/commonjs/utils/queryCategorySamples.js +2 -3
  84. package/lib/commonjs/utils/queryCategorySamples.js.map +1 -1
  85. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +2 -3
  86. package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +1 -1
  87. package/lib/commonjs/utils/queryCorrelationSamples.js +2 -3
  88. package/lib/commonjs/utils/queryCorrelationSamples.js.map +1 -1
  89. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +2 -3
  90. package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +1 -1
  91. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +2 -3
  92. package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
  93. package/lib/commonjs/utils/queryQuantitySamples.js +2 -3
  94. package/lib/commonjs/utils/queryQuantitySamples.js.map +1 -1
  95. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +2 -3
  96. package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
  97. package/lib/commonjs/utils/querySources.js +2 -3
  98. package/lib/commonjs/utils/querySources.js.map +1 -1
  99. package/lib/commonjs/utils/queryStatisticsForQuantity.js +2 -3
  100. package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +1 -1
  101. package/lib/commonjs/utils/queryWorkouts.js +2 -3
  102. package/lib/commonjs/utils/queryWorkouts.js.map +1 -1
  103. package/lib/commonjs/utils/requestAuthorization.js +3 -5
  104. package/lib/commonjs/utils/requestAuthorization.js.map +1 -1
  105. package/lib/commonjs/utils/saveCategorySample.js +2 -3
  106. package/lib/commonjs/utils/saveCategorySample.js.map +1 -1
  107. package/lib/commonjs/utils/saveCorrelationSample.js +2 -3
  108. package/lib/commonjs/utils/saveCorrelationSample.js.map +1 -1
  109. package/lib/commonjs/utils/saveQuantitySample.js +2 -3
  110. package/lib/commonjs/utils/saveQuantitySample.js.map +1 -1
  111. package/lib/commonjs/utils/saveWorkoutRoute.js +2 -3
  112. package/lib/commonjs/utils/saveWorkoutRoute.js.map +1 -1
  113. package/lib/commonjs/utils/saveWorkoutSample.js +2 -3
  114. package/lib/commonjs/utils/saveWorkoutSample.js.map +1 -1
  115. package/lib/commonjs/utils/serializeDate.js +1 -2
  116. package/lib/commonjs/utils/serializeDate.js.map +1 -1
  117. package/lib/commonjs/utils/serializeDate.test.js +1 -1
  118. package/lib/commonjs/utils/serializeDate.test.js.map +1 -1
  119. package/lib/commonjs/utils/subscribeToChanges.js +6 -8
  120. package/lib/commonjs/utils/subscribeToChanges.js.map +1 -1
  121. package/lib/module/hooks/useHealthkitAuthorization.js.map +1 -1
  122. package/lib/module/hooks/useHealthkitAuthorization.test.js +26 -3
  123. package/lib/module/hooks/useHealthkitAuthorization.test.js.map +1 -1
  124. package/lib/module/hooks/useIsHealthDataAvailable.js.map +1 -1
  125. package/lib/module/hooks/useIsHealthDataAvailable.test.js +9 -2
  126. package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +1 -1
  127. package/lib/module/hooks/useMostRecentCategorySample.js.map +1 -1
  128. package/lib/module/hooks/useMostRecentQuantitySample.js +2 -0
  129. package/lib/module/hooks/useMostRecentQuantitySample.js.map +1 -1
  130. package/lib/module/hooks/useMostRecentWorkout.js.map +1 -1
  131. package/lib/module/hooks/useSources.js.map +1 -1
  132. package/lib/module/hooks/useStatisticsForQuantity.js.map +1 -1
  133. package/lib/module/hooks/useSubscribeToChanges.js.map +1 -1
  134. package/lib/module/index.ios.js +4 -15
  135. package/lib/module/index.ios.js.map +1 -1
  136. package/lib/module/index.js.map +1 -1
  137. package/lib/module/index.native.js +1 -3
  138. package/lib/module/index.native.js.map +1 -1
  139. package/lib/module/index.web.js.map +1 -1
  140. package/lib/module/native-types.js +21 -2
  141. package/lib/module/native-types.js.map +1 -1
  142. package/lib/module/test-setup.js +48 -0
  143. package/lib/module/test-setup.js.map +1 -0
  144. package/lib/module/test-utils.js.map +1 -1
  145. package/lib/module/types.js.map +1 -1
  146. package/lib/module/utils/deleteQuantitySample.js.map +1 -1
  147. package/lib/module/utils/deleteSamples.js.map +1 -1
  148. package/lib/module/utils/deserializeCategorySample.js.map +1 -1
  149. package/lib/module/utils/deserializeCategorySample.test.js +4 -2
  150. package/lib/module/utils/deserializeCategorySample.test.js.map +1 -1
  151. package/lib/module/utils/deserializeCorrelation.js.map +1 -1
  152. package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +1 -1
  153. package/lib/module/utils/deserializeSample.js.map +1 -1
  154. package/lib/module/utils/deserializeWorkout.js.map +1 -1
  155. package/lib/module/utils/ensureMetadata.js.map +1 -1
  156. package/lib/module/utils/ensureTotals.js.map +1 -1
  157. package/lib/module/utils/ensureUnit.js.map +1 -1
  158. package/lib/module/utils/getDateOfBirth.js.map +1 -1
  159. package/lib/module/utils/getMostRecentCategorySample.js.map +1 -1
  160. package/lib/module/utils/getMostRecentQuantitySample.js.map +1 -1
  161. package/lib/module/utils/getMostRecentWorkout.js.map +1 -1
  162. package/lib/module/utils/getPreferredUnit.js.map +1 -1
  163. package/lib/module/utils/getPreferredUnits.js.map +1 -1
  164. package/lib/module/utils/getPreferredUnitsTyped.js.map +1 -1
  165. package/lib/module/utils/getRequestStatusForAuthorization.js +1 -2
  166. package/lib/module/utils/getRequestStatusForAuthorization.js.map +1 -1
  167. package/lib/module/utils/getWorkoutPlanById.js.map +1 -1
  168. package/lib/module/utils/prepareOptions.js +1 -0
  169. package/lib/module/utils/prepareOptions.js.map +1 -1
  170. package/lib/module/utils/queryCategorySamples.js.map +1 -1
  171. package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +1 -1
  172. package/lib/module/utils/queryCorrelationSamples.js.map +1 -1
  173. package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +1 -1
  174. package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +1 -1
  175. package/lib/module/utils/queryQuantitySamples.js.map +1 -1
  176. package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +1 -1
  177. package/lib/module/utils/querySources.js.map +1 -1
  178. package/lib/module/utils/queryStatisticsForQuantity.js.map +1 -1
  179. package/lib/module/utils/queryWorkouts.js.map +1 -1
  180. package/lib/module/utils/requestAuthorization.js +1 -2
  181. package/lib/module/utils/requestAuthorization.js.map +1 -1
  182. package/lib/module/utils/saveCategorySample.js.map +1 -1
  183. package/lib/module/utils/saveCorrelationSample.js.map +1 -1
  184. package/lib/module/utils/saveQuantitySample.js.map +1 -1
  185. package/lib/module/utils/saveWorkoutRoute.js.map +1 -1
  186. package/lib/module/utils/saveWorkoutSample.js.map +1 -1
  187. package/lib/module/utils/serializeDate.js.map +1 -1
  188. package/lib/module/utils/serializeDate.test.js.map +1 -1
  189. package/lib/module/utils/subscribeToChanges.js +3 -4
  190. package/lib/module/utils/subscribeToChanges.js.map +1 -1
  191. package/lib/typescript/src/index.ios.d.ts +2 -10
  192. package/lib/typescript/src/index.native.d.ts +2 -2
  193. package/lib/typescript/src/native-types.d.ts +86 -8
  194. package/package.json +16 -11
  195. package/src/hooks/useHealthkitAuthorization.test.ts +18 -4
  196. package/src/hooks/useIsHealthDataAvailable.test.ts +5 -2
  197. package/src/hooks/useIsHealthDataAvailable.ts +1 -1
  198. package/src/hooks/useMostRecentQuantitySample.ts +3 -0
  199. package/src/index.ios.tsx +2 -15
  200. package/src/index.native.tsx +0 -3
  201. package/src/native-types.ts +97 -9
  202. package/src/test-setup.ts +51 -0
  203. package/src/utils/deserializeCategorySample.test.ts +5 -2
  204. package/src/utils/prepareOptions.ts +1 -0
  205. package/lib/commonjs/jest.setup.js +0 -45
  206. package/lib/commonjs/jest.setup.js.map +0 -1
  207. package/lib/module/jest.setup.js +0 -43
  208. package/lib/module/jest.setup.js.map +0 -1
  209. package/src/jest.setup.ts +0 -46
  210. /package/lib/typescript/src/{jest.setup.d.ts → test-setup.d.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import { mock, jest, beforeAll } from 'bun:test';
3
+ beforeAll(async () => {
4
+ const mockModule = {
5
+ isHealthDataAvailable: jest.fn(),
6
+ isProtectedDataAvailable: jest.fn(),
7
+ authorizationStatusFor: jest.fn(),
8
+ requestAuthorization: jest.fn(),
9
+ saveQuantitySample: jest.fn(),
10
+ deleteQuantitySample: jest.fn(),
11
+ deleteSamples: jest.fn(),
12
+ disableAllBackgroundDelivery: jest.fn(),
13
+ disableBackgroundDelivery: jest.fn(),
14
+ enableBackgroundDelivery: jest.fn(),
15
+ queryCategorySamplesWithAnchor: jest.fn(),
16
+ queryQuantitySamplesWithAnchor: jest.fn(),
17
+ getBiologicalSex: jest.fn(),
18
+ getBloodType: jest.fn(),
19
+ getDateOfBirth: jest.fn(),
20
+ getFitzpatrickSkinType: jest.fn(),
21
+ getPreferredUnits: jest.fn(),
22
+ getRequestStatusForAuthorization: jest.fn(),
23
+ getWheelchairUse: jest.fn(),
24
+ getWorkoutRoutes: jest.fn(),
25
+ queryCategorySamples: jest.fn(),
26
+ queryCorrelationSamples: jest.fn(),
27
+ queryHeartbeatSeriesSamples: jest.fn(),
28
+ queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),
29
+ queryQuantitySamples: jest.fn(),
30
+ querySources: jest.fn(),
31
+ queryStatisticsForQuantity: jest.fn(),
32
+ queryWorkoutSamples: jest.fn(),
33
+ saveCategorySample: jest.fn(),
34
+ saveCorrelationSample: jest.fn(),
35
+ saveWorkoutSample: jest.fn(),
36
+ subscribeToObserverQuery: jest.fn(),
37
+ unsubscribeQuery: jest.fn(),
38
+ saveWorkoutRoute: jest.fn(),
39
+ getWorkoutPlanById: jest.fn()
40
+ };
41
+ await mock.module('react-native', () => ({
42
+ NativeModules: {
43
+ ReactNativeHealthkit: mockModule
44
+ },
45
+ NativeEventEmitter: jest.fn()
46
+ }));
47
+ });
48
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mock","jest","beforeAll","mockModule","isHealthDataAvailable","fn","isProtectedDataAvailable","authorizationStatusFor","requestAuthorization","saveQuantitySample","deleteQuantitySample","deleteSamples","disableAllBackgroundDelivery","disableBackgroundDelivery","enableBackgroundDelivery","queryCategorySamplesWithAnchor","queryQuantitySamplesWithAnchor","getBiologicalSex","getBloodType","getDateOfBirth","getFitzpatrickSkinType","getPreferredUnits","getRequestStatusForAuthorization","getWheelchairUse","getWorkoutRoutes","queryCategorySamples","queryCorrelationSamples","queryHeartbeatSeriesSamples","queryHeartbeatSeriesSamplesWithAnchor","queryQuantitySamples","querySources","queryStatisticsForQuantity","queryWorkoutSamples","saveCategorySample","saveCorrelationSample","saveWorkoutSample","subscribeToObserverQuery","unsubscribeQuery","saveWorkoutRoute","getWorkoutPlanById","module","NativeModules","ReactNativeHealthkit","NativeEventEmitter"],"sources":["test-setup.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unresolved\nimport { mock, jest, beforeAll } from 'bun:test'\n\nimport type Native from './native-types'\n\nbeforeAll(async () => {\n const mockModule: typeof Native = {\n isHealthDataAvailable: jest.fn(),\n isProtectedDataAvailable: jest.fn(),\n authorizationStatusFor: jest.fn(),\n requestAuthorization: jest.fn(),\n saveQuantitySample: jest.fn(),\n deleteQuantitySample: jest.fn(),\n deleteSamples: jest.fn(),\n disableAllBackgroundDelivery: jest.fn(),\n disableBackgroundDelivery: jest.fn(),\n enableBackgroundDelivery: jest.fn(),\n queryCategorySamplesWithAnchor: jest.fn(),\n queryQuantitySamplesWithAnchor: jest.fn(),\n getBiologicalSex: jest.fn(),\n getBloodType: jest.fn(),\n getDateOfBirth: jest.fn(),\n getFitzpatrickSkinType: jest.fn(),\n getPreferredUnits: jest.fn(),\n getRequestStatusForAuthorization: jest.fn(),\n getWheelchairUse: jest.fn(),\n getWorkoutRoutes: jest.fn(),\n queryCategorySamples: jest.fn(),\n queryCorrelationSamples: jest.fn(),\n queryHeartbeatSeriesSamples: jest.fn(),\n queryHeartbeatSeriesSamplesWithAnchor: jest.fn(),\n queryQuantitySamples: jest.fn(),\n querySources: jest.fn(),\n queryStatisticsForQuantity: jest.fn(),\n queryWorkoutSamples: jest.fn(),\n saveCategorySample: jest.fn(),\n saveCorrelationSample: jest.fn(),\n saveWorkoutSample: jest.fn(),\n subscribeToObserverQuery: jest.fn(),\n unsubscribeQuery: jest.fn(),\n saveWorkoutRoute: jest.fn(),\n getWorkoutPlanById: jest.fn(),\n }\n\n await mock.module('react-native', () => ({\n NativeModules: {\n ReactNativeHealthkit: mockModule,\n },\n NativeEventEmitter: jest.fn(),\n }))\n})\n"],"mappings":"AAAA;AACA,SAASA,IAAI,EAAEC,IAAI,EAAEC,SAAS,QAAQ,UAAU;AAIhDA,SAAS,CAAC,YAAY;EACpB,MAAMC,UAAyB,GAAG;IAChCC,qBAAqB,EAAEH,IAAI,CAACI,EAAE,CAAC,CAAC;IAChCC,wBAAwB,EAAEL,IAAI,CAACI,EAAE,CAAC,CAAC;IACnCE,sBAAsB,EAAEN,IAAI,CAACI,EAAE,CAAC,CAAC;IACjCG,oBAAoB,EAAEP,IAAI,CAACI,EAAE,CAAC,CAAC;IAC/BI,kBAAkB,EAAER,IAAI,CAACI,EAAE,CAAC,CAAC;IAC7BK,oBAAoB,EAAET,IAAI,CAACI,EAAE,CAAC,CAAC;IAC/BM,aAAa,EAAEV,IAAI,CAACI,EAAE,CAAC,CAAC;IACxBO,4BAA4B,EAAEX,IAAI,CAACI,EAAE,CAAC,CAAC;IACvCQ,yBAAyB,EAAEZ,IAAI,CAACI,EAAE,CAAC,CAAC;IACpCS,wBAAwB,EAAEb,IAAI,CAACI,EAAE,CAAC,CAAC;IACnCU,8BAA8B,EAAEd,IAAI,CAACI,EAAE,CAAC,CAAC;IACzCW,8BAA8B,EAAEf,IAAI,CAACI,EAAE,CAAC,CAAC;IACzCY,gBAAgB,EAAEhB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3Ba,YAAY,EAAEjB,IAAI,CAACI,EAAE,CAAC,CAAC;IACvBc,cAAc,EAAElB,IAAI,CAACI,EAAE,CAAC,CAAC;IACzBe,sBAAsB,EAAEnB,IAAI,CAACI,EAAE,CAAC,CAAC;IACjCgB,iBAAiB,EAAEpB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC5BiB,gCAAgC,EAAErB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3CkB,gBAAgB,EAAEtB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3BmB,gBAAgB,EAAEvB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3BoB,oBAAoB,EAAExB,IAAI,CAACI,EAAE,CAAC,CAAC;IAC/BqB,uBAAuB,EAAEzB,IAAI,CAACI,EAAE,CAAC,CAAC;IAClCsB,2BAA2B,EAAE1B,IAAI,CAACI,EAAE,CAAC,CAAC;IACtCuB,qCAAqC,EAAE3B,IAAI,CAACI,EAAE,CAAC,CAAC;IAChDwB,oBAAoB,EAAE5B,IAAI,CAACI,EAAE,CAAC,CAAC;IAC/ByB,YAAY,EAAE7B,IAAI,CAACI,EAAE,CAAC,CAAC;IACvB0B,0BAA0B,EAAE9B,IAAI,CAACI,EAAE,CAAC,CAAC;IACrC2B,mBAAmB,EAAE/B,IAAI,CAACI,EAAE,CAAC,CAAC;IAC9B4B,kBAAkB,EAAEhC,IAAI,CAACI,EAAE,CAAC,CAAC;IAC7B6B,qBAAqB,EAAEjC,IAAI,CAACI,EAAE,CAAC,CAAC;IAChC8B,iBAAiB,EAAElC,IAAI,CAACI,EAAE,CAAC,CAAC;IAC5B+B,wBAAwB,EAAEnC,IAAI,CAACI,EAAE,CAAC,CAAC;IACnCgC,gBAAgB,EAAEpC,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3BiC,gBAAgB,EAAErC,IAAI,CAACI,EAAE,CAAC,CAAC;IAC3BkC,kBAAkB,EAAEtC,IAAI,CAACI,EAAE,CAAC;EAC9B,CAAC;EAED,MAAML,IAAI,CAACwC,MAAM,CAAC,cAAc,EAAE,OAAO;IACvCC,aAAa,EAAE;MACbC,oBAAoB,EAAEvC;IACxB,CAAC;IACDwC,kBAAkB,EAAE1C,IAAI,CAACI,EAAE,CAAC;EAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["act","waitForNextUpdate","Promise","resolve","setTimeout"],"sources":["test-utils.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nimport { act } from '@testing-library/react-native'\n\nconst waitForNextUpdate = async () => {\n await act(async () => {\n await new Promise((resolve) => { setTimeout(resolve, 0) })\n })\n}\n\nexport default waitForNextUpdate\n"],"mappings":"AAAA;AACA,SAASA,GAAG,QAAQ,+BAA+B;AAEnD,MAAMC,iBAAiB,GAAG,MAAAA,CAAA,KAAY;EACpC,MAAMD,GAAG,CAAC,YAAY;IACpB,MAAM,IAAIE,OAAO,CAAEC,OAAO,IAAK;MAAEC,UAAU,CAACD,OAAO,EAAE,CAAC,CAAC;IAAC,CAAC,CAAC;EAC5D,CAAC,CAAC;AACJ,CAAC;AAED,eAAeF,iBAAiB"}
1
+ {"version":3,"names":["act","waitForNextUpdate","Promise","resolve","setTimeout"],"sources":["test-utils.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nimport { act } from '@testing-library/react-native'\n\nconst waitForNextUpdate = async () => {\n await act(async () => {\n await new Promise((resolve) => { setTimeout(resolve, 0) })\n })\n}\n\nexport default waitForNextUpdate\n"],"mappings":"AAAA;AACA,SAASA,GAAG,QAAQ,+BAA+B;AAEnD,MAAMC,iBAAiB,GAAG,MAAAA,CAAA,KAAY;EACpC,MAAMD,GAAG,CAAC,YAAY;IACpB,MAAM,IAAIE,OAAO,CAAEC,OAAO,IAAK;MAAEC,UAAU,CAACD,OAAO,EAAE,CAAC,CAAC;IAAC,CAAC,CAAC;EAC5D,CAAC,CAAC;AACJ,CAAC;AAED,eAAeF,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n CLLocationRawForSaving,\n EnergyUnit,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKDevice,\n HKHeartbeatSeriesSampleRaw,\n HKQuantityTypeIdentifier,\n HKSourceRevision,\n HKUnit,\n HKWorkoutRaw,\n LengthUnit,\n MetadataMapperForQuantityIdentifier,\n QueryStatisticsResponseRaw,\n UnitForIdentifier,\n} from './native-types'\n\nexport * from './native-types'\n\n/**\n * Options for querying workouts.\n * @template TEnergy The energy unit type.\n * @template TDistance The distance unit type.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkout Apple Docs HKWorkout}\n */\nexport interface QueryWorkoutsOptions<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n> extends GenericQueryOptions {\n readonly energyUnit?: TEnergy;\n readonly distanceUnit?: TDistance;\n}\n\n/**\n * Represents a category sample.\n * @template T The category type identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorysample Apple Docs HKCategorySample}\n */\nexport interface HKCategorySample<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> extends Omit<HKCategorySampleRaw<T>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Generic options for querying.\n */\nexport type GenericQueryOptions = {\n readonly from?: Date;\n readonly to?: Date;\n readonly limit?: number;\n readonly ascending?: boolean;\n readonly anchor?: string\n};\n\n/**\n * Represents a workout.\n * @template TEnergy The energy unit type.\n * @template TDistance The distance unit type.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkout Apple Docs HKWorkout}\n */\nexport interface HKWorkout<\n TEnergy extends EnergyUnit = EnergyUnit,\n TDistance extends LengthUnit = LengthUnit\n> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a heartbeat series sample.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkheartbeatseriessample Apple Docs HKHeartbeatSeriesSample}\n */\nexport interface HKHeartbeatSeriesSample extends Omit<HKHeartbeatSeriesSampleRaw, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a quantity sample.\n * @template TIdentifier The quantity type identifier.\n * @template TUnit The unit for the identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs HKQuantitySample}\n */\nexport interface HKQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>\n> {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TIdentifier;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a response from a statistics query.\n * @template TIdentifier The quantity type identifier.\n * @template TUnit The unit for the identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsquery Apple Docs HKStatisticsQuery}\n */\nexport interface QueryStatisticsResponse<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>\n extends Omit<\n QueryStatisticsResponseRaw<TIdentifier, TUnit>,\n 'mostRecentQuantityDateInterval'\n > {\n readonly mostRecentQuantityDateInterval?: { readonly from: Date; readonly to: Date };\n}\n\n/**\n * Represents a category sample for saving.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorysample Apple Docs HKCategorySample}\n */\nexport type HKCategorySampleForSaving = Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'> & {\n readonly startDate?: Date;\n readonly endDate?: Date;\n}\n\n/**\n * Represents a quantity sample for saving.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs HKQuantitySample}\n */\nexport type HKQuantitySampleForSaving = Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'> & {\n readonly startDate?: Date;\n readonly endDate?: Date;\n};\n\n/**\n * Represents a correlation.\n * @template TIdentifier The correlation type identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelation Apple Docs HKCorrelation}\n */\nexport interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>\n extends Omit<\n HKCorrelationRaw<TIdentifier>,\n 'endDate' | 'objects' | 'startDate'\n > {\n readonly objects: readonly (HKCategorySample | HKQuantitySample)[];\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a location sample for saving.\n * @see {@link https://developer.apple.com/documentation/corelocation/cllocation Apple Docs CLLocation}\n */\nexport type CLLocationForSaving = Omit<CLLocationRawForSaving, 'timestamp'> & {\n readonly timestamp: number;\n};\n"],"mappings":"AAmBA,cAAc,gBAAgB;;AAE9B;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AAHA"}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n CLLocationRawForSaving,\n EnergyUnit,\n HKCategorySampleRaw,\n HKCategoryTypeIdentifier,\n HKCorrelationRaw,\n HKCorrelationTypeIdentifier,\n HKDevice,\n HKHeartbeatSeriesSampleRaw,\n HKQuantityTypeIdentifier,\n HKSourceRevision,\n HKUnit,\n HKWorkoutRaw,\n LengthUnit,\n MetadataMapperForQuantityIdentifier,\n QueryStatisticsResponseRaw,\n UnitForIdentifier,\n} from './native-types'\n\nexport * from './native-types'\n\n/**\n * Options for querying workouts.\n * @template TEnergy The energy unit type.\n * @template TDistance The distance unit type.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkout Apple Docs HKWorkout}\n */\nexport interface QueryWorkoutsOptions<\n TEnergy extends HKUnit,\n TDistance extends HKUnit\n> extends GenericQueryOptions {\n readonly energyUnit?: TEnergy;\n readonly distanceUnit?: TDistance;\n}\n\n/**\n * Represents a category sample.\n * @template T The category type identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorysample Apple Docs HKCategorySample}\n */\nexport interface HKCategorySample<\n T extends HKCategoryTypeIdentifier = HKCategoryTypeIdentifier\n> extends Omit<HKCategorySampleRaw<T>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Generic options for querying.\n */\nexport type GenericQueryOptions = {\n readonly from?: Date;\n readonly to?: Date;\n readonly limit?: number;\n readonly ascending?: boolean;\n readonly anchor?: string\n};\n\n/**\n * Represents a workout.\n * @template TEnergy The energy unit type.\n * @template TDistance The distance unit type.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkworkout Apple Docs HKWorkout}\n */\nexport interface HKWorkout<\n TEnergy extends EnergyUnit = EnergyUnit,\n TDistance extends LengthUnit = LengthUnit\n> extends Omit<HKWorkoutRaw<TEnergy, TDistance>, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a heartbeat series sample.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkheartbeatseriessample Apple Docs HKHeartbeatSeriesSample}\n */\nexport interface HKHeartbeatSeriesSample extends Omit<HKHeartbeatSeriesSampleRaw, 'endDate' | 'startDate'> {\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a quantity sample.\n * @template TIdentifier The quantity type identifier.\n * @template TUnit The unit for the identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs HKQuantitySample}\n */\nexport interface HKQuantitySample<\n TIdentifier extends HKQuantityTypeIdentifier = HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>\n> {\n readonly uuid: string;\n readonly device?: HKDevice;\n readonly quantityType: TIdentifier;\n readonly quantity: number;\n readonly unit: TUnit;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TIdentifier>;\n readonly sourceRevision?: HKSourceRevision;\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a response from a statistics query.\n * @template TIdentifier The quantity type identifier.\n * @template TUnit The unit for the identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkstatisticsquery Apple Docs HKStatisticsQuery}\n */\nexport interface QueryStatisticsResponse<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>\n extends Omit<\n QueryStatisticsResponseRaw<TIdentifier, TUnit>,\n 'mostRecentQuantityDateInterval'\n > {\n readonly mostRecentQuantityDateInterval?: { readonly from: Date; readonly to: Date };\n}\n\n/**\n * Represents a category sample for saving.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcategorysample Apple Docs HKCategorySample}\n */\nexport type HKCategorySampleForSaving = Omit<HKCategorySample, 'device' | 'endDate' | 'startDate' | 'uuid'> & {\n readonly startDate?: Date;\n readonly endDate?: Date;\n}\n\n/**\n * Represents a quantity sample for saving.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkquantitysample Apple Docs HKQuantitySample}\n */\nexport type HKQuantitySampleForSaving = Omit<HKQuantitySample, 'device' | 'endDate' | 'startDate' | 'uuid'> & {\n readonly startDate?: Date;\n readonly endDate?: Date;\n};\n\n/**\n * Represents a correlation.\n * @template TIdentifier The correlation type identifier.\n * @see {@link https://developer.apple.com/documentation/healthkit/hkcorrelation Apple Docs HKCorrelation}\n */\nexport interface HKCorrelation<TIdentifier extends HKCorrelationTypeIdentifier>\n extends Omit<\n HKCorrelationRaw<TIdentifier>,\n 'endDate' | 'objects' | 'startDate'\n > {\n readonly objects: readonly (HKCategorySample | HKQuantitySample)[];\n readonly startDate: Date;\n readonly endDate: Date;\n}\n\n/**\n * Represents a location sample for saving.\n * @see {@link https://developer.apple.com/documentation/corelocation/cllocation Apple Docs CLLocation}\n */\nexport type CLLocationForSaving = Omit<CLLocationRawForSaving, 'timestamp'> & {\n readonly timestamp: number;\n};\n"],"mappings":"AAmBA,cAAc,gBAAgB;;AAE9B;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AAHA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","deleteQuantitySample","identifier","uuid"],"sources":["deleteQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteQuantitySampleFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n identifier: TIdentifier,\n uuid: string\n) => Promise<boolean>\n\nconst deleteQuantitySample: DeleteQuantitySampleFn = async (identifier, uuid) => Native.deleteQuantitySample(identifier, uuid)\n\nexport default deleteQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAWpC,MAAMC,oBAA4C,GAAG,MAAAA,CAAOC,UAAU,EAAEC,IAAI,KAAKH,MAAM,CAACC,oBAAoB,CAACC,UAAU,EAAEC,IAAI,CAAC;AAE9H,eAAeF,oBAAoB"}
1
+ {"version":3,"names":["Native","deleteQuantitySample","identifier","uuid"],"sources":["deleteQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteQuantitySampleFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n identifier: TIdentifier,\n uuid: string\n) => Promise<boolean>\n\nconst deleteQuantitySample: DeleteQuantitySampleFn = async (identifier, uuid) => Native.deleteQuantitySample(identifier, uuid)\n\nexport default deleteQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAWpC,MAAMC,oBAA4C,GAAG,MAAAA,CAAOC,UAAU,EAAEC,IAAI,KAAKH,MAAM,CAACC,oBAAoB,CAACC,UAAU,EAAEC,IAAI,CAAC;AAE9H,eAAeF,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","deleteSamples","sample","start","startDate","Date","end","endDate","identifier","toISOString"],"sources":["deleteSamples.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteSamplesFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n sample: {\n readonly identifier: TIdentifier,\n readonly startDate?: Date;\n readonly endDate?: Date;\n }\n) => Promise<boolean>\n\nconst deleteSamples: DeleteSamplesFn = async (sample) => {\n const start = sample.startDate || new Date()\n const end = sample.endDate || new Date()\n const { identifier } = sample\n\n return Native.deleteSamples(identifier, start.toISOString(), end.toISOString())\n}\n\nexport default deleteSamples\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAcpC,MAAMC,aAA8B,GAAG,MAAOC,MAAM,IAAK;EACvD,MAAMC,KAAK,GAAGD,MAAM,CAACE,SAAS,IAAI,IAAIC,IAAI,CAAC,CAAC;EAC5C,MAAMC,GAAG,GAAGJ,MAAM,CAACK,OAAO,IAAI,IAAIF,IAAI,CAAC,CAAC;EACxC,MAAM;IAAEG;EAAW,CAAC,GAAGN,MAAM;EAE7B,OAAOF,MAAM,CAACC,aAAa,CAACO,UAAU,EAAEL,KAAK,CAACM,WAAW,CAAC,CAAC,EAAEH,GAAG,CAACG,WAAW,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,eAAeR,aAAa"}
1
+ {"version":3,"names":["Native","deleteSamples","sample","start","startDate","Date","end","endDate","identifier","toISOString"],"sources":["deleteSamples.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier } from '../native-types'\n\nexport type DeleteSamplesFn = <\n TIdentifier extends HKQuantityTypeIdentifier\n>(\n sample: {\n readonly identifier: TIdentifier,\n readonly startDate?: Date;\n readonly endDate?: Date;\n }\n) => Promise<boolean>\n\nconst deleteSamples: DeleteSamplesFn = async (sample) => {\n const start = sample.startDate || new Date()\n const end = sample.endDate || new Date()\n const { identifier } = sample\n\n return Native.deleteSamples(identifier, start.toISOString(), end.toISOString())\n}\n\nexport default deleteSamples\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAcpC,MAAMC,aAA8B,GAAG,MAAOC,MAAM,IAAK;EACvD,MAAMC,KAAK,GAAGD,MAAM,CAACE,SAAS,IAAI,IAAIC,IAAI,CAAC,CAAC;EAC5C,MAAMC,GAAG,GAAGJ,MAAM,CAACK,OAAO,IAAI,IAAIF,IAAI,CAAC,CAAC;EACxC,MAAM;IAAEG;EAAW,CAAC,GAAGN,MAAM;EAE7B,OAAOF,MAAM,CAACC,aAAa,CAACO,UAAU,EAAEL,KAAK,CAACM,WAAW,CAAC,CAAC,EAAEH,GAAG,CAACG,WAAW,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,eAAeR,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeCategorySample","sample","startDate","Date","endDate"],"sources":["deserializeCategorySample.ts"],"sourcesContent":["import type { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\nconst deserializeCategorySample = <T extends HKCategoryTypeIdentifier>(\n sample: HKCategorySampleRaw<T>,\n): HKCategorySample<T> => ({\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n})\n\nexport default deserializeCategorySample\n"],"mappings":"AAGA,MAAMA,yBAAyB,GAC7BC,MAA8B,KACL;EACzB,GAAGA,MAAM;EACTC,SAAS,EAAE,IAAIC,IAAI,CAACF,MAAM,CAACC,SAAS,CAAC;EACrCE,OAAO,EAAE,IAAID,IAAI,CAACF,MAAM,CAACG,OAAO;AAClC,CAAC,CAAC;AAEF,eAAeJ,yBAAyB"}
1
+ {"version":3,"names":["deserializeCategorySample","sample","startDate","Date","endDate"],"sources":["deserializeCategorySample.ts"],"sourcesContent":["import type { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../native-types'\nimport type { HKCategorySample } from '../types'\n\nconst deserializeCategorySample = <T extends HKCategoryTypeIdentifier>(\n sample: HKCategorySampleRaw<T>,\n): HKCategorySample<T> => ({\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n})\n\nexport default deserializeCategorySample\n"],"mappings":"AAGA,MAAMA,yBAAyB,GAC7BC,MAA8B,KACL;EACzB,GAAGA,MAAM;EACTC,SAAS,EAAE,IAAIC,IAAI,CAACF,MAAM,CAACC,SAAS,CAAC;EACrCE,OAAO,EAAE,IAAID,IAAI,CAACF,MAAM,CAACG,OAAO;AAClC,CAAC,CAAC;AAEF,eAAeJ,yBAAyB","ignoreList":[]}
@@ -1,7 +1,9 @@
1
1
  import deserializeCategorySample from './deserializeCategorySample';
2
- import { HKCategoryTypeIdentifier } from '../types';
3
2
  describe('deserializeCategorySample', () => {
4
- it('should deserialize category sample', () => {
3
+ it('should deserialize category sample', async () => {
4
+ const {
5
+ HKCategoryTypeIdentifier
6
+ } = await import('../native-types');
5
7
  const sample = {
6
8
  startDate: '2020-01-01T00:00:00.000Z',
7
9
  endDate: '2020-01-01T00:00:00.000Z',
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeCategorySample","HKCategoryTypeIdentifier","describe","it","sample","startDate","endDate","value","categoryType","sexualActivity","metadata","uuid","expect","toEqual","Date"],"sources":["deserializeCategorySample.test.ts"],"sourcesContent":["import deserializeCategorySample from './deserializeCategorySample'\nimport { HKCategorySampleRaw, HKCategoryTypeIdentifier } from '../types'\n\ndescribe('deserializeCategorySample', () => {\n it('should deserialize category sample', () => {\n const sample: HKCategorySampleRaw = {\n startDate: '2020-01-01T00:00:00.000Z',\n endDate: '2020-01-01T00:00:00.000Z',\n value: 1,\n categoryType: HKCategoryTypeIdentifier.sexualActivity,\n metadata: {},\n uuid: 'uuid',\n }\n\n expect(deserializeCategorySample(sample)).toEqual({\n ...sample,\n startDate: new Date('2020-01-01T00:00:00.000Z'),\n endDate: new Date('2020-01-01T00:00:00.000Z'),\n })\n })\n})\n"],"mappings":"AAAA,OAAOA,yBAAyB,MAAM,6BAA6B;AACnE,SAA8BC,wBAAwB,QAAQ,UAAU;AAExEC,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EAC1CC,EAAE,CAAC,oCAAoC,EAAE,MAAM;IAC7C,MAAMC,MAA2B,GAAG;MAClCC,SAAS,EAAE,0BAA0B;MACrCC,OAAO,EAAE,0BAA0B;MACnCC,KAAK,EAAE,CAAC;MACRC,YAAY,EAAEP,wBAAwB,CAACQ,cAAc;MACrDC,QAAQ,EAAE,CAAC,CAAC;MACZC,IAAI,EAAE;IACR,CAAC;IAEDC,MAAM,CAACZ,yBAAyB,CAACI,MAAM,CAAC,CAAC,CAACS,OAAO,CAAC;MAChD,GAAGT,MAAM;MACTC,SAAS,EAAE,IAAIS,IAAI,CAAC,0BAA0B,CAAC;MAC/CR,OAAO,EAAE,IAAIQ,IAAI,CAAC,0BAA0B;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["deserializeCategorySample","describe","it","HKCategoryTypeIdentifier","sample","startDate","endDate","value","categoryType","sexualActivity","metadata","uuid","expect","toEqual","Date"],"sources":["deserializeCategorySample.test.ts"],"sourcesContent":["import deserializeCategorySample from './deserializeCategorySample'\n\nimport type { HKCategorySampleRaw } from '../types'\n\ndescribe('deserializeCategorySample', () => {\n it('should deserialize category sample', async () => {\n const { HKCategoryTypeIdentifier } = await import('../native-types')\n\n const sample: HKCategorySampleRaw = {\n startDate: '2020-01-01T00:00:00.000Z',\n endDate: '2020-01-01T00:00:00.000Z',\n value: 1,\n categoryType: HKCategoryTypeIdentifier.sexualActivity,\n metadata: {},\n uuid: 'uuid',\n }\n\n expect(deserializeCategorySample(sample)).toEqual({\n ...sample,\n startDate: new Date('2020-01-01T00:00:00.000Z'),\n endDate: new Date('2020-01-01T00:00:00.000Z'),\n })\n })\n})\n"],"mappings":"AAAA,OAAOA,yBAAyB,MAAM,6BAA6B;AAInEC,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EAC1CC,EAAE,CAAC,oCAAoC,EAAE,YAAY;IACnD,MAAM;MAAEC;IAAyB,CAAC,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;IAEpE,MAAMC,MAA2B,GAAG;MAClCC,SAAS,EAAE,0BAA0B;MACrCC,OAAO,EAAE,0BAA0B;MACnCC,KAAK,EAAE,CAAC;MACRC,YAAY,EAAEL,wBAAwB,CAACM,cAAc;MACrDC,QAAQ,EAAE,CAAC,CAAC;MACZC,IAAI,EAAE;IACR,CAAC;IAEDC,MAAM,CAACZ,yBAAyB,CAACI,MAAM,CAAC,CAAC,CAACS,OAAO,CAAC;MAChD,GAAGT,MAAM;MACTC,SAAS,EAAE,IAAIS,IAAI,CAAC,0BAA0B,CAAC;MAC/CR,OAAO,EAAE,IAAIQ,IAAI,CAAC,0BAA0B;IAC9C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializCategorySample","deserializeQuantitySample","deserializeCorrelation","s","objects","map","o","quantity","undefined","endDate","Date","startDate"],"sources":["deserializeCorrelation.ts"],"sourcesContent":["import deserializCategorySample from './deserializeCategorySample'\nimport deserializeQuantitySample from './deserializeSample'\n\nimport type {\n HKCategorySampleRaw, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKQuantitySampleRaw, HKQuantityTypeIdentifier,\n} from '../native-types'\nimport type { HKCorrelation } from '../types'\n\nfunction deserializeCorrelation<\n TIdentifier extends HKCorrelationTypeIdentifier\n>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier> {\n return {\n ...s,\n objects: s.objects.map((o) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (o.quantity !== undefined) {\n return deserializeQuantitySample(o as HKQuantitySampleRaw<HKQuantityTypeIdentifier>)\n }\n\n return deserializCategorySample(o as HKCategorySampleRaw)\n }),\n endDate: new Date(s.endDate),\n startDate: new Date(s.startDate),\n }\n}\n\nexport default deserializeCorrelation\n"],"mappings":"AAAA,OAAOA,wBAAwB,MAAM,6BAA6B;AAClE,OAAOC,yBAAyB,MAAM,qBAAqB;AAO3D,SAASC,sBAAsBA,CAE7BC,CAAgC,EAA8B;EAC9D,OAAO;IACL,GAAGA,CAAC;IACJC,OAAO,EAAED,CAAC,CAACC,OAAO,CAACC,GAAG,CAAEC,CAAC,IAAK;MAC9B;MACA;MACE,IAAIA,CAAC,CAACC,QAAQ,KAAKC,SAAS,EAAE;QAC5B,OAAOP,yBAAyB,CAACK,CAAkD,CAAC;MACtF;MAEA,OAAON,wBAAwB,CAACM,CAAwB,CAAC;IAC3D,CAAC,CAAC;IACFG,OAAO,EAAE,IAAIC,IAAI,CAACP,CAAC,CAACM,OAAO,CAAC;IAC5BE,SAAS,EAAE,IAAID,IAAI,CAACP,CAAC,CAACQ,SAAS;EACjC,CAAC;AACH;AAEA,eAAeT,sBAAsB"}
1
+ {"version":3,"names":["deserializCategorySample","deserializeQuantitySample","deserializeCorrelation","s","objects","map","o","quantity","undefined","endDate","Date","startDate"],"sources":["deserializeCorrelation.ts"],"sourcesContent":["import deserializCategorySample from './deserializeCategorySample'\nimport deserializeQuantitySample from './deserializeSample'\n\nimport type {\n HKCategorySampleRaw, HKCorrelationRaw, HKCorrelationTypeIdentifier, HKQuantitySampleRaw, HKQuantityTypeIdentifier,\n} from '../native-types'\nimport type { HKCorrelation } from '../types'\n\nfunction deserializeCorrelation<\n TIdentifier extends HKCorrelationTypeIdentifier\n>(s: HKCorrelationRaw<TIdentifier>): HKCorrelation<TIdentifier> {\n return {\n ...s,\n objects: s.objects.map((o) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (o.quantity !== undefined) {\n return deserializeQuantitySample(o as HKQuantitySampleRaw<HKQuantityTypeIdentifier>)\n }\n\n return deserializCategorySample(o as HKCategorySampleRaw)\n }),\n endDate: new Date(s.endDate),\n startDate: new Date(s.startDate),\n }\n}\n\nexport default deserializeCorrelation\n"],"mappings":"AAAA,OAAOA,wBAAwB,MAAM,6BAA6B;AAClE,OAAOC,yBAAyB,MAAM,qBAAqB;AAO3D,SAASC,sBAAsBA,CAE7BC,CAAgC,EAA8B;EAC9D,OAAO;IACL,GAAGA,CAAC;IACJC,OAAO,EAAED,CAAC,CAACC,OAAO,CAACC,GAAG,CAAEC,CAAC,IAAK;MAC9B;MACA;MACE,IAAIA,CAAC,CAACC,QAAQ,KAAKC,SAAS,EAAE;QAC5B,OAAOP,yBAAyB,CAACK,CAAkD,CAAC;MACtF;MAEA,OAAON,wBAAwB,CAACM,CAAwB,CAAC;IAC3D,CAAC,CAAC;IACFG,OAAO,EAAE,IAAIC,IAAI,CAACP,CAAC,CAACM,OAAO,CAAC;IAC5BE,SAAS,EAAE,IAAID,IAAI,CAACP,CAAC,CAACQ,SAAS;EACjC,CAAC;AACH;AAEA,eAAeT,sBAAsB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeHeartbeatSeriesSample","sample","startDate","Date","endDate"],"sources":["deserializeHeartbeatSeriesSample.ts"],"sourcesContent":["import type { HKHeartbeatSeriesSampleRaw } from '../native-types'\nimport type { HKHeartbeatSeriesSample } from '../types'\n\nfunction deserializeHeartbeatSeriesSample(sample: HKHeartbeatSeriesSampleRaw): HKHeartbeatSeriesSample {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nexport default deserializeHeartbeatSeriesSample\n"],"mappings":"AAGA,SAASA,gCAAgCA,CAACC,MAAkC,EAA2B;EACrG,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;AAEA,eAAeJ,gCAAgC"}
1
+ {"version":3,"names":["deserializeHeartbeatSeriesSample","sample","startDate","Date","endDate"],"sources":["deserializeHeartbeatSeriesSample.ts"],"sourcesContent":["import type { HKHeartbeatSeriesSampleRaw } from '../native-types'\nimport type { HKHeartbeatSeriesSample } from '../types'\n\nfunction deserializeHeartbeatSeriesSample(sample: HKHeartbeatSeriesSampleRaw): HKHeartbeatSeriesSample {\n return {\n ...sample,\n startDate: new Date(sample.startDate),\n endDate: new Date(sample.endDate),\n }\n}\n\nexport default deserializeHeartbeatSeriesSample\n"],"mappings":"AAGA,SAASA,gCAAgCA,CAACC,MAAkC,EAA2B;EACrG,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;AAEA,eAAeJ,gCAAgC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeQuantitySample","sample","startDate","Date","endDate"],"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;AAEA,eAAeJ,yBAAyB"}
1
+ {"version":3,"names":["deserializeQuantitySample","sample","startDate","Date","endDate"],"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;AAEA,eAAeJ,yBAAyB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeWorkout","sample","startDate","Date","endDate"],"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;AAEA,eAAeJ,kBAAkB"}
1
+ {"version":3,"names":["deserializeWorkout","sample","startDate","Date","endDate"],"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;AAEA,eAAeJ,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ensureMetadata","metadata"],"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;AAEA,eAAeD,cAAc"}
1
+ {"version":3,"names":["ensureMetadata","metadata"],"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;AAEA,eAAeD,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ensureTotals","totals"],"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;AAEA,eAAeD,YAAY"}
1
+ {"version":3,"names":["ensureTotals","totals"],"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;AAEA,eAAeD,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","ensureUnit","type","providedUnit","unit","getPreferredUnits"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,MAAMC,UAAU,GAAG,MAAAA,CAIjBC,IAAiB,EACjBC,YAAoB,KACjB;EACH,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,MAAMC,IAAI,GAAG,MAAMJ,MAAM,CAACK,iBAAiB,CAAC,CAACH,IAAI,CAAC,CAAC;EACnD,OAAOE,IAAI,CAACF,IAAI,CAAC;AACnB,CAAC;AAED,eAAeD,UAAU"}
1
+ {"version":3,"names":["Native","ensureUnit","type","providedUnit","unit","getPreferredUnits"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,MAAMC,UAAU,GAAG,MAAAA,CAIjBC,IAAiB,EACjBC,YAAoB,KACjB;EACH,IAAIA,YAAY,EAAE;IAChB,OAAOA,YAAY;EACrB;EACA,MAAMC,IAAI,GAAG,MAAMJ,MAAM,CAACK,iBAAiB,CAAC,CAACH,IAAI,CAAC,CAAC;EACnD,OAAOE,IAAI,CAACF,IAAI,CAAC;AACnB,CAAC;AAED,eAAeD,UAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","getDateOfBirth","dateOfBirth","Date"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,MAAMC,cAAc,GAAG,MAAAA,CAAA,KAAY;EACjC,MAAMC,WAAW,GAAG,MAAMF,MAAM,CAACC,cAAc,CAAC,CAAC;EACjD,OAAO,IAAIE,IAAI,CAACD,WAAW,CAAC;AAC9B,CAAC;AAED,eAAeD,cAAc"}
1
+ {"version":3,"names":["Native","getDateOfBirth","dateOfBirth","Date"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,MAAMC,cAAc,GAAG,MAAAA,CAAA,KAAY;EACjC,MAAMC,WAAW,GAAG,MAAMF,MAAM,CAACC,cAAc,CAAC,CAAC;EACjD,OAAO,IAAIE,IAAI,CAACD,WAAW,CAAC;AAC9B,CAAC;AAED,eAAeD,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["queryCategorySamples","getMostRecentCategorySample","identifier","samples","limit","ascending"],"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,OAAOA,oBAAoB,MAAM,wBAAwB;AAKzD,eAAeC,2BAA2BA,CAGxCC,UAAa,EACwB;EACrC,MAAMC,OAAO,GAAG,MAAMH,oBAAoB,CAACE,UAAU,EAAE;IACrDE,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,OAAOF,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI;AAC3B;AAEA,eAAeF,2BAA2B"}
1
+ {"version":3,"names":["queryCategorySamples","getMostRecentCategorySample","identifier","samples","limit","ascending"],"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,OAAOA,oBAAoB,MAAM,wBAAwB;AAKzD,eAAeC,2BAA2BA,CAGxCC,UAAa,EACwB;EACrC,MAAMC,OAAO,GAAG,MAAMH,oBAAoB,CAACE,UAAU,EAAE;IACrDE,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,OAAOF,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI;AAC3B;AAEA,eAAeF,2BAA2B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["queryQuantitySamples","getMostRecentQuantitySample","identifier","unit","samples","limit","lastSample"],"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,OAAOA,oBAAoB,MAAM,wBAAwB;AAKzD,eAAeC,2BAA2BA,CAIxCC,UAAuB,EACvBC,IAAW,EAC2C;EACtD,MAAMC,OAAO,GAAG,MAAMJ,oBAAoB,CAACE,UAAU,EAAE;IACrDG,KAAK,EAAE,CAAC;IACRF;EACF,CAAC,CAAC;EAEF,MAAMG,UAAU,GAAGF,OAAO,CAAC,CAAC,CAAC;EAE7B,IAAIE,UAAU,EAAE;IACd,OAAOA,UAAU;EACnB;EACA,OAAO,IAAI;AACb;AAEA,eAAeL,2BAA2B"}
1
+ {"version":3,"names":["queryQuantitySamples","getMostRecentQuantitySample","identifier","unit","samples","limit","lastSample"],"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,OAAOA,oBAAoB,MAAM,wBAAwB;AAKzD,eAAeC,2BAA2BA,CAIxCC,UAAuB,EACvBC,IAAW,EAC2C;EACtD,MAAMC,OAAO,GAAG,MAAMJ,oBAAoB,CAACE,UAAU,EAAE;IACrDG,KAAK,EAAE,CAAC;IACRF;EACF,CAAC,CAAC;EAEF,MAAMG,UAAU,GAAGF,OAAO,CAAC,CAAC,CAAC;EAE7B,IAAIE,UAAU,EAAE;IACd,OAAOA,UAAU;EACnB;EACA,OAAO,IAAI;AACb;AAEA,eAAeL,2BAA2B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["queryWorkouts","getMostRecentWorkout","options","workouts","limit","ascending","energyUnit","distanceUnit"],"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,OAAOA,aAAa,MAAM,iBAAiB;AAe3C,MAAMC,oBAA4C,GAAG,MAAOC,OAAO,IAAK;EACtE,MAAMC,QAAQ,GAAG,MAAMH,aAAa,CAAC;IACnCI,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE,KAAK;IAChBC,UAAU,EAAEJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,UAAU;IAC/BC,YAAY,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK;EACzB,CAAC,CAAC;EAEF,OAAOJ,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI;AAC5B,CAAC;AAED,eAAeF,oBAAoB"}
1
+ {"version":3,"names":["queryWorkouts","getMostRecentWorkout","options","workouts","limit","ascending","energyUnit","distanceUnit"],"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,OAAOA,aAAa,MAAM,iBAAiB;AAe3C,MAAMC,oBAA4C,GAAG,MAAOC,OAAO,IAAK;EACtE,MAAMC,QAAQ,GAAG,MAAMH,aAAa,CAAC;IACnCI,KAAK,EAAE,CAAC;IACRC,SAAS,EAAE,KAAK;IAChBC,UAAU,EAAEJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,UAAU;IAC/BC,YAAY,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK;EACzB,CAAC,CAAC;EAEF,OAAOJ,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI;AAC5B,CAAC;AAED,eAAeF,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getPreferredUnits","getPreferredUnit","type","unit"],"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,OAAOA,iBAAiB,MAAM,qBAAqB;AAQnD,MAAMC,gBAAoC,GAAG,MAAOC,IAAI,IAAK;EAC3D,MAAM,CAACC,IAAI,CAAC,GAAG,MAAMH,iBAAiB,CAAC,CAACE,IAAI,CAAC,CAAC;EAC9C,OAAOC,IAAI;AACb,CAAC;AAED,eAAeF,gBAAgB"}
1
+ {"version":3,"names":["getPreferredUnits","getPreferredUnit","type","unit"],"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,OAAOA,iBAAiB,MAAM,qBAAqB;AAQnD,MAAMC,gBAAoC,GAAG,MAAOC,IAAI,IAAK;EAC3D,MAAM,CAACC,IAAI,CAAC,GAAG,MAAMH,iBAAiB,CAAC,CAACE,IAAI,CAAC,CAAC;EAC9C,OAAOC,IAAI;AACb,CAAC;AAED,eAAeF,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","getPreferredUnits","identifiers","units","map","i"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAQpC,MAAMC,iBAAsC,GAAG,MAAOC,WAAW,IAAK;EACpE,MAAMC,KAAK,GAAG,MAAMH,MAAM,CAACC,iBAAiB,CAACC,WAAW,CAAC;EACzD,OAAOA,WAAW,CAACE,GAAG,CAAEC,CAAC,IAAKF,KAAK,CAACE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,eAAeJ,iBAAiB"}
1
+ {"version":3,"names":["Native","getPreferredUnits","identifiers","units","map","i"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAQpC,MAAMC,iBAAsC,GAAG,MAAOC,WAAW,IAAK;EACpE,MAAMC,KAAK,GAAG,MAAMH,MAAM,CAACC,iBAAiB,CAACC,WAAW,CAAC;EACzD,OAAOA,WAAW,CAACE,GAAG,CAAEC,CAAC,IAAKF,KAAK,CAACE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,eAAeJ,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","HKQuantityTypeIdentifier","UnitOfEnergy","UnitOfLength","getPreferredUnitsTyped","options","energyUnit","distanceUnit","units","getPreferredUnits","distanceWalkingRunning","activeEnergyBurned","Kilocalories","Meter"],"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,OAAOA,MAAM,IAAIC,wBAAwB,EAAEC,YAAY,EAAEC,YAAY,QAAQ,iBAAiB;AAI9F,eAAeC,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,MAAMR,MAAM,CAACS,iBAAiB,CAAC,CAC3CR,wBAAwB,CAACS,sBAAsB,EAC/CT,wBAAwB,CAACU,kBAAkB,CAC5C,CAAC;IACF,IAAI,CAACL,UAAU,EAAE;MACfA,UAAU,GAAGE,KAAK,CAACP,wBAAwB,CAACU,kBAAkB,CAEnD;IACb;IACA,IAAI,CAACJ,YAAY,EAAE;MACjBA,YAAY,GAAGC,KAAK,CAACP,wBAAwB,CAACS,sBAAsB,CAEzD;IACb;EACF;EAEA,IAAI,CAACJ,UAAU,EAAE;IACfA,UAAU,GAAGJ,YAAY,CAACU,YAAuB;EACnD;EACA,IAAI,CAACL,YAAY,EAAE;IACjBA,YAAY,GAAGJ,YAAY,CAACU,KAAkB;EAChD;EACA,OAAO;IAAEP,UAAU;IAAEC;EAAa,CAAC;AACrC;AAEA,eAAeH,sBAAsB"}
1
+ {"version":3,"names":["Native","HKQuantityTypeIdentifier","UnitOfEnergy","UnitOfLength","getPreferredUnitsTyped","options","energyUnit","distanceUnit","units","getPreferredUnits","distanceWalkingRunning","activeEnergyBurned","Kilocalories","Meter"],"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,OAAOA,MAAM,IAAIC,wBAAwB,EAAEC,YAAY,EAAEC,YAAY,QAAQ,iBAAiB;AAI9F,eAAeC,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,MAAMR,MAAM,CAACS,iBAAiB,CAAC,CAC3CR,wBAAwB,CAACS,sBAAsB,EAC/CT,wBAAwB,CAACU,kBAAkB,CAC5C,CAAC;IACF,IAAI,CAACL,UAAU,EAAE;MACfA,UAAU,GAAGE,KAAK,CAACP,wBAAwB,CAACU,kBAAkB,CAEnD;IACb;IACA,IAAI,CAACJ,YAAY,EAAE;MACjBA,YAAY,GAAGC,KAAK,CAACP,wBAAwB,CAACS,sBAAsB,CAEzD;IACb;EACF;EAEA,IAAI,CAACJ,UAAU,EAAE;IACfA,UAAU,GAAGJ,YAAY,CAACU,YAAuB;EACnD;EACA,IAAI,CAACL,YAAY,EAAE;IACjBA,YAAY,GAAGJ,YAAY,CAACU,KAAkB;EAChD;EACA,OAAO;IAAEP,UAAU;IAAEC;EAAa,CAAC;AACrC;AAEA,eAAeH,sBAAsB","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  import Native from '../native-types';
2
- const getRequestStatusForAuthorization = async function (read) {
3
- let write = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
2
+ const getRequestStatusForAuthorization = async (read, write = []) => {
4
3
  const readPermissions = read.reduce((obj, cur) => ({
5
4
  ...obj,
6
5
  [cur]: true
@@ -1 +1 @@
1
- {"version":3,"names":["Native","getRequestStatusForAuthorization","read","write","arguments","length","undefined","readPermissions","reduce","obj","cur","writePermissions"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAMpC,MAAMC,gCAAgC,GAAG,eAAAA,CACvCC,IAA2C,EAExC;EAAA,IADHC,KAA6C,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAElD,MAAMG,eAAe,GAAGL,IAAI,CAACM,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAoB,CAAC;EAEnG,MAAMC,gBAAgB,GAAGR,KAAK,CAACK,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAqB,CAAC;EAEtG,OAAOV,MAAM,CAACC,gCAAgC,CAC5CU,gBAAgB,EAChBJ,eACF,CAAC;AACH,CAAC;AAED,eAAeN,gCAAgC"}
1
+ {"version":3,"names":["Native","getRequestStatusForAuthorization","read","write","readPermissions","reduce","obj","cur","writePermissions"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAMpC,MAAMC,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,OAAOP,MAAM,CAACC,gCAAgC,CAC5CO,gBAAgB,EAChBJ,eACF,CAAC;AACH,CAAC;AAED,eAAeH,gCAAgC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","getWorkoutPlanById","workoutUUID"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,eAAeC,kBAAkBA,CAACC,WAAmB,EAAE;EACrD,OAAOF,MAAM,CAACC,kBAAkB,CAACC,WAAW,CAAC;AAC/C;AAEA,eAAeD,kBAAkB"}
1
+ {"version":3,"names":["Native","getWorkoutPlanById","workoutUUID"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,eAAeC,kBAAkBA,CAACC,WAAmB,EAAE;EACrD,OAAOF,MAAM,CAACC,kBAAkB,CAACC,WAAW,CAAC;AAC/C;AAEA,eAAeD,kBAAkB","ignoreList":[]}
@@ -2,6 +2,7 @@ import serializeDate from './serializeDate';
2
2
  const prepareOptions = options => {
3
3
  const limit = !options.limit || options.limit === Infinity ? 0 : options.limit;
4
4
  const ascending = options.ascending ?? limit === 0;
5
+ // eslint-disable-next-line no-nested-ternary
5
6
  const from = serializeDate(options.from ? options.from : limit > 0 ? new Date(0) : undefined);
6
7
  const to = serializeDate(options.to);
7
8
  const anchor = options.anchor ?? '';
@@ -1 +1 @@
1
- {"version":3,"names":["serializeDate","prepareOptions","options","limit","Infinity","ascending","from","Date","undefined","to","anchor"],"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 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,OAAOA,aAAa,MAAM,iBAAiB;AAI3C,MAAMC,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,MAAMG,IAAI,GAAGN,aAAa,CAACE,OAAO,CAACI,IAAI,GAAGJ,OAAO,CAACI,IAAI,GAAIH,KAAK,GAAG,CAAC,GAAG,IAAII,IAAI,CAAC,CAAC,CAAC,GAAGC,SAAU,CAAC;EAC/F,MAAMC,EAAE,GAAGT,aAAa,CAACE,OAAO,CAACO,EAAE,CAAC;EACpC,MAAMC,MAAM,GAAGR,OAAO,CAACQ,MAAM,IAAI,EAAE;EACnC,OAAO;IACLP,KAAK;IAAEE,SAAS;IAAEC,IAAI;IAAEG,EAAE;IAAEC;EAC9B,CAAC;AACH,CAAC;AAED,eAAeT,cAAc"}
1
+ {"version":3,"names":["serializeDate","prepareOptions","options","limit","Infinity","ascending","from","Date","undefined","to","anchor"],"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,OAAOA,aAAa,MAAM,iBAAiB;AAI3C,MAAMC,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,GAAGN,aAAa,CAACE,OAAO,CAACI,IAAI,GAAGJ,OAAO,CAACI,IAAI,GAAIH,KAAK,GAAG,CAAC,GAAG,IAAII,IAAI,CAAC,CAAC,CAAC,GAAGC,SAAU,CAAC;EAC/F,MAAMC,EAAE,GAAGT,aAAa,CAACE,OAAO,CAACO,EAAE,CAAC;EACpC,MAAMC,MAAM,GAAGR,OAAO,CAACQ,MAAM,IAAI,EAAE;EACnC,OAAO;IACLP,KAAK;IAAEE,SAAS;IAAEC,IAAI;IAAEG,EAAE;IAAEC;EAC9B,CAAC;AACH,CAAC;AAED,eAAeT,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeCategorySample","prepareOptions","Native","queryCategorySamples","identifier","options","opts","raw","from","to","limit","ascending","map"],"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,OAAOA,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAUpC,MAAMC,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,GAAG,GAAG,MAAML,MAAM,CAACC,oBAAoB,CAC3CC,UAAU,EACVE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,GAAG,CAACK,GAAG,CAACZ,yBAAyB,CAAC;AAC3C,CAAC;AAED,eAAeG,oBAAoB"}
1
+ {"version":3,"names":["deserializeCategorySample","prepareOptions","Native","queryCategorySamples","identifier","options","opts","raw","from","to","limit","ascending","map"],"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,OAAOA,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAUpC,MAAMC,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,GAAG,GAAG,MAAML,MAAM,CAACC,oBAAoB,CAC3CC,UAAU,EACVE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,GAAG,CAACK,GAAG,CAACZ,yBAAyB,CAAC;AAC3C,CAAC;AAED,eAAeG,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializCategorySample","prepareOptions","Native","queryCategorySamplesWithAnchor","identifier","options","opts","raw","from","to","limit","anchor","samples","map","deletedSamples","newAnchor"],"sources":["queryCategorySamplesWithAnchor.ts"],"sourcesContent":["import deserializCategorySample 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(deserializCategorySample),\n deletedSamples: raw.deletedSamples,\n newAnchor: raw.newAnchor,\n }\n}\n\nexport default queryCategorySamplesWithAnchor\n"],"mappings":"AAAA,OAAOA,wBAAwB,MAAM,6BAA6B;AAClE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAgBpC,MAAMC,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,GAAG,GAAG,MAAML,MAAM,CAACC,8BAA8B,CACrDC,UAAU,EACVE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,OAAO,EAAEL,GAAG,CAACK,OAAO,CAACC,GAAG,CAACb,wBAAwB,CAAC;IAClDc,cAAc,EAAEP,GAAG,CAACO,cAAc;IAClCC,SAAS,EAAER,GAAG,CAACQ;EACjB,CAAC;AACH,CAAC;AAED,eAAeZ,8BAA8B"}
1
+ {"version":3,"names":["deserializCategorySample","prepareOptions","Native","queryCategorySamplesWithAnchor","identifier","options","opts","raw","from","to","limit","anchor","samples","map","deletedSamples","newAnchor"],"sources":["queryCategorySamplesWithAnchor.ts"],"sourcesContent":["import deserializCategorySample 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(deserializCategorySample),\n deletedSamples: raw.deletedSamples,\n newAnchor: raw.newAnchor,\n }\n}\n\nexport default queryCategorySamplesWithAnchor\n"],"mappings":"AAAA,OAAOA,wBAAwB,MAAM,6BAA6B;AAClE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAgBpC,MAAMC,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,GAAG,GAAG,MAAML,MAAM,CAACC,8BAA8B,CACrDC,UAAU,EACVE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,OAAO,EAAEL,GAAG,CAACK,OAAO,CAACC,GAAG,CAACb,wBAAwB,CAAC;IAClDc,cAAc,EAAEP,GAAG,CAACO,cAAc;IAClCC,SAAS,EAAER,GAAG,CAACQ;EACjB,CAAC;AACH,CAAC;AAED,eAAeZ,8BAA8B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeCorrelation","prepareOptions","Native","queryCorrelationSamples","typeIdentifier","options","opts","correlations","from","to","map"],"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,OAAOA,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAYpC,MAAMC,uBAAkD,GAAG,MAAAA,CACzDC,cAAc,EACdC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,YAAY,GAAG,MAAML,MAAM,CAACC,uBAAuB,CACvDC,cAAc,EACdE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EACP,CAAC;EAED,OAAOF,YAAY,CAACG,GAAG,CAACV,sBAAsB,CAAC;AACjD,CAAC;AAED,eAAeG,uBAAuB"}
1
+ {"version":3,"names":["deserializeCorrelation","prepareOptions","Native","queryCorrelationSamples","typeIdentifier","options","opts","correlations","from","to","map"],"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,OAAOA,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAYpC,MAAMC,uBAAkD,GAAG,MAAAA,CACzDC,cAAc,EACdC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAGL,cAAc,CAACI,OAAO,CAAC;EACpC,MAAME,YAAY,GAAG,MAAML,MAAM,CAACC,uBAAuB,CACvDC,cAAc,EACdE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EACP,CAAC;EAED,OAAOF,YAAY,CAACG,GAAG,CAACV,sBAAsB,CAAC;AACjD,CAAC;AAED,eAAeG,uBAAuB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeHeartbeatSeriesSample","prepareOptions","Native","queryHeartbeatSeriesSamples","options","opts","result","from","to","limit","ascending","map"],"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,OAAOA,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAapC,MAAMC,2BAA0D,GAAG,MAAOC,OAAO,IAAK;EACpF,MAAMC,IAAI,GAAGJ,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAME,MAAM,GAAG,MAAMJ,MAAM,CAACC,2BAA2B,CACrDE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,MAAM,CAACK,GAAG,CAACX,gCAAgC,CAAC;AACrD,CAAC;AAED,eAAeG,2BAA2B"}
1
+ {"version":3,"names":["deserializeHeartbeatSeriesSample","prepareOptions","Native","queryHeartbeatSeriesSamples","options","opts","result","from","to","limit","ascending","map"],"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,OAAOA,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAapC,MAAMC,2BAA0D,GAAG,MAAOC,OAAO,IAAK;EACpF,MAAMC,IAAI,GAAGJ,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAME,MAAM,GAAG,MAAMJ,MAAM,CAACC,2BAA2B,CACrDE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,MAAM,CAACK,GAAG,CAACX,gCAAgC,CAAC;AACrD,CAAC;AAED,eAAeG,2BAA2B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeHeartbeatSeriesSample","prepareOptions","Native","queryHeartbeatSeriesSamplesWithAnchor","options","opts","result","from","to","limit","anchor","deletedSamples","newAnchor","samples","map"],"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,OAAOA,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAapC,MAAMC,qCAAoE,GAAG,MAAOC,OAAO,IAAK;EAC9F,MAAMC,IAAI,GAAGJ,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAME,MAAM,GAAG,MAAMJ,MAAM,CAACC,qCAAqC,CAC/DE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEL,MAAM,CAACK,cAAc;IACrCC,SAAS,EAAEN,MAAM,CAACM,SAAS;IAC3BC,OAAO,EAAEP,MAAM,CAACO,OAAO,CAACC,GAAG,CAACd,gCAAgC;EAC9D,CAAC;AACH,CAAC;AAED,eAAeG,qCAAqC"}
1
+ {"version":3,"names":["deserializeHeartbeatSeriesSample","prepareOptions","Native","queryHeartbeatSeriesSamplesWithAnchor","options","opts","result","from","to","limit","anchor","deletedSamples","newAnchor","samples","map"],"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,OAAOA,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAapC,MAAMC,qCAAoE,GAAG,MAAOC,OAAO,IAAK;EAC9F,MAAMC,IAAI,GAAGJ,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAME,MAAM,GAAG,MAAMJ,MAAM,CAACC,qCAAqC,CAC/DE,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEL,MAAM,CAACK,cAAc;IACrCC,SAAS,EAAEN,MAAM,CAACM,SAAS;IAC3BC,OAAO,EAAEP,MAAM,CAACO,OAAO,CAACC,GAAG,CAACd,gCAAgC;EAC9D,CAAC;AACH,CAAC;AAED,eAAeG,qCAAqC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeQuantitySample","ensureUnit","prepareOptions","Native","queryQuantitySamples","identifier","options","unit","opts","result","from","to","limit","ascending","map"],"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,OAAOA,yBAAyB,MAAM,qBAAqB;AAC3D,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAepC,MAAMC,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAMN,UAAU,CAACI,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAMC,IAAI,GAAGN,cAAc,CAACI,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMN,MAAM,CAACC,oBAAoB,CAC9CC,UAAU,EACVE,IAAI,EACJC,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,MAAM,CAACK,GAAG,CAACd,yBAAyB,CAAC;AAC9C,CAAC;AAED,eAAeI,oBAAoB"}
1
+ {"version":3,"names":["deserializeQuantitySample","ensureUnit","prepareOptions","Native","queryQuantitySamples","identifier","options","unit","opts","result","from","to","limit","ascending","map"],"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,OAAOA,yBAAyB,MAAM,qBAAqB;AAC3D,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAepC,MAAMC,oBAA4C,GAAG,MAAAA,CACnDC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAMN,UAAU,CAACI,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAMC,IAAI,GAAGN,cAAc,CAACI,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMN,MAAM,CAACC,oBAAoB,CAC9CC,UAAU,EACVE,IAAI,EACJC,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,SACP,CAAC;EAED,OAAOJ,MAAM,CAACK,GAAG,CAACd,yBAAyB,CAAC;AAC9C,CAAC;AAED,eAAeI,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeQuantitySample","ensureUnit","prepareOptions","Native","queryQuantitySamplesWithAnchor","identifier","options","unit","opts","result","from","to","limit","anchor","deletedSamples","newAnchor","samples","map"],"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,OAAOA,yBAAyB,MAAM,qBAAqB;AAC3D,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAmBpC,MAAMC,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAMN,UAAU,CAACI,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAMC,IAAI,GAAGN,cAAc,CAACI,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMN,MAAM,CAACC,8BAA8B,CACxDC,UAAU,EACVE,IAAI,EACJC,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEL,MAAM,CAACK,cAAc;IACrCC,SAAS,EAAEN,MAAM,CAACM,SAAS;IAC3BC,OAAO,EAAEP,MAAM,CAACO,OAAO,CAACC,GAAG,CAACjB,yBAAyB;EACvD,CAAC;AACH,CAAC;AAED,eAAeI,8BAA8B"}
1
+ {"version":3,"names":["deserializeQuantitySample","ensureUnit","prepareOptions","Native","queryQuantitySamplesWithAnchor","identifier","options","unit","opts","result","from","to","limit","anchor","deletedSamples","newAnchor","samples","map"],"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,OAAOA,yBAAyB,MAAM,qBAAqB;AAC3D,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAmBpC,MAAMC,8BAAgE,GAAG,MAAAA,CACvEC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,IAAI,GAAG,MAAMN,UAAU,CAACI,UAAU,EAAEC,OAAO,CAACC,IAAI,CAAC;EACvD,MAAMC,IAAI,GAAGN,cAAc,CAACI,OAAO,CAAC;EAEpC,MAAMG,MAAM,GAAG,MAAMN,MAAM,CAACC,8BAA8B,CACxDC,UAAU,EACVE,IAAI,EACJC,IAAI,CAACE,IAAI,EACTF,IAAI,CAACG,EAAE,EACPH,IAAI,CAACI,KAAK,EACVJ,IAAI,CAACK,MACP,CAAC;EAED,OAAO;IACLC,cAAc,EAAEL,MAAM,CAACK,cAAc;IACrCC,SAAS,EAAEN,MAAM,CAACM,SAAS;IAC3BC,OAAO,EAAEP,MAAM,CAACO,OAAO,CAACC,GAAG,CAACjB,yBAAyB;EACvD,CAAC;AACH,CAAC;AAED,eAAeI,8BAA8B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","querySources","identifier","quantitySamples"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAcpC,MAAMC,YAA4B,GAAG,MAAOC,UAAU,IAAK;EACzD,MAAMC,eAAe,GAAG,MAAMH,MAAM,CAACC,YAAY,CAACC,UAAU,CAAC;EAE7D,OAAOC,eAAe;AACxB,CAAC;AAED,eAAeF,YAAY"}
1
+ {"version":3,"names":["Native","querySources","identifier","quantitySamples"],"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,OAAOA,MAAM,MAAM,iBAAiB;AAcpC,MAAMC,YAA4B,GAAG,MAAOC,UAAU,IAAK;EACzD,MAAMC,eAAe,GAAG,MAAMH,MAAM,CAACC,YAAY,CAACC,UAAU,CAAC;EAE7D,OAAOC,eAAe;AACxB,CAAC;AAED,eAAeF,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ensureUnit","Native","queryStatisticsForQuantity","identifier","options","from","to","unit","actualUnit","toDate","Date","mostRecentQuantityDateInterval","rawResponse","toISOString","response"],"sources":["queryStatisticsForQuantity.ts"],"sourcesContent":["import ensureUnit from './ensureUnit'\nimport Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier, HKStatisticsOptions, UnitForIdentifier } from '../native-types'\n\nasync function queryStatisticsForQuantity<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>(\n identifier: TIdentifier,\n options: readonly HKStatisticsOptions[],\n from: Date,\n to?: Date,\n unit?: TUnit,\n) {\n const actualUnit = await ensureUnit(identifier, unit)\n const toDate = to || new Date()\n const { mostRecentQuantityDateInterval, ...rawResponse } = await Native.queryStatisticsForQuantity(\n identifier,\n actualUnit,\n from.toISOString(),\n toDate.toISOString(),\n options,\n )\n\n const response = {\n ...rawResponse,\n ...(mostRecentQuantityDateInterval\n ? {\n mostRecentQuantityDateInterval: {\n from: new Date(mostRecentQuantityDateInterval.from),\n to: new Date(mostRecentQuantityDateInterval.to),\n },\n }\n : {}),\n }\n\n return response\n}\n\nexport default queryStatisticsForQuantity\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;AACrC,OAAOC,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,0BAA0BA,CACvCC,UAAuB,EACvBC,OAAuC,EACvCC,IAAU,EACVC,EAAS,EACTC,IAAY,EACZ;EACA,MAAMC,UAAU,GAAG,MAAMR,UAAU,CAACG,UAAU,EAAEI,IAAI,CAAC;EACrD,MAAME,MAAM,GAAGH,EAAE,IAAI,IAAII,IAAI,CAAC,CAAC;EAC/B,MAAM;IAAEC,8BAA8B;IAAE,GAAGC;EAAY,CAAC,GAAG,MAAMX,MAAM,CAACC,0BAA0B,CAChGC,UAAU,EACVK,UAAU,EACVH,IAAI,CAACQ,WAAW,CAAC,CAAC,EAClBJ,MAAM,CAACI,WAAW,CAAC,CAAC,EACpBT,OACF,CAAC;EAED,MAAMU,QAAQ,GAAG;IACf,GAAGF,WAAW;IACd,IAAID,8BAA8B,GAC9B;MACAA,8BAA8B,EAAE;QAC9BN,IAAI,EAAE,IAAIK,IAAI,CAACC,8BAA8B,CAACN,IAAI,CAAC;QACnDC,EAAE,EAAE,IAAII,IAAI,CAACC,8BAA8B,CAACL,EAAE;MAChD;IACF,CAAC,GACC,CAAC,CAAC;EACR,CAAC;EAED,OAAOQ,QAAQ;AACjB;AAEA,eAAeZ,0BAA0B"}
1
+ {"version":3,"names":["ensureUnit","Native","queryStatisticsForQuantity","identifier","options","from","to","unit","actualUnit","toDate","Date","mostRecentQuantityDateInterval","rawResponse","toISOString","response"],"sources":["queryStatisticsForQuantity.ts"],"sourcesContent":["import ensureUnit from './ensureUnit'\nimport Native from '../native-types'\n\nimport type { HKQuantityTypeIdentifier, HKStatisticsOptions, UnitForIdentifier } from '../native-types'\n\nasync function queryStatisticsForQuantity<TIdentifier extends HKQuantityTypeIdentifier, TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>>(\n identifier: TIdentifier,\n options: readonly HKStatisticsOptions[],\n from: Date,\n to?: Date,\n unit?: TUnit,\n) {\n const actualUnit = await ensureUnit(identifier, unit)\n const toDate = to || new Date()\n const { mostRecentQuantityDateInterval, ...rawResponse } = await Native.queryStatisticsForQuantity(\n identifier,\n actualUnit,\n from.toISOString(),\n toDate.toISOString(),\n options,\n )\n\n const response = {\n ...rawResponse,\n ...(mostRecentQuantityDateInterval\n ? {\n mostRecentQuantityDateInterval: {\n from: new Date(mostRecentQuantityDateInterval.from),\n to: new Date(mostRecentQuantityDateInterval.to),\n },\n }\n : {}),\n }\n\n return response\n}\n\nexport default queryStatisticsForQuantity\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;AACrC,OAAOC,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,0BAA0BA,CACvCC,UAAuB,EACvBC,OAAuC,EACvCC,IAAU,EACVC,EAAS,EACTC,IAAY,EACZ;EACA,MAAMC,UAAU,GAAG,MAAMR,UAAU,CAACG,UAAU,EAAEI,IAAI,CAAC;EACrD,MAAME,MAAM,GAAGH,EAAE,IAAI,IAAII,IAAI,CAAC,CAAC;EAC/B,MAAM;IAAEC,8BAA8B;IAAE,GAAGC;EAAY,CAAC,GAAG,MAAMX,MAAM,CAACC,0BAA0B,CAChGC,UAAU,EACVK,UAAU,EACVH,IAAI,CAACQ,WAAW,CAAC,CAAC,EAClBJ,MAAM,CAACI,WAAW,CAAC,CAAC,EACpBT,OACF,CAAC;EAED,MAAMU,QAAQ,GAAG;IACf,GAAGF,WAAW;IACd,IAAID,8BAA8B,GAC9B;MACAA,8BAA8B,EAAE;QAC9BN,IAAI,EAAE,IAAIK,IAAI,CAACC,8BAA8B,CAACN,IAAI,CAAC;QACnDC,EAAE,EAAE,IAAII,IAAI,CAACC,8BAA8B,CAACL,EAAE;MAChD;IACF,CAAC,GACC,CAAC,CAAC;EACR,CAAC;EAED,OAAOQ,QAAQ;AACjB;AAEA,eAAeZ,0BAA0B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["deserializeWorkout","getPreferredUnitsTyped","prepareOptions","Native","queryWorkouts","options","energyUnit","distanceUnit","opts","workouts","queryWorkoutSamples","from","to","limit","ascending","map"],"sources":["queryWorkouts.ts"],"sourcesContent":["import deserializeWorkout from './deserializeWorkout'\nimport getPreferredUnitsTyped from './getPreferredUnitsTyped'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { EnergyUnit, LengthUnit } from '../native-types'\nimport type { QueryWorkoutsOptions } from '../types'\n\nasync function queryWorkouts<\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(options: QueryWorkoutsOptions<TEnergy, TDistance>) {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(options)\n const opts = prepareOptions(options)\n\n const workouts = await Native.queryWorkoutSamples(\n energyUnit,\n distanceUnit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return workouts.map(deserializeWorkout)\n}\n\nexport default queryWorkouts\n"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,aAAaA,CAG1BC,OAAiD,EAAE;EACnD,MAAM;IAAEC,UAAU;IAAEC;EAAa,CAAC,GAAG,MAAMN,sBAAsB,CAACI,OAAO,CAAC;EAC1E,MAAMG,IAAI,GAAGN,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAMI,QAAQ,GAAG,MAAMN,MAAM,CAACO,mBAAmB,CAC/CJ,UAAU,EACVC,YAAY,EACZC,IAAI,CAACG,IAAI,EACTH,IAAI,CAACI,EAAE,EACPJ,IAAI,CAACK,KAAK,EACVL,IAAI,CAACM,SACP,CAAC;EAED,OAAOL,QAAQ,CAACM,GAAG,CAACf,kBAAkB,CAAC;AACzC;AAEA,eAAeI,aAAa"}
1
+ {"version":3,"names":["deserializeWorkout","getPreferredUnitsTyped","prepareOptions","Native","queryWorkouts","options","energyUnit","distanceUnit","opts","workouts","queryWorkoutSamples","from","to","limit","ascending","map"],"sources":["queryWorkouts.ts"],"sourcesContent":["import deserializeWorkout from './deserializeWorkout'\nimport getPreferredUnitsTyped from './getPreferredUnitsTyped'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { EnergyUnit, LengthUnit } from '../native-types'\nimport type { QueryWorkoutsOptions } from '../types'\n\nasync function queryWorkouts<\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(options: QueryWorkoutsOptions<TEnergy, TDistance>) {\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(options)\n const opts = prepareOptions(options)\n\n const workouts = await Native.queryWorkoutSamples(\n energyUnit,\n distanceUnit,\n opts.from,\n opts.to,\n opts.limit,\n opts.ascending,\n )\n\n return workouts.map(deserializeWorkout)\n}\n\nexport default queryWorkouts\n"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,aAAaA,CAG1BC,OAAiD,EAAE;EACnD,MAAM;IAAEC,UAAU;IAAEC;EAAa,CAAC,GAAG,MAAMN,sBAAsB,CAACI,OAAO,CAAC;EAC1E,MAAMG,IAAI,GAAGN,cAAc,CAACG,OAAO,CAAC;EAEpC,MAAMI,QAAQ,GAAG,MAAMN,MAAM,CAACO,mBAAmB,CAC/CJ,UAAU,EACVC,YAAY,EACZC,IAAI,CAACG,IAAI,EACTH,IAAI,CAACI,EAAE,EACPJ,IAAI,CAACK,KAAK,EACVL,IAAI,CAACM,SACP,CAAC;EAED,OAAOL,QAAQ,CAACM,GAAG,CAACf,kBAAkB,CAAC;AACzC;AAEA,eAAeI,aAAa","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  import Native from '../native-types';
2
2
  /** See https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization */
3
- const requestAuthorization = async function (read) {
4
- let write = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3
+ const requestAuthorization = async (read, write = []) => {
5
4
  const readPermissions = read.reduce((obj, cur) => ({
6
5
  ...obj,
7
6
  [cur]: true
@@ -1 +1 @@
1
- {"version":3,"names":["Native","requestAuthorization","read","write","arguments","length","undefined","readPermissions","reduce","obj","cur","writePermissions"],"sources":["requestAuthorization.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type {\n HealthkitReadAuthorization, HealthkitWriteAuthorization, ReadPermissions, WritePermissions,\n} from '../native-types'\n\n/** See https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization */\nconst requestAuthorization = async (\n read: readonly HealthkitReadAuthorization[],\n write: readonly HealthkitWriteAuthorization[] = [],\n): Promise<boolean> => {\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.requestAuthorization(writePermissions, readPermissions)\n}\n\nexport default requestAuthorization\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAMpC;AACA,MAAMC,oBAAoB,GAAG,eAAAA,CAC3BC,IAA2C,EAEtB;EAAA,IADrBC,KAA6C,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAElD,MAAMG,eAAe,GAAGL,IAAI,CAACM,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAoB,CAAC;EAEnG,MAAMC,gBAAgB,GAAGR,KAAK,CAACK,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,GAAG,GAAG;EAAK,CAAC,CAAC,EAAE,CAAC,CAAqB,CAAC;EAEtG,OAAOV,MAAM,CAACC,oBAAoB,CAACU,gBAAgB,EAAEJ,eAAe,CAAC;AACvE,CAAC;AAED,eAAeN,oBAAoB"}
1
+ {"version":3,"names":["Native","requestAuthorization","read","write","readPermissions","reduce","obj","cur","writePermissions"],"sources":["requestAuthorization.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type {\n HealthkitReadAuthorization, HealthkitWriteAuthorization, ReadPermissions, WritePermissions,\n} from '../native-types'\n\n/** See https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization */\nconst requestAuthorization = async (\n read: readonly HealthkitReadAuthorization[],\n write: readonly HealthkitWriteAuthorization[] = [],\n): Promise<boolean> => {\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.requestAuthorization(writePermissions, readPermissions)\n}\n\nexport default requestAuthorization\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAMpC;AACA,MAAMC,oBAAoB,GAAG,MAAAA,CAC3BC,IAA2C,EAC3CC,KAA6C,GAAG,EAAE,KAC7B;EACrB,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,OAAOP,MAAM,CAACC,oBAAoB,CAACO,gBAAgB,EAAEJ,eAAe,CAAC;AACvE,CAAC;AAED,eAAeH,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","saveCategorySample","identifier","value","options","start","end","Date","metadata","toISOString"],"sources":["saveCategorySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, MetadataMapperForCategoryIdentifier } from '../native-types'\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\nasync function saveCategorySample<T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveCategorySample(\n identifier,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata || {},\n )\n}\n\nexport default saveCategorySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC;AACA;AACA;AACA;AACA,eAAeC,kBAAkBA,CAC/BC,UAAa,EACbC,KAAsC,EACtCC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,MAAID,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC;EAC1D,MAAMD,GAAG,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,MAAIF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIE,IAAI,CAAC,CAAC;EACxD,MAAMC,QAAQ,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,QAAQ,KAAI,CAAC,CAAC;EAExC,OAAOR,MAAM,CAACC,kBAAkB,CAC9BC,UAAU,EACVC,KAAK,EACLE,KAAK,CAACI,WAAW,CAAC,CAAC,EACnBH,GAAG,CAACG,WAAW,CAAC,CAAC,EACjBD,QAAQ,IAAI,CAAC,CACf,CAAC;AACH;AAEA,eAAeP,kBAAkB"}
1
+ {"version":3,"names":["Native","saveCategorySample","identifier","value","options","start","end","Date","metadata","toISOString"],"sources":["saveCategorySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { HKCategoryTypeIdentifier, HKCategoryValueForIdentifier, MetadataMapperForCategoryIdentifier } from '../native-types'\n\n/**\n * @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}\n * @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}\n */\nasync function saveCategorySample<T extends HKCategoryTypeIdentifier>(\n identifier: T,\n value: HKCategoryValueForIdentifier<T>,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCategoryIdentifier<T>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveCategorySample(\n identifier,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata || {},\n )\n}\n\nexport default saveCategorySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC;AACA;AACA;AACA;AACA,eAAeC,kBAAkBA,CAC/BC,UAAa,EACbC,KAAsC,EACtCC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,MAAID,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC;EAC1D,MAAMD,GAAG,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,MAAIF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIE,IAAI,CAAC,CAAC;EACxD,MAAMC,QAAQ,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,QAAQ,KAAI,CAAC,CAAC;EAExC,OAAOR,MAAM,CAACC,kBAAkB,CAC9BC,UAAU,EACVC,KAAK,EACLE,KAAK,CAACI,WAAW,CAAC,CAAC,EACnBH,GAAG,CAACG,WAAW,CAAC,CAAC,EACjBD,QAAQ,IAAI,CAAC,CACf,CAAC;AACH;AAEA,eAAeP,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ensureMetadata","Native","saveCorrelationSample","typeIdentifier","samples","options","start","Date","toISOString","end","map","sample","startDate","endDate","rest","updatedSample","metadata"],"sources":["saveCorrelationSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport Native from '../native-types'\n\nimport type { MetadataMapperForCorrelationIdentifier, HKCorrelationTypeIdentifier } from '../native-types'\nimport type { HKCategorySampleForSaving, HKQuantitySampleForSaving } from '../types'\n\nasync function saveCorrelationSample<\n TIdentifier extends HKCorrelationTypeIdentifier,\n TSamples extends readonly(\n | HKCategorySampleForSaving\n | HKQuantitySampleForSaving\n )[]\n>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n },\n) {\n const start = (options?.start || new Date()).toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveCorrelationSample(\n typeIdentifier,\n samples.map((sample) => {\n const { startDate, endDate, ...rest } = sample\n const updatedSample = {\n ...rest,\n ...(startDate && { startDate: new Date(startDate).toISOString() }),\n ...(endDate && { endDate: new Date(endDate).toISOString() }),\n }\n\n return { ...updatedSample, metadata: ensureMetadata(sample.metadata) }\n }),\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveCorrelationSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,qBAAqBA,CAOlCC,cAA2B,EAC3BC,OAAiB,EACjBC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAC,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAC1D,MAAMC,GAAG,GAAG,CAAC,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,GAAG,KAAI,IAAIF,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,qBAAqB,CACjCC,cAAc,EACdC,OAAO,CAACM,GAAG,CAAEC,MAAM,IAAK;IACtB,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,MAAM;IAC9C,MAAMI,aAAa,GAAG;MACpB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAE,IAAIL,IAAI,CAACK,SAAS,CAAC,CAACJ,WAAW,CAAC;MAAE,CAAC,CAAC;MAClE,IAAIK,OAAO,IAAI;QAAEA,OAAO,EAAE,IAAIN,IAAI,CAACM,OAAO,CAAC,CAACL,WAAW,CAAC;MAAE,CAAC;IAC7D,CAAC;IAED,OAAO;MAAE,GAAGO,aAAa;MAAEC,QAAQ,EAAEhB,cAAc,CAACW,MAAM,CAACK,QAAQ;IAAE,CAAC;EACxE,CAAC,CAAC,EACFV,KAAK,EACLG,GAAG,EACHT,cAAc,CAACK,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAed,qBAAqB"}
1
+ {"version":3,"names":["ensureMetadata","Native","saveCorrelationSample","typeIdentifier","samples","options","start","Date","toISOString","end","map","sample","startDate","endDate","rest","updatedSample","metadata"],"sources":["saveCorrelationSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport Native from '../native-types'\n\nimport type { MetadataMapperForCorrelationIdentifier, HKCorrelationTypeIdentifier } from '../native-types'\nimport type { HKCategorySampleForSaving, HKQuantitySampleForSaving } from '../types'\n\nasync function saveCorrelationSample<\n TIdentifier extends HKCorrelationTypeIdentifier,\n TSamples extends readonly(\n | HKCategorySampleForSaving\n | HKQuantitySampleForSaving\n )[]\n>(\n typeIdentifier: TIdentifier,\n samples: TSamples,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForCorrelationIdentifier<TIdentifier>;\n },\n) {\n const start = (options?.start || new Date()).toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveCorrelationSample(\n typeIdentifier,\n samples.map((sample) => {\n const { startDate, endDate, ...rest } = sample\n const updatedSample = {\n ...rest,\n ...(startDate && { startDate: new Date(startDate).toISOString() }),\n ...(endDate && { endDate: new Date(endDate).toISOString() }),\n }\n\n return { ...updatedSample, metadata: ensureMetadata(sample.metadata) }\n }),\n start,\n end,\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveCorrelationSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,qBAAqBA,CAOlCC,cAA2B,EAC3BC,OAAiB,EACjBC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAC,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAC1D,MAAMC,GAAG,GAAG,CAAC,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,GAAG,KAAI,IAAIF,IAAI,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,qBAAqB,CACjCC,cAAc,EACdC,OAAO,CAACM,GAAG,CAAEC,MAAM,IAAK;IACtB,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,MAAM;IAC9C,MAAMI,aAAa,GAAG;MACpB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAE,IAAIL,IAAI,CAACK,SAAS,CAAC,CAACJ,WAAW,CAAC;MAAE,CAAC,CAAC;MAClE,IAAIK,OAAO,IAAI;QAAEA,OAAO,EAAE,IAAIN,IAAI,CAACM,OAAO,CAAC,CAACL,WAAW,CAAC;MAAE,CAAC;IAC7D,CAAC;IAED,OAAO;MAAE,GAAGO,aAAa;MAAEC,QAAQ,EAAEhB,cAAc,CAACW,MAAM,CAACK,QAAQ;IAAE,CAAC;EACxE,CAAC,CAAC,EACFV,KAAK,EACLG,GAAG,EACHT,cAAc,CAACK,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAed,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","saveQuantitySample","identifier","unit","value","options","start","end","Date","metadata","toISOString"],"sources":["saveQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { MetadataMapperForQuantityIdentifier, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\n\nasync function saveQuantitySample<TType extends HKQuantityTypeIdentifier>(\n identifier: TType,\n unit: UnitForIdentifier<TType>,\n value: number,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TType>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveQuantitySample(\n identifier,\n unit,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata,\n )\n}\n\nexport default saveQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,kBAAkBA,CAC/BC,UAAiB,EACjBC,IAA8B,EAC9BC,KAAa,EACbC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,MAAID,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC;EAC1D,MAAMD,GAAG,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,MAAIF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIE,IAAI,CAAC,CAAC;EACxD,MAAMC,QAAQ,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,QAAQ,KAAI,CAAC,CAAC;EAExC,OAAOT,MAAM,CAACC,kBAAkB,CAC9BC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLE,KAAK,CAACI,WAAW,CAAC,CAAC,EACnBH,GAAG,CAACG,WAAW,CAAC,CAAC,EACjBD,QACF,CAAC;AACH;AAEA,eAAeR,kBAAkB"}
1
+ {"version":3,"names":["Native","saveQuantitySample","identifier","unit","value","options","start","end","Date","metadata","toISOString"],"sources":["saveQuantitySample.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { MetadataMapperForQuantityIdentifier, HKQuantityTypeIdentifier, UnitForIdentifier } from '../native-types'\n\nasync function saveQuantitySample<TType extends HKQuantityTypeIdentifier>(\n identifier: TType,\n unit: UnitForIdentifier<TType>,\n value: number,\n options?: {\n readonly start?: Date;\n readonly end?: Date;\n readonly metadata?: MetadataMapperForQuantityIdentifier<TType>;\n },\n) {\n const start = options?.start || options?.end || new Date()\n const end = options?.end || options?.start || new Date()\n const metadata = options?.metadata || {}\n\n return Native.saveQuantitySample(\n identifier,\n unit,\n value,\n start.toISOString(),\n end.toISOString(),\n metadata,\n )\n}\n\nexport default saveQuantitySample\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,kBAAkBA,CAC/BC,UAAiB,EACjBC,IAA8B,EAC9BC,KAAa,EACbC,OAIC,EACD;EACA,MAAMC,KAAK,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,MAAID,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC;EAC1D,MAAMD,GAAG,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,GAAG,MAAIF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,KAAK,KAAI,IAAIE,IAAI,CAAC,CAAC;EACxD,MAAMC,QAAQ,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,QAAQ,KAAI,CAAC,CAAC;EAExC,OAAOT,MAAM,CAACC,kBAAkB,CAC9BC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLE,KAAK,CAACI,WAAW,CAAC,CAAC,EACnBH,GAAG,CAACG,WAAW,CAAC,CAAC,EACjBD,QACF,CAAC;AACH;AAEA,eAAeR,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Native","saveWorkoutRoute","workoutUUID","locations","map","location","timestamp","rest","Date","toISOString"],"sources":["saveWorkoutRoute.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { CLLocationForSaving } from '../types'\n\nasync function saveWorkoutRoute(\n workoutUUID: string,\n locations: readonly CLLocationForSaving[],\n) {\n return Native.saveWorkoutRoute(\n workoutUUID,\n locations.map((location) => {\n const { timestamp, ...rest } = location\n return {\n ...rest,\n ...(timestamp ? { timestamp: new Date(timestamp).toISOString() } : { timestamp: '' }),\n }\n }),\n )\n}\n\nexport default saveWorkoutRoute\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,gBAAgBA,CAC7BC,WAAmB,EACnBC,SAAyC,EACzC;EACA,OAAOH,MAAM,CAACC,gBAAgB,CAC5BC,WAAW,EACXC,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;IAC1B,MAAM;MAAEC,SAAS;MAAE,GAAGC;IAAK,CAAC,GAAGF,QAAQ;IACvC,OAAO;MACL,GAAGE,IAAI;MACP,IAAID,SAAS,GAAG;QAAEA,SAAS,EAAE,IAAIE,IAAI,CAACF,SAAS,CAAC,CAACG,WAAW,CAAC;MAAE,CAAC,GAAG;QAAEH,SAAS,EAAE;MAAG,CAAC;IACtF,CAAC;EACH,CAAC,CACH,CAAC;AACH;AAEA,eAAeL,gBAAgB"}
1
+ {"version":3,"names":["Native","saveWorkoutRoute","workoutUUID","locations","map","location","timestamp","rest","Date","toISOString"],"sources":["saveWorkoutRoute.ts"],"sourcesContent":["import Native from '../native-types'\n\nimport type { CLLocationForSaving } from '../types'\n\nasync function saveWorkoutRoute(\n workoutUUID: string,\n locations: readonly CLLocationForSaving[],\n) {\n return Native.saveWorkoutRoute(\n workoutUUID,\n locations.map((location) => {\n const { timestamp, ...rest } = location\n return {\n ...rest,\n ...(timestamp ? { timestamp: new Date(timestamp).toISOString() } : { timestamp: '' }),\n }\n }),\n )\n}\n\nexport default saveWorkoutRoute\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAIpC,eAAeC,gBAAgBA,CAC7BC,WAAmB,EACnBC,SAAyC,EACzC;EACA,OAAOH,MAAM,CAACC,gBAAgB,CAC5BC,WAAW,EACXC,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;IAC1B,MAAM;MAAEC,SAAS;MAAE,GAAGC;IAAK,CAAC,GAAGF,QAAQ;IACvC,OAAO;MACL,GAAGE,IAAI;MACP,IAAID,SAAS,GAAG;QAAEA,SAAS,EAAE,IAAIE,IAAI,CAACF,SAAS,CAAC,CAACG,WAAW,CAAC;MAAE,CAAC,GAAG;QAAEH,SAAS,EAAE;MAAG,CAAC;IACtF,CAAC;EACH,CAAC,CACH,CAAC;AACH;AAEA,eAAeL,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ensureMetadata","ensureTotals","Native","saveWorkoutSample","typeIdentifier","quantities","_start","options","start","toISOString","end","Date","map","quantity","startDate","endDate","rest","updatedQuantity","metadata","totals"],"sources":["saveWorkoutSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport ensureTotals from './ensureTotals'\nimport Native from '../native-types'\n\nimport type { HKWorkoutActivityType, HKWorkoutMetadata } from '../native-types'\nimport type { HKQuantitySampleForSaving } from '../types'\n\nasync function saveWorkoutSample<TIdentifier extends HKWorkoutActivityType>(\n typeIdentifier: TIdentifier,\n quantities: readonly HKQuantitySampleForSaving[],\n _start: Date,\n options?: {\n readonly end?: Date;\n readonly totals?: {\n readonly distance?: number;\n readonly energyBurned?: number;\n }\n readonly metadata?: HKWorkoutMetadata;\n },\n) {\n const start = _start.toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveWorkoutSample(\n typeIdentifier,\n quantities.map((quantity) => {\n const { startDate, endDate, ...rest } = quantity\n const updatedQuantity = {\n ...rest,\n ...(startDate && { startDate: startDate.toISOString() }),\n ...(endDate && { endDate: endDate.toISOString() }),\n }\n return { ...updatedQuantity, metadata: ensureMetadata(quantity.metadata) }\n }),\n start,\n end,\n ensureTotals(options?.totals),\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveWorkoutSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,iBAAiBA,CAC9BC,cAA2B,EAC3BC,UAAgD,EAChDC,MAAY,EACZC,OAOC,EACD;EACA,MAAMC,KAAK,GAAGF,MAAM,CAACG,WAAW,CAAC,CAAC;EAClC,MAAMC,GAAG,GAAG,CAAC,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEF,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,iBAAiB,CAC7BC,cAAc,EACdC,UAAU,CAACO,GAAG,CAAEC,QAAQ,IAAK;IAC3B,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,QAAQ;IAChD,MAAMI,eAAe,GAAG;MACtB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAEA,SAAS,CAACL,WAAW,CAAC;MAAE,CAAC,CAAC;MACxD,IAAIM,OAAO,IAAI;QAAEA,OAAO,EAAEA,OAAO,CAACN,WAAW,CAAC;MAAE,CAAC;IACnD,CAAC;IACD,OAAO;MAAE,GAAGQ,eAAe;MAAEC,QAAQ,EAAElB,cAAc,CAACa,QAAQ,CAACK,QAAQ;IAAE,CAAC;EAC5E,CAAC,CAAC,EACFV,KAAK,EACLE,GAAG,EACHT,YAAY,CAACM,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEY,MAAM,CAAC,EAC7BnB,cAAc,CAACO,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAef,iBAAiB"}
1
+ {"version":3,"names":["ensureMetadata","ensureTotals","Native","saveWorkoutSample","typeIdentifier","quantities","_start","options","start","toISOString","end","Date","map","quantity","startDate","endDate","rest","updatedQuantity","metadata","totals"],"sources":["saveWorkoutSample.ts"],"sourcesContent":["import ensureMetadata from './ensureMetadata'\nimport ensureTotals from './ensureTotals'\nimport Native from '../native-types'\n\nimport type { HKWorkoutActivityType, HKWorkoutMetadata } from '../native-types'\nimport type { HKQuantitySampleForSaving } from '../types'\n\nasync function saveWorkoutSample<TIdentifier extends HKWorkoutActivityType>(\n typeIdentifier: TIdentifier,\n quantities: readonly HKQuantitySampleForSaving[],\n _start: Date,\n options?: {\n readonly end?: Date;\n readonly totals?: {\n readonly distance?: number;\n readonly energyBurned?: number;\n }\n readonly metadata?: HKWorkoutMetadata;\n },\n) {\n const start = _start.toISOString()\n const end = (options?.end || new Date()).toISOString()\n\n return Native.saveWorkoutSample(\n typeIdentifier,\n quantities.map((quantity) => {\n const { startDate, endDate, ...rest } = quantity\n const updatedQuantity = {\n ...rest,\n ...(startDate && { startDate: startDate.toISOString() }),\n ...(endDate && { endDate: endDate.toISOString() }),\n }\n return { ...updatedQuantity, metadata: ensureMetadata(quantity.metadata) }\n }),\n start,\n end,\n ensureTotals(options?.totals),\n ensureMetadata(options?.metadata),\n )\n}\n\nexport default saveWorkoutSample\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,MAAM,MAAM,iBAAiB;AAKpC,eAAeC,iBAAiBA,CAC9BC,cAA2B,EAC3BC,UAAgD,EAChDC,MAAY,EACZC,OAOC,EACD;EACA,MAAMC,KAAK,GAAGF,MAAM,CAACG,WAAW,CAAC,CAAC;EAClC,MAAMC,GAAG,GAAG,CAAC,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG,KAAI,IAAIC,IAAI,CAAC,CAAC,EAAEF,WAAW,CAAC,CAAC;EAEtD,OAAOP,MAAM,CAACC,iBAAiB,CAC7BC,cAAc,EACdC,UAAU,CAACO,GAAG,CAAEC,QAAQ,IAAK;IAC3B,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAE,GAAGC;IAAK,CAAC,GAAGH,QAAQ;IAChD,MAAMI,eAAe,GAAG;MACtB,GAAGD,IAAI;MACP,IAAIF,SAAS,IAAI;QAAEA,SAAS,EAAEA,SAAS,CAACL,WAAW,CAAC;MAAE,CAAC,CAAC;MACxD,IAAIM,OAAO,IAAI;QAAEA,OAAO,EAAEA,OAAO,CAACN,WAAW,CAAC;MAAE,CAAC;IACnD,CAAC;IACD,OAAO;MAAE,GAAGQ,eAAe;MAAEC,QAAQ,EAAElB,cAAc,CAACa,QAAQ,CAACK,QAAQ;IAAE,CAAC;EAC5E,CAAC,CAAC,EACFV,KAAK,EACLE,GAAG,EACHT,YAAY,CAACM,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEY,MAAM,CAAC,EAC7BnB,cAAc,CAACO,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEW,QAAQ,CAClC,CAAC;AACH;AAEA,eAAef,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["serializeDate","date","Date","toISOString"],"sources":["serializeDate.ts"],"sourcesContent":["const serializeDate = (date?: Date | null): string => (\n (date || new Date(-1)).toISOString()\n)\n\nexport default serializeDate\n"],"mappings":"AAAA,MAAMA,aAAa,GAAIC,IAAkB,IACvC,CAACA,IAAI,IAAI,IAAIC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAEC,WAAW,CAAC,CACpC;AAED,eAAeH,aAAa"}
1
+ {"version":3,"names":["serializeDate","date","Date","toISOString"],"sources":["serializeDate.ts"],"sourcesContent":["const serializeDate = (date?: Date | null): string => (\n (date || new Date(-1)).toISOString()\n)\n\nexport default serializeDate\n"],"mappings":"AAAA,MAAMA,aAAa,GAAIC,IAAkB,IACvC,CAACA,IAAI,IAAI,IAAIC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAEC,WAAW,CAAC,CACpC;AAED,eAAeH,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["serializeDate","describe","it","expect","Date","toBe","date","toISOString"],"sources":["serializeDate.test.ts"],"sourcesContent":["import serializeDate from './serializeDate'\n\ndescribe('serializeDate', () => {\n it('should serialize zero date', () => {\n expect(serializeDate(new Date(0))).toBe('1970-01-01T00:00:00.000Z')\n })\n\n it('should serialize date', () => {\n const date = new Date()\n expect(serializeDate(date)).toBe(date.toISOString())\n })\n\n it('should serialize null date', () => {\n expect(serializeDate(null)).toBe('1969-12-31T23:59:59.999Z')\n })\n})\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,iBAAiB;AAE3CC,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9BC,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAII,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;EACrE,CAAC,CAAC;EAEFH,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAChC,MAAMI,IAAI,GAAG,IAAIF,IAAI,CAAC,CAAC;IACvBD,MAAM,CAACH,aAAa,CAACM,IAAI,CAAC,CAAC,CAACD,IAAI,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;EACtD,CAAC,CAAC;EAEFL,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAI,CAAC,CAAC,CAACK,IAAI,CAAC,0BAA0B,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["serializeDate","describe","it","expect","Date","toBe","date","toISOString"],"sources":["serializeDate.test.ts"],"sourcesContent":["import serializeDate from './serializeDate'\n\ndescribe('serializeDate', () => {\n it('should serialize zero date', () => {\n expect(serializeDate(new Date(0))).toBe('1970-01-01T00:00:00.000Z')\n })\n\n it('should serialize date', () => {\n const date = new Date()\n expect(serializeDate(date)).toBe(date.toISOString())\n })\n\n it('should serialize null date', () => {\n expect(serializeDate(null)).toBe('1969-12-31T23:59:59.999Z')\n })\n})\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,iBAAiB;AAE3CC,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9BC,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAII,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;EACrE,CAAC,CAAC;EAEFH,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAChC,MAAMI,IAAI,GAAG,IAAIF,IAAI,CAAC,CAAC;IACvBD,MAAM,CAACH,aAAa,CAACM,IAAI,CAAC,CAAC,CAACD,IAAI,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;EACtD,CAAC,CAAC;EAEFL,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCC,MAAM,CAACH,aAAa,CAAC,IAAI,CAAC,CAAC,CAACK,IAAI,CAAC,0BAA0B,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}