@kingstinct/react-native-healthkit 8.7.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReactNativeHealthkit.podspec +36 -0
- package/app.plugin.js +43 -33
- package/ios/Bridge.h +8 -0
- package/ios/CategoryTypeModule.swift +128 -0
- package/ios/CharacteristicTypeModule.swift +78 -0
- package/ios/Constants.swift +2 -0
- package/ios/CoreModule.swift +376 -0
- package/ios/CorrelationTypeModule.swift +153 -0
- package/ios/HeartbeatSeriesModule.swift +189 -0
- package/ios/Helpers.swift +529 -251
- package/ios/QuantityTypeModule.swift +461 -0
- package/ios/Serializers.swift +211 -124
- package/ios/SourceProxy.swift +35 -0
- package/ios/StateOfMindModule.swift +160 -0
- package/ios/WorkoutProxy.swift +405 -0
- package/ios/WorkoutSessionModule.swift +182 -0
- package/ios/WorkoutsModule.swift +357 -0
- package/package.json +43 -127
- package/react-native.config.js +16 -0
- package/src/hooks/useHealthkitAuthorization.test.ts +47 -29
- package/src/hooks/useHealthkitAuthorization.ts +21 -15
- package/src/hooks/useIsHealthDataAvailable.test.ts +17 -7
- package/src/hooks/useIsHealthDataAvailable.ts +7 -7
- package/src/hooks/useMostRecentCategorySample.ts +10 -12
- package/src/hooks/useMostRecentQuantitySample.ts +17 -36
- package/src/hooks/useMostRecentWorkout.ts +16 -38
- package/src/hooks/useSources.ts +8 -12
- package/src/hooks/useStatisticsForQuantity.ts +19 -14
- package/src/hooks/useSubscribeToChanges.ts +9 -13
- package/src/index.ios.ts +232 -0
- package/src/index.ts +444 -0
- package/src/modules.ts +43 -0
- package/src/specs/CategoryTypeModule.nitro.ts +64 -0
- package/src/specs/CharacteristicTypeModule.nitro.ts +22 -0
- package/src/specs/CoreModule.nitro.ts +107 -0
- package/src/specs/CorrelationTypeModule.nitro.ts +23 -0
- package/src/specs/HeartbeatSeriesModule.nitro.ts +19 -0
- package/src/specs/QuantityTypeModule.nitro.ts +60 -0
- package/src/specs/SourceProxy.nitro.ts +13 -0
- package/src/specs/StateOfMindModule.nitro.ts +23 -0
- package/src/specs/WorkoutProxy.nitro.ts +18 -0
- package/src/specs/WorkoutSessionModule.nitro.ts +71 -0
- package/src/specs/WorkoutsModule.nitro.ts +32 -0
- package/src/test-setup.ts +68 -54
- package/src/test-utils.ts +3 -2
- package/src/types/Auth.ts +17 -0
- package/src/types/Background.ts +9 -0
- package/src/types/CategoryType.ts +249 -0
- package/src/types/CategoryTypeIdentifier.ts +99 -0
- package/src/types/Characteristics.ts +53 -0
- package/src/types/Constants.ts +25 -0
- package/src/types/CorrelationType.ts +31 -0
- package/src/types/Device.ts +13 -0
- package/src/types/HeartbeatSeries.ts +29 -0
- package/src/types/InterfaceVerification.ts +164 -0
- package/src/types/InterfaceVerificationExample.ts +89 -0
- package/src/types/QuantitySample.ts +30 -0
- package/src/types/QuantityType.ts +192 -0
- package/src/types/QuantityTypeIdentifier.ts +758 -0
- package/src/types/QueryOptions.ts +69 -0
- package/src/types/README-InterfaceVerification.md +103 -0
- package/src/types/Shared.ts +79 -0
- package/src/types/Source.ts +11 -0
- package/src/types/StateOfMind.ts +110 -0
- package/src/types/Subscriptons.ts +10 -0
- package/src/types/Units.ts +190 -0
- package/src/types/WeatherCondition.ts +31 -0
- package/src/types/WorkoutKit.ts +18 -0
- package/src/types/Workouts.ts +282 -0
- package/src/utils/getMostRecentCategorySample.ts +7 -11
- package/src/utils/getMostRecentQuantitySample.ts +8 -18
- package/src/utils/getMostRecentWorkout.ts +7 -17
- package/src/utils/getPreferredUnit.ts +12 -8
- package/src/utils/subscribeToChanges.ts +9 -26
- package/LICENSE +0 -21
- package/README.md +0 -179
- package/ios/ReactNativeHealthkit-Bridging-Header.h +0 -2
- package/ios/ReactNativeHealthkit.m +0 -271
- package/ios/ReactNativeHealthkit.swift +0 -2333
- package/ios/ReactNativeHealthkit.xcodeproj/project.pbxproj +0 -279
- package/kingstinct-react-native-healthkit.podspec +0 -21
- package/lib/commonjs/hooks/useHealthkitAuthorization.js +0 -39
- package/lib/commonjs/hooks/useHealthkitAuthorization.js.map +0 -1
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js +0 -72
- package/lib/commonjs/hooks/useHealthkitAuthorization.test.js.map +0 -1
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js +0 -27
- package/lib/commonjs/hooks/useIsHealthDataAvailable.js.map +0 -1
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js +0 -41
- package/lib/commonjs/hooks/useIsHealthDataAvailable.test.js.map +0 -1
- package/lib/commonjs/hooks/useMostRecentCategorySample.js +0 -23
- package/lib/commonjs/hooks/useMostRecentCategorySample.js.map +0 -1
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js +0 -37
- package/lib/commonjs/hooks/useMostRecentQuantitySample.js.map +0 -1
- package/lib/commonjs/hooks/useMostRecentWorkout.js +0 -48
- package/lib/commonjs/hooks/useMostRecentWorkout.js.map +0 -1
- package/lib/commonjs/hooks/useSources.js +0 -22
- package/lib/commonjs/hooks/useSources.js.map +0 -1
- package/lib/commonjs/hooks/useStatisticsForQuantity.js +0 -28
- package/lib/commonjs/hooks/useStatisticsForQuantity.js.map +0 -1
- package/lib/commonjs/hooks/useSubscribeToChanges.js +0 -28
- package/lib/commonjs/hooks/useSubscribeToChanges.js.map +0 -1
- package/lib/commonjs/index.ios.js +0 -531
- package/lib/commonjs/index.ios.js.map +0 -1
- package/lib/commonjs/index.js +0 -22
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/index.native.js +0 -235
- package/lib/commonjs/index.native.js.map +0 -1
- package/lib/commonjs/index.web.js +0 -22
- package/lib/commonjs/index.web.js.map +0 -1
- package/lib/commonjs/native-types.js +0 -1575
- package/lib/commonjs/native-types.js.map +0 -1
- package/lib/commonjs/test-setup.js +0 -57
- package/lib/commonjs/test-setup.js.map +0 -1
- package/lib/commonjs/test-utils.js +0 -18
- package/lib/commonjs/test-utils.js.map +0 -1
- package/lib/commonjs/types.js +0 -17
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/deleteQuantitySample.js +0 -11
- package/lib/commonjs/utils/deleteQuantitySample.js.map +0 -1
- package/lib/commonjs/utils/deleteSamples.js +0 -18
- package/lib/commonjs/utils/deleteSamples.js.map +0 -1
- package/lib/commonjs/utils/deleteWorkoutSample.js +0 -11
- package/lib/commonjs/utils/deleteWorkoutSample.js.map +0 -1
- package/lib/commonjs/utils/deserializeCategorySample.js +0 -13
- package/lib/commonjs/utils/deserializeCategorySample.js.map +0 -1
- package/lib/commonjs/utils/deserializeCategorySample.test.js +0 -26
- package/lib/commonjs/utils/deserializeCategorySample.test.js.map +0 -1
- package/lib/commonjs/utils/deserializeCorrelation.js +0 -26
- package/lib/commonjs/utils/deserializeCorrelation.js.map +0 -1
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js +0 -15
- package/lib/commonjs/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
- package/lib/commonjs/utils/deserializeSample.js +0 -15
- package/lib/commonjs/utils/deserializeSample.js.map +0 -1
- package/lib/commonjs/utils/deserializeWorkout.js +0 -15
- package/lib/commonjs/utils/deserializeWorkout.js.map +0 -1
- package/lib/commonjs/utils/ensureMetadata.js +0 -11
- package/lib/commonjs/utils/ensureMetadata.js.map +0 -1
- package/lib/commonjs/utils/ensureTotals.js +0 -11
- package/lib/commonjs/utils/ensureTotals.js.map +0 -1
- package/lib/commonjs/utils/ensureUnit.js +0 -17
- package/lib/commonjs/utils/ensureUnit.js.map +0 -1
- package/lib/commonjs/utils/getDateOfBirth.js +0 -14
- package/lib/commonjs/utils/getDateOfBirth.js.map +0 -1
- package/lib/commonjs/utils/getMostRecentCategorySample.js +0 -17
- package/lib/commonjs/utils/getMostRecentCategorySample.js.map +0 -1
- package/lib/commonjs/utils/getMostRecentQuantitySample.js +0 -21
- package/lib/commonjs/utils/getMostRecentQuantitySample.js.map +0 -1
- package/lib/commonjs/utils/getMostRecentWorkout.js +0 -19
- package/lib/commonjs/utils/getMostRecentWorkout.js.map +0 -1
- package/lib/commonjs/utils/getPreferredUnit.js +0 -14
- package/lib/commonjs/utils/getPreferredUnit.js.map +0 -1
- package/lib/commonjs/utils/getPreferredUnits.js +0 -14
- package/lib/commonjs/utils/getPreferredUnits.js.map +0 -1
- package/lib/commonjs/utils/getPreferredUnitsTyped.js +0 -33
- package/lib/commonjs/utils/getPreferredUnitsTyped.js.map +0 -1
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js +0 -21
- package/lib/commonjs/utils/getRequestStatusForAuthorization.js.map +0 -1
- package/lib/commonjs/utils/getWorkoutPlanById.js +0 -13
- package/lib/commonjs/utils/getWorkoutPlanById.js.map +0 -1
- package/lib/commonjs/utils/prepareOptions.js +0 -25
- package/lib/commonjs/utils/prepareOptions.js.map +0 -1
- package/lib/commonjs/utils/queryCategorySamples.js +0 -17
- package/lib/commonjs/utils/queryCategorySamples.js.map +0 -1
- package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js +0 -21
- package/lib/commonjs/utils/queryCategorySamplesWithAnchor.js.map +0 -1
- package/lib/commonjs/utils/queryCorrelationSamples.js +0 -17
- package/lib/commonjs/utils/queryCorrelationSamples.js.map +0 -1
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js +0 -17
- package/lib/commonjs/utils/queryHeartbeatSeriesSamples.js.map +0 -1
- package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -21
- package/lib/commonjs/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
- package/lib/commonjs/utils/queryQuantitySamples.js +0 -19
- package/lib/commonjs/utils/queryQuantitySamples.js.map +0 -1
- package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js +0 -23
- package/lib/commonjs/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
- package/lib/commonjs/utils/querySources.js +0 -14
- package/lib/commonjs/utils/querySources.js.map +0 -1
- package/lib/commonjs/utils/queryStateOfMindSamples.js +0 -22
- package/lib/commonjs/utils/queryStateOfMindSamples.js.map +0 -1
- package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js +0 -16
- package/lib/commonjs/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
- package/lib/commonjs/utils/queryStatisticsForQuantity.js +0 -29
- package/lib/commonjs/utils/queryStatisticsForQuantity.js.map +0 -1
- package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js +0 -26
- package/lib/commonjs/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
- package/lib/commonjs/utils/queryWorkouts.js +0 -22
- package/lib/commonjs/utils/queryWorkouts.js.map +0 -1
- package/lib/commonjs/utils/requestAuthorization.js +0 -22
- package/lib/commonjs/utils/requestAuthorization.js.map +0 -1
- package/lib/commonjs/utils/saveCategorySample.js +0 -20
- package/lib/commonjs/utils/saveCategorySample.js.map +0 -1
- package/lib/commonjs/utils/saveCorrelationSample.js +0 -35
- package/lib/commonjs/utils/saveCorrelationSample.js.map +0 -1
- package/lib/commonjs/utils/saveQuantitySample.js +0 -16
- package/lib/commonjs/utils/saveQuantitySample.js.map +0 -1
- package/lib/commonjs/utils/saveStateOfMindSample.js +0 -17
- package/lib/commonjs/utils/saveStateOfMindSample.js.map +0 -1
- package/lib/commonjs/utils/saveWorkoutRoute.js +0 -26
- package/lib/commonjs/utils/saveWorkoutRoute.js.map +0 -1
- package/lib/commonjs/utils/saveWorkoutSample.js +0 -36
- package/lib/commonjs/utils/saveWorkoutSample.js.map +0 -1
- package/lib/commonjs/utils/serializeDate.js +0 -9
- package/lib/commonjs/utils/serializeDate.js.map +0 -1
- package/lib/commonjs/utils/serializeDate.test.js +0 -17
- package/lib/commonjs/utils/serializeDate.test.js.map +0 -1
- package/lib/commonjs/utils/startWatchApp.js +0 -11
- package/lib/commonjs/utils/startWatchApp.js.map +0 -1
- package/lib/commonjs/utils/subscribeToChanges.js +0 -27
- package/lib/commonjs/utils/subscribeToChanges.js.map +0 -1
- package/lib/module/hooks/useHealthkitAuthorization.js +0 -32
- package/lib/module/hooks/useHealthkitAuthorization.js.map +0 -1
- package/lib/module/hooks/useHealthkitAuthorization.test.js +0 -68
- package/lib/module/hooks/useHealthkitAuthorization.test.js.map +0 -1
- package/lib/module/hooks/useIsHealthDataAvailable.js +0 -21
- package/lib/module/hooks/useIsHealthDataAvailable.js.map +0 -1
- package/lib/module/hooks/useIsHealthDataAvailable.test.js +0 -37
- package/lib/module/hooks/useIsHealthDataAvailable.test.js.map +0 -1
- package/lib/module/hooks/useMostRecentCategorySample.js +0 -16
- package/lib/module/hooks/useMostRecentCategorySample.js.map +0 -1
- package/lib/module/hooks/useMostRecentQuantitySample.js +0 -30
- package/lib/module/hooks/useMostRecentQuantitySample.js.map +0 -1
- package/lib/module/hooks/useMostRecentWorkout.js +0 -41
- package/lib/module/hooks/useMostRecentWorkout.js.map +0 -1
- package/lib/module/hooks/useSources.js +0 -15
- package/lib/module/hooks/useSources.js.map +0 -1
- package/lib/module/hooks/useStatisticsForQuantity.js +0 -21
- package/lib/module/hooks/useStatisticsForQuantity.js.map +0 -1
- package/lib/module/hooks/useSubscribeToChanges.js +0 -21
- package/lib/module/hooks/useSubscribeToChanges.js.map +0 -1
- package/lib/module/index.ios.js +0 -209
- package/lib/module/index.ios.js.map +0 -1
- package/lib/module/index.js +0 -4
- package/lib/module/index.js.map +0 -1
- package/lib/module/index.native.js +0 -160
- package/lib/module/index.native.js.map +0 -1
- package/lib/module/index.web.js +0 -4
- package/lib/module/index.web.js.map +0 -1
- package/lib/module/native-types.js +0 -1606
- package/lib/module/native-types.js.map +0 -1
- package/lib/module/test-setup.js +0 -54
- package/lib/module/test-setup.js.map +0 -1
- package/lib/module/test-utils.js +0 -11
- package/lib/module/test-utils.js.map +0 -1
- package/lib/module/types.js +0 -67
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/deleteQuantitySample.js +0 -4
- package/lib/module/utils/deleteQuantitySample.js.map +0 -1
- package/lib/module/utils/deleteSamples.js +0 -11
- package/lib/module/utils/deleteSamples.js.map +0 -1
- package/lib/module/utils/deleteWorkoutSample.js +0 -4
- package/lib/module/utils/deleteWorkoutSample.js.map +0 -1
- package/lib/module/utils/deserializeCategorySample.js +0 -7
- package/lib/module/utils/deserializeCategorySample.js.map +0 -1
- package/lib/module/utils/deserializeCategorySample.test.js +0 -22
- package/lib/module/utils/deserializeCategorySample.test.js.map +0 -1
- package/lib/module/utils/deserializeCorrelation.js +0 -19
- package/lib/module/utils/deserializeCorrelation.js.map +0 -1
- package/lib/module/utils/deserializeHeartbeatSeriesSample.js +0 -9
- package/lib/module/utils/deserializeHeartbeatSeriesSample.js.map +0 -1
- package/lib/module/utils/deserializeSample.js +0 -9
- package/lib/module/utils/deserializeSample.js.map +0 -1
- package/lib/module/utils/deserializeWorkout.js +0 -9
- package/lib/module/utils/deserializeWorkout.js.map +0 -1
- package/lib/module/utils/ensureMetadata.js +0 -5
- package/lib/module/utils/ensureMetadata.js.map +0 -1
- package/lib/module/utils/ensureTotals.js +0 -5
- package/lib/module/utils/ensureTotals.js.map +0 -1
- package/lib/module/utils/ensureUnit.js +0 -10
- package/lib/module/utils/ensureUnit.js.map +0 -1
- package/lib/module/utils/getDateOfBirth.js +0 -7
- package/lib/module/utils/getDateOfBirth.js.map +0 -1
- package/lib/module/utils/getMostRecentCategorySample.js +0 -10
- package/lib/module/utils/getMostRecentCategorySample.js.map +0 -1
- package/lib/module/utils/getMostRecentQuantitySample.js +0 -14
- package/lib/module/utils/getMostRecentQuantitySample.js.map +0 -1
- package/lib/module/utils/getMostRecentWorkout.js +0 -12
- package/lib/module/utils/getMostRecentWorkout.js.map +0 -1
- package/lib/module/utils/getPreferredUnit.js +0 -7
- package/lib/module/utils/getPreferredUnit.js.map +0 -1
- package/lib/module/utils/getPreferredUnits.js +0 -7
- package/lib/module/utils/getPreferredUnits.js.map +0 -1
- package/lib/module/utils/getPreferredUnitsTyped.js +0 -26
- package/lib/module/utils/getPreferredUnitsTyped.js.map +0 -1
- package/lib/module/utils/getRequestStatusForAuthorization.js +0 -14
- package/lib/module/utils/getRequestStatusForAuthorization.js.map +0 -1
- package/lib/module/utils/getWorkoutPlanById.js +0 -6
- package/lib/module/utils/getWorkoutPlanById.js.map +0 -1
- package/lib/module/utils/prepareOptions.js +0 -18
- package/lib/module/utils/prepareOptions.js.map +0 -1
- package/lib/module/utils/queryCategorySamples.js +0 -10
- package/lib/module/utils/queryCategorySamples.js.map +0 -1
- package/lib/module/utils/queryCategorySamplesWithAnchor.js +0 -14
- package/lib/module/utils/queryCategorySamplesWithAnchor.js.map +0 -1
- package/lib/module/utils/queryCorrelationSamples.js +0 -10
- package/lib/module/utils/queryCorrelationSamples.js.map +0 -1
- package/lib/module/utils/queryHeartbeatSeriesSamples.js +0 -10
- package/lib/module/utils/queryHeartbeatSeriesSamples.js.map +0 -1
- package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js +0 -14
- package/lib/module/utils/queryHeartbeatSeriesSamplesWithAnchor.js.map +0 -1
- package/lib/module/utils/queryQuantitySamples.js +0 -12
- package/lib/module/utils/queryQuantitySamples.js.map +0 -1
- package/lib/module/utils/queryQuantitySamplesWithAnchor.js +0 -16
- package/lib/module/utils/queryQuantitySamplesWithAnchor.js.map +0 -1
- package/lib/module/utils/querySources.js +0 -7
- package/lib/module/utils/querySources.js.map +0 -1
- package/lib/module/utils/queryStateOfMindSamples.js +0 -14
- package/lib/module/utils/queryStateOfMindSamples.js.map +0 -1
- package/lib/module/utils/queryStatisticsCollectionForQuantity.js +0 -9
- package/lib/module/utils/queryStatisticsCollectionForQuantity.js.map +0 -1
- package/lib/module/utils/queryStatisticsForQuantity.js +0 -22
- package/lib/module/utils/queryStatisticsForQuantity.js.map +0 -1
- package/lib/module/utils/queryWorkoutSamplesWithAnchor.js +0 -19
- package/lib/module/utils/queryWorkoutSamplesWithAnchor.js.map +0 -1
- package/lib/module/utils/queryWorkouts.js +0 -15
- package/lib/module/utils/queryWorkouts.js.map +0 -1
- package/lib/module/utils/requestAuthorization.js +0 -15
- package/lib/module/utils/requestAuthorization.js.map +0 -1
- package/lib/module/utils/saveCategorySample.js +0 -13
- package/lib/module/utils/saveCategorySample.js.map +0 -1
- package/lib/module/utils/saveCorrelationSample.js +0 -28
- package/lib/module/utils/saveCorrelationSample.js.map +0 -1
- package/lib/module/utils/saveQuantitySample.js +0 -9
- package/lib/module/utils/saveQuantitySample.js.map +0 -1
- package/lib/module/utils/saveStateOfMindSample.js +0 -10
- package/lib/module/utils/saveStateOfMindSample.js.map +0 -1
- package/lib/module/utils/saveWorkoutRoute.js +0 -19
- package/lib/module/utils/saveWorkoutRoute.js.map +0 -1
- package/lib/module/utils/saveWorkoutSample.js +0 -29
- package/lib/module/utils/saveWorkoutSample.js.map +0 -1
- package/lib/module/utils/serializeDate.js +0 -3
- package/lib/module/utils/serializeDate.js.map +0 -1
- package/lib/module/utils/serializeDate.test.js +0 -14
- package/lib/module/utils/serializeDate.test.js.map +0 -1
- package/lib/module/utils/startWatchApp.js +0 -4
- package/lib/module/utils/startWatchApp.js.map +0 -1
- package/lib/module/utils/subscribeToChanges.js +0 -20
- package/lib/module/utils/subscribeToChanges.js.map +0 -1
- package/lib/typescript/example-expo/App.d.ts +0 -2
- package/lib/typescript/src/hooks/useHealthkitAuthorization.d.ts +0 -8
- package/lib/typescript/src/hooks/useHealthkitAuthorization.test.d.ts +0 -1
- package/lib/typescript/src/hooks/useIsHealthDataAvailable.d.ts +0 -7
- package/lib/typescript/src/hooks/useIsHealthDataAvailable.test.d.ts +0 -1
- package/lib/typescript/src/hooks/useMostRecentCategorySample.d.ts +0 -7
- package/lib/typescript/src/hooks/useMostRecentQuantitySample.d.ts +0 -7
- package/lib/typescript/src/hooks/useMostRecentWorkout.d.ts +0 -10
- package/lib/typescript/src/hooks/useSources.d.ts +0 -3
- package/lib/typescript/src/hooks/useStatisticsForQuantity.d.ts +0 -4
- package/lib/typescript/src/hooks/useSubscribeToChanges.d.ts +0 -3
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.ios.d.ts +0 -198
- package/lib/typescript/src/index.native.d.ts +0 -41
- package/lib/typescript/src/index.web.d.ts +0 -3
- package/lib/typescript/src/native-types.d.ts +0 -1764
- package/lib/typescript/src/test-setup.d.ts +0 -1
- package/lib/typescript/src/test-utils.d.ts +0 -2
- package/lib/typescript/src/types.d.ts +0 -111
- package/lib/typescript/src/utils/deleteQuantitySample.d.ts +0 -4
- package/lib/typescript/src/utils/deleteSamples.d.ts +0 -8
- package/lib/typescript/src/utils/deleteWorkoutSample.d.ts +0 -3
- package/lib/typescript/src/utils/deserializeCategorySample.d.ts +0 -4
- package/lib/typescript/src/utils/deserializeCategorySample.test.d.ts +0 -1
- package/lib/typescript/src/utils/deserializeCorrelation.d.ts +0 -4
- package/lib/typescript/src/utils/deserializeHeartbeatSeriesSample.d.ts +0 -4
- package/lib/typescript/src/utils/deserializeSample.d.ts +0 -4
- package/lib/typescript/src/utils/deserializeWorkout.d.ts +0 -4
- package/lib/typescript/src/utils/ensureMetadata.d.ts +0 -2
- package/lib/typescript/src/utils/ensureTotals.d.ts +0 -2
- package/lib/typescript/src/utils/ensureUnit.d.ts +0 -3
- package/lib/typescript/src/utils/getDateOfBirth.d.ts +0 -2
- package/lib/typescript/src/utils/getMostRecentCategorySample.d.ts +0 -4
- package/lib/typescript/src/utils/getMostRecentQuantitySample.d.ts +0 -4
- package/lib/typescript/src/utils/getMostRecentWorkout.d.ts +0 -5
- package/lib/typescript/src/utils/getPreferredUnit.d.ts +0 -4
- package/lib/typescript/src/utils/getPreferredUnits.d.ts +0 -4
- package/lib/typescript/src/utils/getPreferredUnitsTyped.d.ts +0 -9
- package/lib/typescript/src/utils/getRequestStatusForAuthorization.d.ts +0 -3
- package/lib/typescript/src/utils/getWorkoutPlanById.d.ts +0 -5
- package/lib/typescript/src/utils/prepareOptions.d.ts +0 -9
- package/lib/typescript/src/utils/queryCategorySamples.d.ts +0 -5
- package/lib/typescript/src/utils/queryCategorySamplesWithAnchor.d.ts +0 -10
- package/lib/typescript/src/utils/queryCorrelationSamples.d.ts +0 -5
- package/lib/typescript/src/utils/queryHeartbeatSeriesSamples.d.ts +0 -10
- package/lib/typescript/src/utils/queryHeartbeatSeriesSamplesWithAnchor.d.ts +0 -10
- package/lib/typescript/src/utils/queryQuantitySamples.d.ts +0 -7
- package/lib/typescript/src/utils/queryQuantitySamplesWithAnchor.d.ts +0 -12
- package/lib/typescript/src/utils/querySources.d.ts +0 -4
- package/lib/typescript/src/utils/queryStateOfMindSamples.d.ts +0 -7
- package/lib/typescript/src/utils/queryStatisticsCollectionForQuantity.d.ts +0 -3
- package/lib/typescript/src/utils/queryStatisticsForQuantity.d.ts +0 -14
- package/lib/typescript/src/utils/queryWorkoutSamplesWithAnchor.d.ts +0 -9
- package/lib/typescript/src/utils/queryWorkouts.d.ts +0 -4
- package/lib/typescript/src/utils/requestAuthorization.d.ts +0 -4
- package/lib/typescript/src/utils/saveCategorySample.d.ts +0 -11
- package/lib/typescript/src/utils/saveCorrelationSample.d.ts +0 -8
- package/lib/typescript/src/utils/saveQuantitySample.d.ts +0 -7
- package/lib/typescript/src/utils/saveStateOfMindSample.d.ts +0 -11
- package/lib/typescript/src/utils/saveWorkoutRoute.d.ts +0 -3
- package/lib/typescript/src/utils/saveWorkoutSample.d.ts +0 -11
- package/lib/typescript/src/utils/serializeDate.d.ts +0 -2
- package/lib/typescript/src/utils/serializeDate.test.d.ts +0 -1
- package/lib/typescript/src/utils/startWatchApp.d.ts +0 -3
- package/lib/typescript/src/utils/subscribeToChanges.d.ts +0 -3
- package/src/index.ios.tsx +0 -292
- package/src/index.native.tsx +0 -233
- package/src/index.tsx +0 -5
- package/src/index.web.tsx +0 -5
- package/src/native-types.ts +0 -2471
- package/src/types.ts +0 -156
- package/src/utils/deleteQuantitySample.ts +0 -14
- package/src/utils/deleteSamples.ts +0 -23
- package/src/utils/deleteWorkoutSample.ts +0 -7
- package/src/utils/deserializeCategorySample.test.ts +0 -24
- package/src/utils/deserializeCategorySample.ts +0 -12
- package/src/utils/deserializeCorrelation.ts +0 -28
- package/src/utils/deserializeHeartbeatSeriesSample.ts +0 -12
- package/src/utils/deserializeSample.ts +0 -17
- package/src/utils/deserializeWorkout.ts +0 -14
- package/src/utils/ensureMetadata.ts +0 -5
- package/src/utils/ensureTotals.ts +0 -5
- package/src/utils/ensureUnit.ts +0 -19
- package/src/utils/getDateOfBirth.ts +0 -8
- package/src/utils/getPreferredUnits.ts +0 -14
- package/src/utils/getPreferredUnitsTyped.ts +0 -38
- package/src/utils/getRequestStatusForAuthorization.ts +0 -21
- package/src/utils/getWorkoutPlanById.ts +0 -7
- package/src/utils/prepareOptions.ts +0 -19
- package/src/utils/queryCategorySamples.ts +0 -29
- package/src/utils/queryCategorySamplesWithAnchor.ts +0 -39
- package/src/utils/queryCorrelationSamples.ts +0 -29
- package/src/utils/queryHeartbeatSeriesSamples.ts +0 -29
- package/src/utils/queryHeartbeatSeriesSamplesWithAnchor.ts +0 -33
- package/src/utils/queryQuantitySamples.ts +0 -38
- package/src/utils/queryQuantitySamplesWithAnchor.ts +0 -46
- package/src/utils/querySources.ts +0 -21
- package/src/utils/queryStateOfMindSamples.ts +0 -14
- package/src/utils/queryStatisticsCollectionForQuantity.ts +0 -38
- package/src/utils/queryStatisticsForQuantity.ts +0 -38
- package/src/utils/queryWorkoutSamplesWithAnchor.ts +0 -46
- package/src/utils/queryWorkouts.ts +0 -28
- package/src/utils/requestAuthorization.ts +0 -19
- package/src/utils/saveCategorySample.ts +0 -31
- package/src/utils/saveCorrelationSample.ts +0 -43
- package/src/utils/saveQuantitySample.ts +0 -29
- package/src/utils/saveStateOfMindSample.ts +0 -38
- package/src/utils/saveWorkoutRoute.ts +0 -21
- package/src/utils/saveWorkoutSample.ts +0 -42
- package/src/utils/serializeDate.test.ts +0 -16
- package/src/utils/serializeDate.ts +0 -5
- package/src/utils/startWatchApp.ts +0 -7
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
const ensureUnit = async (type, providedUnit) => {
|
|
3
|
-
if (providedUnit) {
|
|
4
|
-
return providedUnit;
|
|
5
|
-
}
|
|
6
|
-
const unit = await Native.getPreferredUnits([type]);
|
|
7
|
-
return unit[type];
|
|
8
|
-
};
|
|
9
|
-
export default ensureUnit;
|
|
10
|
-
//# sourceMappingURL=ensureUnit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
import queryCategorySamples from './queryCategorySamples';
|
|
2
|
-
async function getMostRecentCategorySample(identifier) {
|
|
3
|
-
const samples = await queryCategorySamples(identifier, {
|
|
4
|
-
limit: 1,
|
|
5
|
-
ascending: false
|
|
6
|
-
});
|
|
7
|
-
return samples[0] ?? null;
|
|
8
|
-
}
|
|
9
|
-
export default getMostRecentCategorySample;
|
|
10
|
-
//# sourceMappingURL=getMostRecentCategorySample.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import queryQuantitySamples from './queryQuantitySamples';
|
|
2
|
-
async function getMostRecentQuantitySample(identifier, unit) {
|
|
3
|
-
const samples = await queryQuantitySamples(identifier, {
|
|
4
|
-
limit: 1,
|
|
5
|
-
unit
|
|
6
|
-
});
|
|
7
|
-
const lastSample = samples[0];
|
|
8
|
-
if (lastSample) {
|
|
9
|
-
return lastSample;
|
|
10
|
-
}
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
export default getMostRecentQuantitySample;
|
|
14
|
-
//# sourceMappingURL=getMostRecentQuantitySample.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,12 +0,0 @@
|
|
|
1
|
-
import queryWorkouts from './queryWorkouts';
|
|
2
|
-
const getMostRecentWorkout = async options => {
|
|
3
|
-
const workouts = await queryWorkouts({
|
|
4
|
-
limit: 1,
|
|
5
|
-
ascending: false,
|
|
6
|
-
energyUnit: options === null || options === void 0 ? void 0 : options.energyUnit,
|
|
7
|
-
distanceUnit: options === null || options === void 0 ? void 0 : options.distanceUnit
|
|
8
|
-
});
|
|
9
|
-
return workouts[0] || null;
|
|
10
|
-
};
|
|
11
|
-
export default getMostRecentWorkout;
|
|
12
|
-
//# sourceMappingURL=getMostRecentWorkout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
const getPreferredUnits = async identifiers => {
|
|
3
|
-
const units = await Native.getPreferredUnits(identifiers);
|
|
4
|
-
return identifiers.map(i => units[i]);
|
|
5
|
-
};
|
|
6
|
-
export default getPreferredUnits;
|
|
7
|
-
//# sourceMappingURL=getPreferredUnits.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,26 +0,0 @@
|
|
|
1
|
-
import Native, { HKQuantityTypeIdentifier, UnitOfEnergy, UnitOfLength } from '../native-types';
|
|
2
|
-
async function getPreferredUnitsTyped(options) {
|
|
3
|
-
let energyUnit = options === null || options === void 0 ? void 0 : options.energyUnit;
|
|
4
|
-
let distanceUnit = options === null || options === void 0 ? void 0 : options.distanceUnit;
|
|
5
|
-
if (!energyUnit || !distanceUnit) {
|
|
6
|
-
const units = await Native.getPreferredUnits([HKQuantityTypeIdentifier.distanceWalkingRunning, HKQuantityTypeIdentifier.activeEnergyBurned]);
|
|
7
|
-
if (!energyUnit) {
|
|
8
|
-
energyUnit = units[HKQuantityTypeIdentifier.activeEnergyBurned];
|
|
9
|
-
}
|
|
10
|
-
if (!distanceUnit) {
|
|
11
|
-
distanceUnit = units[HKQuantityTypeIdentifier.distanceWalkingRunning];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
if (!energyUnit) {
|
|
15
|
-
energyUnit = UnitOfEnergy.Kilocalories;
|
|
16
|
-
}
|
|
17
|
-
if (!distanceUnit) {
|
|
18
|
-
distanceUnit = UnitOfLength.Meter;
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
energyUnit,
|
|
22
|
-
distanceUnit
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export default getPreferredUnitsTyped;
|
|
26
|
-
//# sourceMappingURL=getPreferredUnitsTyped.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
const getRequestStatusForAuthorization = async (read, write = []) => {
|
|
3
|
-
const readPermissions = read.reduce((obj, cur) => ({
|
|
4
|
-
...obj,
|
|
5
|
-
[cur]: true
|
|
6
|
-
}), {});
|
|
7
|
-
const writePermissions = write.reduce((obj, cur) => ({
|
|
8
|
-
...obj,
|
|
9
|
-
[cur]: true
|
|
10
|
-
}), {});
|
|
11
|
-
return Native.getRequestStatusForAuthorization(writePermissions, readPermissions);
|
|
12
|
-
};
|
|
13
|
-
export default getRequestStatusForAuthorization;
|
|
14
|
-
//# sourceMappingURL=getRequestStatusForAuthorization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import serializeDate from './serializeDate';
|
|
2
|
-
const prepareOptions = options => {
|
|
3
|
-
const limit = !options.limit || options.limit === Infinity ? 0 : options.limit;
|
|
4
|
-
const ascending = options.ascending ?? limit === 0;
|
|
5
|
-
// eslint-disable-next-line no-nested-ternary
|
|
6
|
-
const from = serializeDate(options.from ? options.from : limit > 0 ? new Date(0) : undefined);
|
|
7
|
-
const to = serializeDate(options.to);
|
|
8
|
-
const anchor = options.anchor ?? '';
|
|
9
|
-
return {
|
|
10
|
-
limit,
|
|
11
|
-
ascending,
|
|
12
|
-
from,
|
|
13
|
-
to,
|
|
14
|
-
anchor
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default prepareOptions;
|
|
18
|
-
//# sourceMappingURL=prepareOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
import deserializeCategorySample from './deserializeCategorySample';
|
|
2
|
-
import prepareOptions from './prepareOptions';
|
|
3
|
-
import Native from '../native-types';
|
|
4
|
-
const queryCategorySamples = async (identifier, options) => {
|
|
5
|
-
const opts = prepareOptions(options);
|
|
6
|
-
const raw = await Native.queryCategorySamples(identifier, opts.from, opts.to, opts.limit, opts.ascending);
|
|
7
|
-
return raw.map(deserializeCategorySample);
|
|
8
|
-
};
|
|
9
|
-
export default queryCategorySamples;
|
|
10
|
-
//# sourceMappingURL=queryCategorySamples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import deserializeCategorySample from './deserializeCategorySample';
|
|
2
|
-
import prepareOptions from './prepareOptions';
|
|
3
|
-
import Native from '../native-types';
|
|
4
|
-
const queryCategorySamplesWithAnchor = async (identifier, options) => {
|
|
5
|
-
const opts = prepareOptions(options);
|
|
6
|
-
const raw = await Native.queryCategorySamplesWithAnchor(identifier, opts.from, opts.to, opts.limit, opts.anchor);
|
|
7
|
-
return {
|
|
8
|
-
samples: raw.samples.map(deserializeCategorySample),
|
|
9
|
-
deletedSamples: raw.deletedSamples,
|
|
10
|
-
newAnchor: raw.newAnchor
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default queryCategorySamplesWithAnchor;
|
|
14
|
-
//# sourceMappingURL=queryCategorySamplesWithAnchor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deserializeCategorySample","prepareOptions","Native","queryCategorySamplesWithAnchor","identifier","options","opts","raw","from","to","limit","anchor","samples","map","deletedSamples","newAnchor"],"sources":["queryCategorySamplesWithAnchor.ts"],"sourcesContent":["import deserializeCategorySample from './deserializeCategorySample'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type { HKCategoryTypeIdentifier, DeletedCategorySampleRaw } from '../native-types'\nimport type { GenericQueryOptions, HKCategorySample } from '../types'\n\nexport type QueryCategorySamplesWithAnchorResponse<T extends HKCategoryTypeIdentifier> = {\n readonly samples: readonly HKCategorySample<T>[],\n readonly deletedSamples: readonly DeletedCategorySampleRaw<T>[],\n readonly newAnchor: string\n}\n\nexport type QueryCategorySamplesWithAnchorFn = <T extends HKCategoryTypeIdentifier>(\n identifier: T,\n options: Omit<GenericQueryOptions, 'ascending'>\n) => Promise<QueryCategorySamplesWithAnchorResponse<T>>;\n\nconst queryCategorySamplesWithAnchor: QueryCategorySamplesWithAnchorFn = async (\n identifier,\n options,\n) => {\n const opts = prepareOptions(options)\n const raw = await Native.queryCategorySamplesWithAnchor(\n identifier,\n opts.from,\n opts.to,\n opts.limit,\n opts.anchor,\n )\n\n return {\n samples: raw.samples.map(deserializeCategorySample),\n deletedSamples: raw.deletedSamples,\n newAnchor: raw.newAnchor,\n }\n}\n\nexport default queryCategorySamplesWithAnchor\n"],"mappings":"AAAA,OAAOA,yBAAyB,MAAM,6BAA6B;AACnE,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,yBAAyB,CAAC;IACnDc,cAAc,EAAEP,GAAG,CAACO,cAAc;IAClCC,SAAS,EAAER,GAAG,CAACQ;EACjB,CAAC;AACH,CAAC;AAED,eAAeZ,8BAA8B","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import deserializeCorrelation from './deserializeCorrelation';
|
|
2
|
-
import prepareOptions from './prepareOptions';
|
|
3
|
-
import Native from '../native-types';
|
|
4
|
-
const queryCorrelationSamples = async (typeIdentifier, options) => {
|
|
5
|
-
const opts = prepareOptions(options);
|
|
6
|
-
const correlations = await Native.queryCorrelationSamples(typeIdentifier, opts.from, opts.to);
|
|
7
|
-
return correlations.map(deserializeCorrelation);
|
|
8
|
-
};
|
|
9
|
-
export default queryCorrelationSamples;
|
|
10
|
-
//# sourceMappingURL=queryCorrelationSamples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
import deserializeHeartbeatSeriesSample from './deserializeHeartbeatSeriesSample';
|
|
2
|
-
import prepareOptions from './prepareOptions';
|
|
3
|
-
import Native from '../native-types';
|
|
4
|
-
const queryHeartbeatSeriesSamples = async options => {
|
|
5
|
-
const opts = prepareOptions(options);
|
|
6
|
-
const result = await Native.queryHeartbeatSeriesSamples(opts.from, opts.to, opts.limit, opts.ascending);
|
|
7
|
-
return result.map(deserializeHeartbeatSeriesSample);
|
|
8
|
-
};
|
|
9
|
-
export default queryHeartbeatSeriesSamples;
|
|
10
|
-
//# sourceMappingURL=queryHeartbeatSeriesSamples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import deserializeHeartbeatSeriesSample from './deserializeHeartbeatSeriesSample';
|
|
2
|
-
import prepareOptions from './prepareOptions';
|
|
3
|
-
import Native from '../native-types';
|
|
4
|
-
const queryHeartbeatSeriesSamplesWithAnchor = async options => {
|
|
5
|
-
const opts = prepareOptions(options);
|
|
6
|
-
const result = await Native.queryHeartbeatSeriesSamplesWithAnchor(opts.from, opts.to, opts.limit, opts.anchor);
|
|
7
|
-
return {
|
|
8
|
-
deletedSamples: result.deletedSamples,
|
|
9
|
-
newAnchor: result.newAnchor,
|
|
10
|
-
samples: result.samples.map(deserializeHeartbeatSeriesSample)
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default queryHeartbeatSeriesSamplesWithAnchor;
|
|
14
|
-
//# sourceMappingURL=queryHeartbeatSeriesSamplesWithAnchor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,12 +0,0 @@
|
|
|
1
|
-
import deserializeQuantitySample from './deserializeSample';
|
|
2
|
-
import ensureUnit from './ensureUnit';
|
|
3
|
-
import prepareOptions from './prepareOptions';
|
|
4
|
-
import Native from '../native-types';
|
|
5
|
-
const queryQuantitySamples = async (identifier, options) => {
|
|
6
|
-
const unit = await ensureUnit(identifier, options.unit);
|
|
7
|
-
const opts = prepareOptions(options);
|
|
8
|
-
const result = await Native.queryQuantitySamples(identifier, unit, opts.from, opts.to, opts.limit, opts.ascending);
|
|
9
|
-
return result.map(deserializeQuantitySample);
|
|
10
|
-
};
|
|
11
|
-
export default queryQuantitySamples;
|
|
12
|
-
//# sourceMappingURL=queryQuantitySamples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import deserializeQuantitySample from './deserializeSample';
|
|
2
|
-
import ensureUnit from './ensureUnit';
|
|
3
|
-
import prepareOptions from './prepareOptions';
|
|
4
|
-
import Native from '../native-types';
|
|
5
|
-
const queryQuantitySamplesWithAnchor = async (identifier, options) => {
|
|
6
|
-
const unit = await ensureUnit(identifier, options.unit);
|
|
7
|
-
const opts = prepareOptions(options);
|
|
8
|
-
const result = await Native.queryQuantitySamplesWithAnchor(identifier, unit, opts.from, opts.to, opts.limit, opts.anchor);
|
|
9
|
-
return {
|
|
10
|
-
deletedSamples: result.deletedSamples,
|
|
11
|
-
newAnchor: result.newAnchor,
|
|
12
|
-
samples: result.samples.map(deserializeQuantitySample)
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default queryQuantitySamplesWithAnchor;
|
|
16
|
-
//# sourceMappingURL=queryQuantitySamplesWithAnchor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
export const queryStateOfMindSamples = async ({
|
|
3
|
-
from,
|
|
4
|
-
to,
|
|
5
|
-
limit,
|
|
6
|
-
ascending
|
|
7
|
-
} = {}) => {
|
|
8
|
-
const fromString = (from || new Date(0)).toISOString();
|
|
9
|
-
const toString = (to || new Date(0)).toISOString();
|
|
10
|
-
const res = await Native.queryStateOfMindSamples(fromString, toString, limit ?? 0, ascending ?? false);
|
|
11
|
-
return res;
|
|
12
|
-
};
|
|
13
|
-
export default queryStateOfMindSamples;
|
|
14
|
-
//# sourceMappingURL=queryStateOfMindSamples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Native","queryStateOfMindSamples","from","to","limit","ascending","fromString","Date","toISOString","toString","res"],"sources":["queryStateOfMindSamples.ts"],"sourcesContent":["import Native from '../native-types'\n\nexport const queryStateOfMindSamples = async ({\n from, to, limit, ascending,\n}: { readonly from?: Date; readonly to?: Date; readonly limit?: number; readonly ascending?: boolean } = {}) => {\n const fromString = (from || new Date(0)).toISOString()\n const toString = (to || new Date(0)).toISOString()\n\n const res = await Native.queryStateOfMindSamples(fromString, toString, limit ?? 0, ascending ?? false)\n\n return res\n}\n\nexport default queryStateOfMindSamples\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,OAAO,MAAMC,uBAAuB,GAAG,MAAAA,CAAO;EAC5CC,IAAI;EAAEC,EAAE;EAAEC,KAAK;EAAEC;AACkF,CAAC,GAAG,CAAC,CAAC,KAAK;EAC9G,MAAMC,UAAU,GAAG,CAACJ,IAAI,IAAI,IAAIK,IAAI,CAAC,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EACtD,MAAMC,QAAQ,GAAG,CAACN,EAAE,IAAI,IAAII,IAAI,CAAC,CAAC,CAAC,EAAEC,WAAW,CAAC,CAAC;EAElD,MAAME,GAAG,GAAG,MAAMV,MAAM,CAACC,uBAAuB,CAACK,UAAU,EAAEG,QAAQ,EAAEL,KAAK,IAAI,CAAC,EAAEC,SAAS,IAAI,KAAK,CAAC;EAEtG,OAAOK,GAAG;AACZ,CAAC;AAED,eAAeT,uBAAuB","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import ensureUnit from './ensureUnit';
|
|
2
|
-
import Native from '../native-types';
|
|
3
|
-
async function queryStatisticsCollectionForQuantity(identifier, options, anchorDate, intervalComponents, startDate, endDate, unit) {
|
|
4
|
-
const actualUnit = await ensureUnit(identifier, unit);
|
|
5
|
-
const rawResponse = await Native.queryStatisticsCollectionForQuantity(identifier, actualUnit, options, anchorDate.toISOString(), intervalComponents, startDate.toISOString(), endDate.toISOString());
|
|
6
|
-
return rawResponse;
|
|
7
|
-
}
|
|
8
|
-
export default queryStatisticsCollectionForQuantity;
|
|
9
|
-
//# sourceMappingURL=queryStatisticsCollectionForQuantity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ensureUnit","Native","queryStatisticsCollectionForQuantity","identifier","options","anchorDate","intervalComponents","startDate","endDate","unit","actualUnit","rawResponse","toISOString"],"sources":["queryStatisticsCollectionForQuantity.ts"],"sourcesContent":["import ensureUnit from './ensureUnit'\nimport Native from '../native-types'\n\nimport type {\n HKQuantityTypeIdentifier,\n HKStatisticsOptions,\n UnitForIdentifier,\n IntervalComponents,\n} from '../native-types'\n\nasync function queryStatisticsCollectionForQuantity<\n TIdentifier extends HKQuantityTypeIdentifier,\n TUnit extends UnitForIdentifier<TIdentifier> = UnitForIdentifier<TIdentifier>\n>(\n identifier: TIdentifier,\n options: readonly HKStatisticsOptions[],\n anchorDate: Date,\n intervalComponents: IntervalComponents,\n startDate: Date,\n endDate: Date,\n unit?: TUnit,\n) {\n const actualUnit = await ensureUnit(identifier, unit)\n\n const rawResponse = await Native.queryStatisticsCollectionForQuantity(\n identifier,\n actualUnit,\n options,\n anchorDate.toISOString(),\n intervalComponents,\n startDate.toISOString(),\n endDate.toISOString(),\n )\n\n return rawResponse\n}\n\nexport default queryStatisticsCollectionForQuantity\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;AACrC,OAAOC,MAAM,MAAM,iBAAiB;AASpC,eAAeC,oCAAoCA,CAIjDC,UAAuB,EACvBC,OAAuC,EACvCC,UAAgB,EAChBC,kBAAsC,EACtCC,SAAe,EACfC,OAAa,EACbC,IAAY,EACZ;EACA,MAAMC,UAAU,GAAG,MAAMV,UAAU,CAACG,UAAU,EAAEM,IAAI,CAAC;EAErD,MAAME,WAAW,GAAG,MAAMV,MAAM,CAACC,oCAAoC,CACnEC,UAAU,EACVO,UAAU,EACVN,OAAO,EACPC,UAAU,CAACO,WAAW,CAAC,CAAC,EACxBN,kBAAkB,EAClBC,SAAS,CAACK,WAAW,CAAC,CAAC,EACvBJ,OAAO,CAACI,WAAW,CAAC,CACtB,CAAC;EAED,OAAOD,WAAW;AACpB;AAEA,eAAeT,oCAAoC","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import ensureUnit from './ensureUnit';
|
|
2
|
-
import Native from '../native-types';
|
|
3
|
-
async function queryStatisticsForQuantity(identifier, options, from, to, unit) {
|
|
4
|
-
const actualUnit = await ensureUnit(identifier, unit);
|
|
5
|
-
const toDate = to || new Date();
|
|
6
|
-
const {
|
|
7
|
-
mostRecentQuantityDateInterval,
|
|
8
|
-
...rawResponse
|
|
9
|
-
} = await Native.queryStatisticsForQuantity(identifier, actualUnit, from.toISOString(), toDate.toISOString(), options);
|
|
10
|
-
const response = {
|
|
11
|
-
...rawResponse,
|
|
12
|
-
...(mostRecentQuantityDateInterval ? {
|
|
13
|
-
mostRecentQuantityDateInterval: {
|
|
14
|
-
from: new Date(mostRecentQuantityDateInterval.from),
|
|
15
|
-
to: new Date(mostRecentQuantityDateInterval.to)
|
|
16
|
-
}
|
|
17
|
-
} : {})
|
|
18
|
-
};
|
|
19
|
-
return response;
|
|
20
|
-
}
|
|
21
|
-
export default queryStatisticsForQuantity;
|
|
22
|
-
//# sourceMappingURL=queryStatisticsForQuantity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,19 +0,0 @@
|
|
|
1
|
-
import deserializeWorkout from './deserializeWorkout';
|
|
2
|
-
import getPreferredUnitsTyped from './getPreferredUnitsTyped';
|
|
3
|
-
import prepareOptions from './prepareOptions';
|
|
4
|
-
import Native from '../native-types';
|
|
5
|
-
async function queryCategorySamplesWithAnchor(options) {
|
|
6
|
-
const opts = prepareOptions(options);
|
|
7
|
-
const {
|
|
8
|
-
energyUnit,
|
|
9
|
-
distanceUnit
|
|
10
|
-
} = await getPreferredUnitsTyped(options);
|
|
11
|
-
const raw = await Native.queryWorkoutSamplesWithAnchor(energyUnit, distanceUnit, opts.from, opts.to, opts.limit, opts.anchor);
|
|
12
|
-
return {
|
|
13
|
-
samples: raw.samples.map(deserializeWorkout),
|
|
14
|
-
deletedSamples: raw.deletedSamples,
|
|
15
|
-
newAnchor: raw.newAnchor
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export default queryCategorySamplesWithAnchor;
|
|
19
|
-
//# sourceMappingURL=queryWorkoutSamplesWithAnchor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deserializeWorkout","getPreferredUnitsTyped","prepareOptions","Native","queryCategorySamplesWithAnchor","options","opts","energyUnit","distanceUnit","raw","queryWorkoutSamplesWithAnchor","from","to","limit","anchor","samples","map","deletedSamples","newAnchor"],"sources":["queryWorkoutSamplesWithAnchor.ts"],"sourcesContent":["import deserializeWorkout from './deserializeWorkout'\nimport getPreferredUnitsTyped from './getPreferredUnitsTyped'\nimport prepareOptions from './prepareOptions'\nimport Native from '../native-types'\n\nimport type {\n EnergyUnit, LengthUnit,\n} from '../native-types'\nimport type {\n DeletedWorkoutSampleRaw, HKWorkout, QueryWorkoutsOptions,\n} from '../types'\n\nexport type QueryWorkoutSamplesWithAnchorResponse<\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n> = {\n readonly samples: readonly HKWorkout<TEnergy, TDistance>[],\n readonly deletedSamples: readonly DeletedWorkoutSampleRaw[],\n readonly newAnchor: string\n}\n\nasync function queryCategorySamplesWithAnchor<\n TEnergy extends EnergyUnit,\n TDistance extends LengthUnit\n>(\n options: Omit<QueryWorkoutsOptions<TEnergy, TDistance>, 'ascending'>,\n): Promise<QueryWorkoutSamplesWithAnchorResponse<TEnergy, TDistance>> {\n const opts = prepareOptions(options)\n const { energyUnit, distanceUnit } = await getPreferredUnitsTyped(options)\n const raw = await Native.queryWorkoutSamplesWithAnchor(\n energyUnit,\n distanceUnit,\n opts.from,\n opts.to,\n opts.limit,\n opts.anchor,\n )\n\n return {\n samples: raw.samples.map(deserializeWorkout),\n deletedSamples: raw.deletedSamples,\n newAnchor: raw.newAnchor,\n }\n}\n\nexport default queryCategorySamplesWithAnchor\n"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AAkBpC,eAAeC,8BAA8BA,CAI3CC,OAAoE,EACA;EACpE,MAAMC,IAAI,GAAGJ,cAAc,CAACG,OAAO,CAAC;EACpC,MAAM;IAAEE,UAAU;IAAEC;EAAa,CAAC,GAAG,MAAMP,sBAAsB,CAACI,OAAO,CAAC;EAC1E,MAAMI,GAAG,GAAG,MAAMN,MAAM,CAACO,6BAA6B,CACpDH,UAAU,EACVC,YAAY,EACZF,IAAI,CAACK,IAAI,EACTL,IAAI,CAACM,EAAE,EACPN,IAAI,CAACO,KAAK,EACVP,IAAI,CAACQ,MACP,CAAC;EAED,OAAO;IACLC,OAAO,EAAEN,GAAG,CAACM,OAAO,CAACC,GAAG,CAAChB,kBAAkB,CAAC;IAC5CiB,cAAc,EAAER,GAAG,CAACQ,cAAc;IAClCC,SAAS,EAAET,GAAG,CAACS;EACjB,CAAC;AACH;AAEA,eAAed,8BAA8B","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import deserializeWorkout from './deserializeWorkout';
|
|
2
|
-
import getPreferredUnitsTyped from './getPreferredUnitsTyped';
|
|
3
|
-
import prepareOptions from './prepareOptions';
|
|
4
|
-
import Native from '../native-types';
|
|
5
|
-
async function queryWorkouts(options) {
|
|
6
|
-
const {
|
|
7
|
-
energyUnit,
|
|
8
|
-
distanceUnit
|
|
9
|
-
} = await getPreferredUnitsTyped(options);
|
|
10
|
-
const opts = prepareOptions(options);
|
|
11
|
-
const workouts = await Native.queryWorkoutSamples(energyUnit, distanceUnit, opts.from, opts.to, opts.limit, opts.ascending);
|
|
12
|
-
return workouts.map(deserializeWorkout);
|
|
13
|
-
}
|
|
14
|
-
export default queryWorkouts;
|
|
15
|
-
//# sourceMappingURL=queryWorkouts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,15 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
/** See https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorization */
|
|
3
|
-
const requestAuthorization = async (read, write = []) => {
|
|
4
|
-
const readPermissions = read.reduce((obj, cur) => ({
|
|
5
|
-
...obj,
|
|
6
|
-
[cur]: true
|
|
7
|
-
}), {});
|
|
8
|
-
const writePermissions = write.reduce((obj, cur) => ({
|
|
9
|
-
...obj,
|
|
10
|
-
[cur]: true
|
|
11
|
-
}), {});
|
|
12
|
-
return Native.requestAuthorization(writePermissions, readPermissions);
|
|
13
|
-
};
|
|
14
|
-
export default requestAuthorization;
|
|
15
|
-
//# sourceMappingURL=requestAuthorization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,13 +0,0 @@
|
|
|
1
|
-
import Native from '../native-types';
|
|
2
|
-
/**
|
|
3
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/hkhealthstore/1614168-savecategorysample save(_:withCompletion:) (Apple Docs)}
|
|
4
|
-
* @see {@link https://developer.apple.com/documentation/healthkit/saving_data_to_healthkit Saving data to HealthKit (Apple Docs)}
|
|
5
|
-
*/
|
|
6
|
-
async function saveCategorySample(identifier, value, options) {
|
|
7
|
-
const start = (options === null || options === void 0 ? void 0 : options.start) || (options === null || options === void 0 ? void 0 : options.end) || new Date();
|
|
8
|
-
const end = (options === null || options === void 0 ? void 0 : options.end) || (options === null || options === void 0 ? void 0 : options.start) || new Date();
|
|
9
|
-
const metadata = (options === null || options === void 0 ? void 0 : options.metadata) || {};
|
|
10
|
-
return Native.saveCategorySample(identifier, value, start.toISOString(), end.toISOString(), metadata || {});
|
|
11
|
-
}
|
|
12
|
-
export default saveCategorySample;
|
|
13
|
-
//# sourceMappingURL=saveCategorySample.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|