hypertrack-sdk-react-native 11.0.9 → 11.0.11

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 (33) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/checksums/checksums.lock +0 -0
  5. package/android/gradle.properties +1 -1
  6. package/hypertrack-sdk-react-native.podspec +1 -1
  7. package/lib/commonjs/HyperTrack/HyperTrack.js +4 -6
  8. package/lib/commonjs/HyperTrack/HyperTrack.js.map +1 -1
  9. package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js +1 -2
  10. package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js.map +1 -1
  11. package/lib/commonjs/index.js +1 -2
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/module/HyperTrack/HyperTrack.js +4 -6
  14. package/lib/module/HyperTrack/HyperTrack.js.map +1 -1
  15. package/lib/typescript/HyperTrack/HyperTrack.d.ts +2 -1
  16. package/package.json +4 -4
  17. package/src/HyperTrack/HyperTrack.ts +2 -1
  18. package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  19. package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
  20. package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
  21. package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
  22. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  23. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  24. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  25. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  26. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  27. package/android/.idea/compiler.xml +0 -6
  28. package/android/.idea/gradle.xml +0 -19
  29. package/android/.idea/jarRepositories.xml +0 -35
  30. package/android/.idea/kotlinc.xml +0 -6
  31. package/android/.idea/misc.xml +0 -9
  32. package/android/.idea/vcs.xml +0 -6
  33. package/android/local.properties +0 -8
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [11.0.11] - 2023-12-11
7
+
8
+ ### Changed
9
+
10
+ - Updated HyperTrack Android SDK to [7.0.10](https://github.com/hypertrack/sdk-android/releases/tag/7.0.10)
11
+ - Updated HyperTrack iOS SDK to [5.0.8](https://github.com/hypertrack/sdk-ios/releases/tag/5.0.8)
12
+
13
+
14
+ ## [11.0.10] - 2023-11-20
15
+
16
+ ### Changed
17
+
18
+ - Updated HyperTrack Android SDK to [7.0.9](https://github.com/hypertrack/sdk-android/releases/tag/7.0.9)
19
+ - Updated HyperTrack iOS SDK to [5.0.7](https://github.com/hypertrack/sdk-ios/releases/tag/5.0.7)
20
+
6
21
  ## [11.0.9] - 2023-11-10
7
22
 
8
23
  ### Changed
@@ -714,3 +729,5 @@ Initial release.
714
729
  [11.0.7]: https://github.com/hypertrack/sdk-react-native/releases/tag/11.0.7
715
730
  [11.0.8]: https://github.com/hypertrack/sdk-react-native/releases/tag/11.0.8
716
731
  [11.0.9]: https://github.com/hypertrack/sdk-react-native/releases/tag/11.0.9
732
+ [11.0.10]: https://github.com/hypertrack/sdk-react-native/releases/tag/11.0.10
733
+ [11.0.11]: https://github.com/hypertrack/sdk-react-native/releases/tag/11.0.11
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  [![GitHub](https://img.shields.io/github/license/hypertrack/sdk-react-native?color=orange)](./LICENSE)
4
4
  [![npm](https://img.shields.io/npm/v/hypertrack-sdk-react-native.svg)](https://www.npmjs.com/package/hypertrack-sdk-react-native)
5
- [![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.0.6-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
6
- [![Android SDK](https://img.shields.io/badge/Android%20SDK-7.0.8-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
5
+ [![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.0.8-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
6
+ [![Android SDK](https://img.shields.io/badge/Android%20SDK-7.0.10-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
7
7
 
8
8
  [HyperTrack](https://www.hypertrack.com) lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.
9
9
 
@@ -1,3 +1,3 @@
1
1
  HyperTrackSdk_kotlinVersion=1.6.21
2
- HyperTrackSdk_HyperTrackSDKVersion=7.0.8
2
+ HyperTrackSdk_HyperTrackSDKVersion=7.0.10
3
3
  android.useAndroidX=true
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
18
18
  s.source_files = "ios/**/*.{h,m,mm,swift}"
19
19
 
20
20
  s.dependency "React-Core"
21
- s.dependency 'HyperTrack', '5.0.6'
21
+ s.dependency 'HyperTrack', '5.0.8'
22
22
 
23
23
  # Don't install the dependencies when we run `pod install` in the old architecture.
24
24
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
@@ -40,10 +40,7 @@ class HyperTrack {
40
40
  * @returns location with deviation if success or LocationError if failure
41
41
  */
42
42
 
43
- static async addGeotag() {
44
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
45
- args[_key] = arguments[_key];
46
- }
43
+ static async addGeotag(...args) {
47
44
  if (args.length === 1 && typeof args[0] === 'object') {
48
45
  return HyperTrackSdk.addGeotag({
49
46
  data: args[0],
@@ -151,7 +148,8 @@ class HyperTrack {
151
148
  *
152
149
  * @param callback
153
150
  * @returns EmitterSubscription
154
- * @example ```js
151
+ * @example
152
+ * ```js
155
153
  * const subscription = HyperTrack.locate(location => {
156
154
  * ...
157
155
  * })
@@ -162,7 +160,7 @@ class HyperTrack {
162
160
  */
163
161
  static locate(callback) {
164
162
  var _this$locateSubscript;
165
- (_this$locateSubscript = this.locateSubscription) === null || _this$locateSubscript === void 0 ? void 0 : _this$locateSubscript.remove();
163
+ (_this$locateSubscript = this.locateSubscription) === null || _this$locateSubscript === void 0 || _this$locateSubscript.remove();
166
164
  this.locateSubscription = EventEmitter.addListener(EVENT_LOCATE, location => {
167
165
  callback(this.deserializeLocateResponse(location));
168
166
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_HyperTrackError","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","EVENT_ERRORS","EVENT_IS_AVAILABLE","EVENT_IS_TRACKING","EVENT_LOCATE","EVENT_LOCATION","LINKING_ERROR","Platform","select","ios","default","HyperTrackSdk","NativeModules","HyperTrackReactNativePlugin","Proxy","get","Error","EventEmitter","NativeEventEmitter","HyperTrack","addGeotag","_len","arguments","length","args","Array","_key","data","expectedLocation","then","locationResponse","deserializeLocationResponse","isLocation","type","latitude","longitude","deserializeLocationWithDeviationResponse","getDeviceId","deviceId","getErrors","errors","deserializeHyperTrackErrors","getIsAvailable","isAvailable","getIsTracking","isTracking","getLocation","getMetadata","metadata","deserializeMetadata","getName","name","deserializeName","locate","callback","_this$locateSubscript","locateSubscription","remove","addListener","location","deserializeLocateResponse","setIsAvailable","setIsTracking","setMetadata","setName","subscribeToErrors","listener","rawErrors","subscribeToIsAvailable","subscribeToIsTracking","subscribeToLocation","map","error","keys","HyperTrackError","find","response","deserializeLocationError","locationError","locationWithDeviationInternal","locationInternal","deviation","JSON","stringify","exports"],"sources":["HyperTrack.ts"],"sourcesContent":["import {\n NativeModules,\n Platform,\n NativeEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { HyperTrackError } from './data_types/HyperTrackError';\nimport type { IsAvailable } from './data_types/internal/IsAvailable';\nimport type { IsTracking } from './data_types/internal/IsTracking';\nimport type { Location } from './data_types/Location';\nimport type { LocationError } from './data_types/LocationError';\nimport type { DeviceId } from './data_types/internal/DeviceId';\nimport type { GeotagData } from './data_types/internal/GeotagData';\nimport type { Name } from './data_types/internal/Name';\nimport type { HyperTrackErrorInternal } from './data_types/internal/HyperTrackErrorInternal';\nimport type { LocationWithDeviation } from './data_types/LocationWithDeviation';\nimport type { LocationErrorInternal } from './data_types/internal/LocationErrorInternal';\nimport type { Result } from './data_types/Result';\nimport type { LocationInternal } from './data_types/internal/LocationInternal';\nimport type { LocationWithDeviationInternal } from './data_types/internal/LocationWithDeviationInternal';\nimport type { Metadata } from './data_types/internal/Metadata';\n\nconst EVENT_ERRORS = 'errors';\nconst EVENT_IS_AVAILABLE = 'isAvailable';\nconst EVENT_IS_TRACKING = 'isTracking';\nconst EVENT_LOCATE = 'locate';\nconst EVENT_LOCATION = 'location';\n\nconst LINKING_ERROR =\n `The package 'hypertrack-sdk-react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperTrackSdk = NativeModules.HyperTrackReactNativePlugin\n ? NativeModules.HyperTrackReactNativePlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nconst EventEmitter = new NativeEventEmitter(HyperTrackSdk);\n\nexport default class HyperTrack {\n private static locateSubscription: EmitterSubscription | undefined;\n\n /**\n * Adds a new geotag\n *\n * @param {Object} data - Geotad data JSON\n * @returns current location if success or LocationError if failure\n */\n static async addGeotag(\n data: Object\n ): Promise<Result<Location, LocationError>>;\n\n /**\n * Adds a new geotag with expected location\n *\n * @param {Object} data - Geotad data JSON\n * @param {Location} expectedLocation - Expected location\n * @returns location with deviation if success or LocationError if failure\n */\n static async addGeotag(\n data: Object,\n expectedLocation: Location\n ): Promise<Result<LocationWithDeviation, LocationError>>;\n\n static async addGeotag(\n ...args: any[]\n ): Promise<Result<Location | LocationWithDeviation, LocationError>> {\n if (args.length === 1 && typeof args[0] === 'object') {\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: undefined,\n } as GeotagData).then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n } else if (\n args.length === 2 &&\n typeof args[0] === 'object' &&\n HyperTrack.isLocation(args[1])\n ) {\n let expectedLocation = args[1] as Location;\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: {\n type: 'location',\n value: {\n latitude: expectedLocation.latitude,\n longitude: expectedLocation.longitude,\n },\n } as LocationInternal,\n } as GeotagData).then(\n (\n locationResponse: Result<\n LocationWithDeviationInternal,\n LocationErrorInternal\n >\n ) => {\n return this.deserializeLocationWithDeviationResponse(\n locationResponse\n );\n }\n );\n } else {\n throw new Error('Invalid arguments');\n }\n }\n\n /**\n * Returns a string that is used to uniquely identify the device\n *\n * @returns {string} Device ID\n */\n static async getDeviceId(): Promise<string> {\n return HyperTrackSdk.getDeviceId().then(\n (deviceId: DeviceId) => deviceId.value\n );\n }\n\n /**\n * Returns a list of errors that blocks SDK from tracking\n *\n * @returns {HyperTrackError[]} List of errors\n */\n static async getErrors(): Promise<HyperTrackError[]> {\n return HyperTrackSdk.getErrors().then(\n (errors: HyperTrackErrorInternal[]) => {\n return this.deserializeHyperTrackErrors(errors);\n }\n );\n }\n\n /**\n * Reflects availability of the device for the Nearby search\n *\n * @returns true when is available or false when unavailable\n */\n static async getIsAvailable(): Promise<boolean> {\n return HyperTrackSdk.getIsAvailable().then(\n (isAvailable: IsAvailable) => isAvailable.value\n );\n }\n\n /**\n * Reflects the tracking intent for the device\n *\n * @returns {boolean} Whether the user's movement data is getting tracked or not.\n */\n static async getIsTracking(): Promise<boolean> {\n return HyperTrackSdk.getIsTracking().then(\n (isTracking: IsTracking) => isTracking.value\n );\n }\n\n /**\n * Reflects the current location of the user or an outage reason\n */\n static async getLocation(): Promise<Result<Location, LocationError>> {\n return HyperTrackSdk.getLocation().then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n }\n\n /**\n * Gets the metadata that is set for the device\n *\n * @returns {Object} Metadata JSON\n */\n static async getMetadata(): Promise<Object> {\n return HyperTrackSdk.getMetadata().then((metadata: Metadata) => {\n return this.deserializeMetadata(metadata);\n });\n }\n\n /**\n * Gets the name that is set for the device\n *\n * @returns {string} Device name\n */\n static async getName(): Promise<string> {\n return HyperTrackSdk.getName().then((name: Name) => {\n return this.deserializeName(name);\n });\n }\n\n /**\n * Requests one-time location update and returns the location once it is available, or error.\n *\n * Only one locate subscription can be active at a time. If you re-subscribe, the old EmitterSubscription\n * will be automaticaly removed.\n *\n * This method will start location tracking if called, and will stop it when the location is received or\n * the subscription is cancelled. If any other tracking intent is present (e.g. isAvailable is set to `true`),\n * the tracking will not be stopped.\n *\n * @param callback\n * @returns EmitterSubscription\n * @example ```js\n * const subscription = HyperTrack.locate(location => {\n * ...\n * })\n *\n * // to unsubscribe\n * subscription.remove()\n * ```\n */\n static locate(\n callback: (location: Result<Location, HyperTrackError[]>) => void\n ) {\n this.locateSubscription?.remove();\n this.locateSubscription = EventEmitter.addListener(\n EVENT_LOCATE,\n (location: Result<LocationInternal, HyperTrackErrorInternal[]>) => {\n callback(this.deserializeLocateResponse(location));\n }\n );\n HyperTrackSdk.locate();\n return this.locateSubscription;\n }\n\n /**\n * Sets the availability of the device for the Nearby search\n *\n * @param availability true when is available or false when unavailable\n */\n static async setIsAvailable(isAvailable: boolean) {\n HyperTrackSdk.setIsAvailable({\n type: 'isAvailable',\n value: isAvailable,\n } as IsAvailable);\n }\n\n /**\n * Sets the tracking intent for the device\n *\n * @param {boolean} isTracking\n */\n static async setIsTracking(isTracking: boolean): Promise<void> {\n HyperTrackSdk.setIsTracking({\n type: 'isTracking',\n value: isTracking,\n } as IsTracking);\n }\n\n /**\n * Sets the metadata for the device\n *\n * @param {Object} data - Metadata JSON\n */\n static async setMetadata(data: Object) {\n HyperTrackSdk.setMetadata({\n type: 'metadata',\n value: data,\n });\n }\n\n /**\n * Sets the name for the device\n *\n * @param {string} name\n */\n static async setName(name: string) {\n HyperTrackSdk.setName({\n type: 'name',\n value: name,\n } as Name);\n }\n\n /**\n * Subscribe to tracking errors\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToErrors(errors => {\n * errors.forEach(error => {\n * // ... error\n * })\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToErrors(\n listener: (errors: HyperTrackError[]) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_ERRORS,\n (rawErrors: HyperTrackErrorInternal[]) => {\n listener(this.deserializeHyperTrackErrors(rawErrors));\n }\n );\n }\n\n /**\n * Subscribe to availability changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsAvailable(isAvailable => {\n * if (isAvailable) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsAvailable(\n listener: (isAvailable: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_AVAILABLE,\n (isAvailable: IsAvailable) => {\n listener(isAvailable.value);\n }\n );\n }\n\n /**\n * Subscribe to tracking intent changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsTracking(isTracking => {\n * if (isTracking) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsTracking(\n listener: (isTracking: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_TRACKING,\n (isTracking: IsTracking) => {\n listener(isTracking.value);\n }\n );\n }\n\n /**\n * Subscribe to location changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToLocation(location => {\n * ...\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToLocation(\n listener: (location: Result<Location, LocationError>) => void\n ) {\n return EventEmitter.addListener(\n EVENT_LOCATION,\n (location: Result<LocationInternal, LocationErrorInternal>) => {\n listener(this.deserializeLocationResponse(location));\n }\n );\n }\n\n /** @ignore */\n private static deserializeHyperTrackErrors(\n errors: HyperTrackErrorInternal[]\n ): HyperTrackError[] {\n let res = errors.map((error: HyperTrackErrorInternal) => {\n if (error.type != 'error') {\n throw new Error('Invalid error type');\n }\n return Object.keys(HyperTrackError).find(\n (key) =>\n HyperTrackError[key as keyof typeof HyperTrackError] === error.value\n ) as HyperTrackError;\n });\n return res;\n }\n\n /** @ignore */\n private static deserializeLocateResponse(\n response: Result<LocationInternal, HyperTrackErrorInternal[]>\n ): Result<Location, HyperTrackError[]> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeHyperTrackErrors(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationError(\n locationError: LocationErrorInternal\n ): LocationError {\n switch (locationError.type) {\n case 'notRunning':\n case 'starting':\n return locationError;\n case 'errors':\n return {\n type: 'errors',\n value: this.deserializeHyperTrackErrors(locationError.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationResponse(\n response: Result<LocationInternal, LocationErrorInternal>\n ): Result<Location, LocationError> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationWithDeviationResponse(\n response: Result<LocationWithDeviationInternal, LocationErrorInternal>\n ): Result<LocationWithDeviation, LocationError> {\n switch (response.type) {\n case 'success':\n const locationWithDeviationInternal: LocationWithDeviationInternal =\n response.value;\n const locationInternal: LocationInternal =\n locationWithDeviationInternal.value.location;\n\n return {\n type: 'success',\n value: {\n location: locationInternal.value,\n deviation: locationWithDeviationInternal.value.deviation,\n } as LocationWithDeviation,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeMetadata(metadata: Metadata): Object {\n if (metadata.type != 'metadata') {\n throw new Error(`Invalid metadata: ${JSON.stringify(metadata)}`);\n }\n return metadata.value;\n }\n\n /** @ignore */\n private static deserializeName(name: Name): string {\n if (name.type != 'name') {\n throw new Error(`Invalid name: ${JSON.stringify(name)}`);\n }\n return name.value;\n }\n\n /** @ignore */\n private static isLocation(obj: Location): obj is Location {\n return (\n 'latitude' in obj &&\n typeof obj.latitude == 'number' &&\n 'longitude' in obj &&\n typeof obj.longitude == 'number'\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,OAAA;AAA+D,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4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A6B,CAAClG,KAAK,CAACoG;UACjD;QACF,CAAC;MACH,KAAK,SAAS;QACZ,OAAO;UACLhD,IAAI,EAAE,SAAS;UACfpD,KAAK,EAAE,IAAI,CAACgG,wBAAwB,CAACD,QAAQ,CAAC/F,KAAK;QACrD,CAAC;IACL;EACF;;EAEA;EACA,OAAeoE,mBAAmBA,CAACD,QAAkB,EAAU;IAC7D,IAAIA,QAAQ,CAACf,IAAI,IAAI,UAAU,EAAE;MAC/B,MAAM,IAAIjB,KAAK,CAAE,qBAAoBkE,IAAI,CAACC,SAAS,CAACnC,QAAQ,CAAE,EAAC,CAAC;IAClE;IACA,OAAOA,QAAQ,CAACnE,KAAK;EACvB;;EAEA;EACA,OAAeuE,eAAeA,CAACD,IAAU,EAAU;IACjD,IAAIA,IAAI,CAAClB,IAAI,IAAI,MAAM,EAAE;MACvB,MAAM,IAAIjB,KAAK,CAAE,iBAAgBkE,IAAI,CAACC,SAAS,CAAChC,IAAI,CAAE,EAAC,CAAC;IAC1D;IACA,OAAOA,IAAI,CAACtE,KAAK;EACnB;;EAEA;EACA,OAAemD,UAAUA,CAACrD,GAAa,EAAmB;IACxD,OACE,UAAU,IAAIA,GAAG,IACjB,OAAOA,GAAG,CAACuD,QAAQ,IAAI,QAAQ,IAC/B,WAAW,IAAIvD,GAAG,IAClB,OAAOA,GAAG,CAACwD,SAAS,IAAI,QAAQ;EAEpC;AACF;AAACiD,OAAA,CAAA1E,OAAA,GAAAS,UAAA;AAAAzC,eAAA,CA5coByC,UAAU"}
1
+ {"version":3,"names":["_reactNative","require","_HyperTrackError","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","EVENT_ERRORS","EVENT_IS_AVAILABLE","EVENT_IS_TRACKING","EVENT_LOCATE","EVENT_LOCATION","LINKING_ERROR","Platform","select","ios","default","HyperTrackSdk","NativeModules","HyperTrackReactNativePlugin","Proxy","get","Error","EventEmitter","NativeEventEmitter","HyperTrack","addGeotag","args","length","data","expectedLocation","then","locationResponse","deserializeLocationResponse","isLocation","type","latitude","longitude","deserializeLocationWithDeviationResponse","getDeviceId","deviceId","getErrors","errors","deserializeHyperTrackErrors","getIsAvailable","isAvailable","getIsTracking","isTracking","getLocation","getMetadata","metadata","deserializeMetadata","getName","name","deserializeName","locate","callback","_this$locateSubscript","locateSubscription","remove","addListener","location","deserializeLocateResponse","setIsAvailable","setIsTracking","setMetadata","setName","subscribeToErrors","listener","rawErrors","subscribeToIsAvailable","subscribeToIsTracking","subscribeToLocation","map","error","keys","HyperTrackError","find","response","deserializeLocationError","locationError","locationWithDeviationInternal","locationInternal","deviation","JSON","stringify","exports"],"sources":["HyperTrack.ts"],"sourcesContent":["import {\n NativeModules,\n Platform,\n NativeEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { HyperTrackError } from './data_types/HyperTrackError';\nimport type { IsAvailable } from './data_types/internal/IsAvailable';\nimport type { IsTracking } from './data_types/internal/IsTracking';\nimport type { Location } from './data_types/Location';\nimport type { LocationError } from './data_types/LocationError';\nimport type { DeviceId } from './data_types/internal/DeviceId';\nimport type { GeotagData } from './data_types/internal/GeotagData';\nimport type { Name } from './data_types/internal/Name';\nimport type { HyperTrackErrorInternal } from './data_types/internal/HyperTrackErrorInternal';\nimport type { LocationWithDeviation } from './data_types/LocationWithDeviation';\nimport type { LocationErrorInternal } from './data_types/internal/LocationErrorInternal';\nimport type { Result } from './data_types/Result';\nimport type { LocationInternal } from './data_types/internal/LocationInternal';\nimport type { LocationWithDeviationInternal } from './data_types/internal/LocationWithDeviationInternal';\nimport type { Metadata } from './data_types/internal/Metadata';\n\nconst EVENT_ERRORS = 'errors';\nconst EVENT_IS_AVAILABLE = 'isAvailable';\nconst EVENT_IS_TRACKING = 'isTracking';\nconst EVENT_LOCATE = 'locate';\nconst EVENT_LOCATION = 'location';\n\nconst LINKING_ERROR =\n `The package 'hypertrack-sdk-react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperTrackSdk = NativeModules.HyperTrackReactNativePlugin\n ? NativeModules.HyperTrackReactNativePlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nconst EventEmitter = new NativeEventEmitter(HyperTrackSdk);\n\nexport default class HyperTrack {\n private static locateSubscription: EmitterSubscription | undefined;\n\n /**\n * Adds a new geotag\n *\n * @param {Object} data - Geotad data JSON\n * @returns current location if success or LocationError if failure\n */\n static async addGeotag(\n data: Object\n ): Promise<Result<Location, LocationError>>;\n\n /**\n * Adds a new geotag with expected location\n *\n * @param {Object} data - Geotad data JSON\n * @param {Location} expectedLocation - Expected location\n * @returns location with deviation if success or LocationError if failure\n */\n static async addGeotag(\n data: Object,\n expectedLocation: Location\n ): Promise<Result<LocationWithDeviation, LocationError>>;\n\n static async addGeotag(\n ...args: any[]\n ): Promise<Result<Location | LocationWithDeviation, LocationError>> {\n if (args.length === 1 && typeof args[0] === 'object') {\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: undefined,\n } as GeotagData).then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n } else if (\n args.length === 2 &&\n typeof args[0] === 'object' &&\n HyperTrack.isLocation(args[1])\n ) {\n let expectedLocation = args[1] as Location;\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: {\n type: 'location',\n value: {\n latitude: expectedLocation.latitude,\n longitude: expectedLocation.longitude,\n },\n } as LocationInternal,\n } as GeotagData).then(\n (\n locationResponse: Result<\n LocationWithDeviationInternal,\n LocationErrorInternal\n >\n ) => {\n return this.deserializeLocationWithDeviationResponse(\n locationResponse\n );\n }\n );\n } else {\n throw new Error('Invalid arguments');\n }\n }\n\n /**\n * Returns a string that is used to uniquely identify the device\n *\n * @returns {string} Device ID\n */\n static async getDeviceId(): Promise<string> {\n return HyperTrackSdk.getDeviceId().then(\n (deviceId: DeviceId) => deviceId.value\n );\n }\n\n /**\n * Returns a list of errors that blocks SDK from tracking\n *\n * @returns {HyperTrackError[]} List of errors\n */\n static async getErrors(): Promise<HyperTrackError[]> {\n return HyperTrackSdk.getErrors().then(\n (errors: HyperTrackErrorInternal[]) => {\n return this.deserializeHyperTrackErrors(errors);\n }\n );\n }\n\n /**\n * Reflects availability of the device for the Nearby search\n *\n * @returns true when is available or false when unavailable\n */\n static async getIsAvailable(): Promise<boolean> {\n return HyperTrackSdk.getIsAvailable().then(\n (isAvailable: IsAvailable) => isAvailable.value\n );\n }\n\n /**\n * Reflects the tracking intent for the device\n *\n * @returns {boolean} Whether the user's movement data is getting tracked or not.\n */\n static async getIsTracking(): Promise<boolean> {\n return HyperTrackSdk.getIsTracking().then(\n (isTracking: IsTracking) => isTracking.value\n );\n }\n\n /**\n * Reflects the current location of the user or an outage reason\n */\n static async getLocation(): Promise<Result<Location, LocationError>> {\n return HyperTrackSdk.getLocation().then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n }\n\n /**\n * Gets the metadata that is set for the device\n *\n * @returns {Object} Metadata JSON\n */\n static async getMetadata(): Promise<Object> {\n return HyperTrackSdk.getMetadata().then((metadata: Metadata) => {\n return this.deserializeMetadata(metadata);\n });\n }\n\n /**\n * Gets the name that is set for the device\n *\n * @returns {string} Device name\n */\n static async getName(): Promise<string> {\n return HyperTrackSdk.getName().then((name: Name) => {\n return this.deserializeName(name);\n });\n }\n\n /**\n * Requests one-time location update and returns the location once it is available, or error.\n *\n * Only one locate subscription can be active at a time. If you re-subscribe, the old EmitterSubscription\n * will be automaticaly removed.\n *\n * This method will start location tracking if called, and will stop it when the location is received or\n * the subscription is cancelled. If any other tracking intent is present (e.g. isAvailable is set to `true`),\n * the tracking will not be stopped.\n *\n * @param callback\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.locate(location => {\n * ...\n * })\n *\n * // to unsubscribe\n * subscription.remove()\n * ```\n */\n static locate(\n callback: (location: Result<Location, HyperTrackError[]>) => void\n ) {\n this.locateSubscription?.remove();\n this.locateSubscription = EventEmitter.addListener(\n EVENT_LOCATE,\n (location: Result<LocationInternal, HyperTrackErrorInternal[]>) => {\n callback(this.deserializeLocateResponse(location));\n }\n );\n HyperTrackSdk.locate();\n return this.locateSubscription;\n }\n\n /**\n * Sets the availability of the device for the Nearby search\n *\n * @param availability true when is available or false when unavailable\n */\n static async setIsAvailable(isAvailable: boolean) {\n HyperTrackSdk.setIsAvailable({\n type: 'isAvailable',\n value: isAvailable,\n } as IsAvailable);\n }\n\n /**\n * Sets the tracking intent for the device\n *\n * @param {boolean} isTracking\n */\n static async setIsTracking(isTracking: boolean): Promise<void> {\n HyperTrackSdk.setIsTracking({\n type: 'isTracking',\n value: isTracking,\n } as IsTracking);\n }\n\n /**\n * Sets the metadata for the device\n *\n * @param {Object} data - Metadata JSON\n */\n static async setMetadata(data: Object) {\n HyperTrackSdk.setMetadata({\n type: 'metadata',\n value: data,\n });\n }\n\n /**\n * Sets the name for the device\n *\n * @param {string} name\n */\n static async setName(name: string) {\n HyperTrackSdk.setName({\n type: 'name',\n value: name,\n } as Name);\n }\n\n /**\n * Subscribe to tracking errors\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToErrors(errors => {\n * errors.forEach(error => {\n * // ... error\n * })\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToErrors(\n listener: (errors: HyperTrackError[]) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_ERRORS,\n (rawErrors: HyperTrackErrorInternal[]) => {\n listener(this.deserializeHyperTrackErrors(rawErrors));\n }\n );\n }\n\n /**\n * Subscribe to availability changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsAvailable(isAvailable => {\n * if (isAvailable) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsAvailable(\n listener: (isAvailable: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_AVAILABLE,\n (isAvailable: IsAvailable) => {\n listener(isAvailable.value);\n }\n );\n }\n\n /**\n * Subscribe to tracking intent changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsTracking(isTracking => {\n * if (isTracking) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsTracking(\n listener: (isTracking: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_TRACKING,\n (isTracking: IsTracking) => {\n listener(isTracking.value);\n }\n );\n }\n\n /**\n * Subscribe to location changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToLocation(location => {\n * ...\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToLocation(\n listener: (location: Result<Location, LocationError>) => void\n ) {\n return EventEmitter.addListener(\n EVENT_LOCATION,\n (location: Result<LocationInternal, LocationErrorInternal>) => {\n listener(this.deserializeLocationResponse(location));\n }\n );\n }\n\n /** @ignore */\n private static deserializeHyperTrackErrors(\n errors: HyperTrackErrorInternal[]\n ): HyperTrackError[] {\n let res = errors.map((error: HyperTrackErrorInternal) => {\n if (error.type != 'error') {\n throw new Error('Invalid error type');\n }\n return Object.keys(HyperTrackError).find(\n (key) =>\n HyperTrackError[key as keyof typeof HyperTrackError] === error.value\n ) as HyperTrackError;\n });\n return res;\n }\n\n /** @ignore */\n private static deserializeLocateResponse(\n response: Result<LocationInternal, HyperTrackErrorInternal[]>\n ): Result<Location, HyperTrackError[]> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeHyperTrackErrors(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationError(\n locationError: LocationErrorInternal\n ): LocationError {\n switch (locationError.type) {\n case 'notRunning':\n case 'starting':\n return locationError;\n case 'errors':\n return {\n type: 'errors',\n value: this.deserializeHyperTrackErrors(locationError.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationResponse(\n response: Result<LocationInternal, LocationErrorInternal>\n ): Result<Location, LocationError> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationWithDeviationResponse(\n response: Result<LocationWithDeviationInternal, LocationErrorInternal>\n ): Result<LocationWithDeviation, LocationError> {\n switch (response.type) {\n case 'success':\n const locationWithDeviationInternal: LocationWithDeviationInternal =\n response.value;\n const locationInternal: LocationInternal =\n locationWithDeviationInternal.value.location;\n\n return {\n type: 'success',\n value: {\n location: locationInternal.value,\n deviation: locationWithDeviationInternal.value.deviation,\n } as LocationWithDeviation,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeMetadata(metadata: Metadata): Object {\n if (metadata.type != 'metadata') {\n throw new Error(`Invalid metadata: ${JSON.stringify(metadata)}`);\n }\n return metadata.value;\n }\n\n /** @ignore */\n private static deserializeName(name: Name): string {\n if (name.type != 'name') {\n throw new Error(`Invalid name: ${JSON.stringify(name)}`);\n }\n return name.value;\n }\n\n /** @ignore */\n private static isLocation(obj: Location): obj is Location {\n return (\n 'latitude' in obj &&\n typeof obj.latitude == 'number' &&\n 'longitude' in obj &&\n typeof obj.longitude == 'number'\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,O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,UAAU,IAAIA,GAAG,IACjB,OAAOA,GAAG,CAACmD,QAAQ,IAAI,QAAQ,IAC/B,WAAW,IAAInD,GAAG,IAClB,OAAOA,GAAG,CAACoD,SAAS,IAAI,QAAQ;EAEpC;AACF;AAACiD,OAAA,CAAAtE,OAAA,GAAAS,UAAA;AAAAzC,eAAA,CA7coByC,UAAU"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.HyperTrackError = void 0;
7
7
  // enum naming convention is ignored to make datatype sync
8
8
  // across platforms easier
9
- let HyperTrackError = /*#__PURE__*/function (HyperTrackError) {
9
+ let HyperTrackError = exports.HyperTrackError = /*#__PURE__*/function (HyperTrackError) {
10
10
  HyperTrackError["blockedFromRunning"] = "blockedFromRunning";
11
11
  HyperTrackError["invalidPublishableKey"] = "invalidPublishableKey";
12
12
  HyperTrackError["locationMocked"] = "location.mocked";
@@ -23,5 +23,4 @@ let HyperTrackError = /*#__PURE__*/function (HyperTrackError) {
23
23
  HyperTrackError["permissionsNotificationsDenied"] = "permissions.notifications.denied";
24
24
  return HyperTrackError;
25
25
  }({});
26
- exports.HyperTrackError = HyperTrackError;
27
26
  //# sourceMappingURL=HyperTrackError.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HyperTrackError","exports"],"sources":["HyperTrackError.ts"],"sourcesContent":["// enum naming convention is ignored to make datatype sync\n// across platforms easier\nexport enum HyperTrackError {\n /**\n * The SDK was remotely blocked from running.\n */\n blockedFromRunning = 'blockedFromRunning',\n\n /**\n * The publishable key is invalid.\n */\n invalidPublishableKey = 'invalidPublishableKey',\n\n /**\n * The user enabled mock location app while mocking locations is prohibited.\n */\n locationMocked = 'location.mocked',\n\n /**\n * The user disabled location services systemwide.\n */\n locationServicesDisabled = 'location.servicesDisabled',\n\n /**\n * [Android only] The device doesn't have location services.\n */\n locationServicesUnavailable = 'location.servicesUnavailable',\n\n /**\n * GPS satellites are not in view.\n */\n locationSignalLost = 'location.signalLost',\n\n /**\n * [Android only] The SDK wasn't able to start tracking because of the limitations imposed by the OS.\n * The exempt from background execution conditions weren't met.\n * {@link https://developer.android.com/guide/components/foreground-services#background-start-restriction-exemptions}\n */\n noExemptionFromBackgroundStartRestrictions = 'noExemptionFromBackgroundStartRestrictions',\n\n /**\n * The user denied location permissions.\n */\n permissionsLocationDenied = 'permissions.location.denied',\n\n /**\n * Can’t start tracking in background with When In Use location permissions.\n * SDK will automatically start tracking when app will return to foreground.\n */\n permissionsLocationInsufficientForBackground = 'permissions.location.insufficientForBackground',\n\n /**\n * [iOS only] The user has not chosen whether the app can use location services.\n */\n permissionsLocationNotDetermined = 'permissions.location.notDetermined',\n\n /**\n * [iOS only] The app is in Provisional Always authorization state, which stops sending locations when app is in background.\n */\n permissionsLocationProvisional = 'permissions.location.provisional',\n\n /**\n * The user didn't grant precise location permissions or downgraded permissions to imprecise.\n */\n permissionsLocationReducedAccuracy = 'permissions.location.reducedAccuracy',\n\n /**\n * [iOS only] The app is not authorized to use location services.\n */\n permissionsLocationRestricted = 'permissions.location.restricted',\n\n /**\n * [Android only] The user denied notification permissions needed to display a persistent notification\n * needed for foreground location tracking.\n */\n permissionsNotificationsDenied = 'permissions.notifications.denied',\n}\n"],"mappings":";;;;;;AAAA;AACA;AAAA,IACYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAAAC,OAAA,CAAAD,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["HyperTrackError","exports"],"sources":["HyperTrackError.ts"],"sourcesContent":["// enum naming convention is ignored to make datatype sync\n// across platforms easier\nexport enum HyperTrackError {\n /**\n * The SDK was remotely blocked from running.\n */\n blockedFromRunning = 'blockedFromRunning',\n\n /**\n * The publishable key is invalid.\n */\n invalidPublishableKey = 'invalidPublishableKey',\n\n /**\n * The user enabled mock location app while mocking locations is prohibited.\n */\n locationMocked = 'location.mocked',\n\n /**\n * The user disabled location services systemwide.\n */\n locationServicesDisabled = 'location.servicesDisabled',\n\n /**\n * [Android only] The device doesn't have location services.\n */\n locationServicesUnavailable = 'location.servicesUnavailable',\n\n /**\n * GPS satellites are not in view.\n */\n locationSignalLost = 'location.signalLost',\n\n /**\n * [Android only] The SDK wasn't able to start tracking because of the limitations imposed by the OS.\n * The exempt from background execution conditions weren't met.\n * {@link https://developer.android.com/guide/components/foreground-services#background-start-restriction-exemptions}\n */\n noExemptionFromBackgroundStartRestrictions = 'noExemptionFromBackgroundStartRestrictions',\n\n /**\n * The user denied location permissions.\n */\n permissionsLocationDenied = 'permissions.location.denied',\n\n /**\n * Can’t start tracking in background with When In Use location permissions.\n * SDK will automatically start tracking when app will return to foreground.\n */\n permissionsLocationInsufficientForBackground = 'permissions.location.insufficientForBackground',\n\n /**\n * [iOS only] The user has not chosen whether the app can use location services.\n */\n permissionsLocationNotDetermined = 'permissions.location.notDetermined',\n\n /**\n * [iOS only] The app is in Provisional Always authorization state, which stops sending locations when app is in background.\n */\n permissionsLocationProvisional = 'permissions.location.provisional',\n\n /**\n * The user didn't grant precise location permissions or downgraded permissions to imprecise.\n */\n permissionsLocationReducedAccuracy = 'permissions.location.reducedAccuracy',\n\n /**\n * [iOS only] The app is not authorized to use location services.\n */\n permissionsLocationRestricted = 'permissions.location.restricted',\n\n /**\n * [Android only] The user denied notification permissions needed to display a persistent notification\n * needed for foreground location tracking.\n */\n permissionsNotificationsDenied = 'permissions.notifications.denied',\n}\n"],"mappings":";;;;;;AAAA;AACA;AAAA,IACYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA"}
@@ -78,6 +78,5 @@ var _LocationWithDeviation = require("./HyperTrack/data_types/LocationWithDeviat
78
78
  var _Location = require("./HyperTrack/data_types/Location");
79
79
  var _Result = require("./HyperTrack/data_types/Result");
80
80
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81
- var _default = _HyperTrack.default;
82
- exports.default = _default;
81
+ var _default = exports.default = _HyperTrack.default;
83
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_HyperTrack","_interopRequireDefault","require","_HyperTrackError","_LocationErrorInternal","_LocationError","_LocationWithDeviation","_Location","_Result","obj","__esModule","default","_default","HyperTrack","exports"],"sources":["index.tsx"],"sourcesContent":["import HyperTrack from './HyperTrack/HyperTrack';\nexport default HyperTrack;\nexport { HyperTrack };\n\nexport { HyperTrackError } from './HyperTrack/data_types/HyperTrackError';\nexport {\n NotRunning,\n Starting,\n} from './HyperTrack/data_types/internal/LocationErrorInternal';\nexport { LocationError, Errors } from './HyperTrack/data_types/LocationError';\nexport { LocationWithDeviation } from './HyperTrack/data_types/LocationWithDeviation';\nexport { Location } from './HyperTrack/data_types/Location';\nexport { Result, Success, Failure } from './HyperTrack/data_types/Result';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAA0E,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAX3DC,mBAAU;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA"}
1
+ {"version":3,"names":["_HyperTrack","_interopRequireDefault","require","_HyperTrackError","_LocationErrorInternal","_LocationError","_LocationWithDeviation","_Location","_Result","obj","__esModule","default","_default","exports","HyperTrack"],"sources":["index.tsx"],"sourcesContent":["import HyperTrack from './HyperTrack/HyperTrack';\nexport default HyperTrack;\nexport { HyperTrack };\n\nexport { HyperTrackError } from './HyperTrack/data_types/HyperTrackError';\nexport {\n NotRunning,\n Starting,\n} from './HyperTrack/data_types/internal/LocationErrorInternal';\nexport { LocationError, Errors } from './HyperTrack/data_types/LocationError';\nexport { LocationWithDeviation } from './HyperTrack/data_types/LocationWithDeviation';\nexport { Location } from './HyperTrack/data_types/Location';\nexport { Result, Success, Failure } from './HyperTrack/data_types/Result';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAA0E,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAX3DG,mBAAU"}
@@ -34,10 +34,7 @@ export default class HyperTrack {
34
34
  * @returns location with deviation if success or LocationError if failure
35
35
  */
36
36
 
37
- static async addGeotag() {
38
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
- args[_key] = arguments[_key];
40
- }
37
+ static async addGeotag(...args) {
41
38
  if (args.length === 1 && typeof args[0] === 'object') {
42
39
  return HyperTrackSdk.addGeotag({
43
40
  data: args[0],
@@ -145,7 +142,8 @@ export default class HyperTrack {
145
142
  *
146
143
  * @param callback
147
144
  * @returns EmitterSubscription
148
- * @example ```js
145
+ * @example
146
+ * ```js
149
147
  * const subscription = HyperTrack.locate(location => {
150
148
  * ...
151
149
  * })
@@ -156,7 +154,7 @@ export default class HyperTrack {
156
154
  */
157
155
  static locate(callback) {
158
156
  var _this$locateSubscript;
159
- (_this$locateSubscript = this.locateSubscription) === null || _this$locateSubscript === void 0 ? void 0 : _this$locateSubscript.remove();
157
+ (_this$locateSubscript = this.locateSubscription) === null || _this$locateSubscript === void 0 || _this$locateSubscript.remove();
160
158
  this.locateSubscription = EventEmitter.addListener(EVENT_LOCATE, location => {
161
159
  callback(this.deserializeLocateResponse(location));
162
160
  });
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","NativeEventEmitter","HyperTrackError","EVENT_ERRORS","EVENT_IS_AVAILABLE","EVENT_IS_TRACKING","EVENT_LOCATE","EVENT_LOCATION","LINKING_ERROR","select","ios","default","HyperTrackSdk","HyperTrackReactNativePlugin","Proxy","get","Error","EventEmitter","HyperTrack","addGeotag","_len","arguments","length","args","Array","_key","data","expectedLocation","undefined","then","locationResponse","deserializeLocationResponse","isLocation","type","value","latitude","longitude","deserializeLocationWithDeviationResponse","getDeviceId","deviceId","getErrors","errors","deserializeHyperTrackErrors","getIsAvailable","isAvailable","getIsTracking","isTracking","getLocation","getMetadata","metadata","deserializeMetadata","getName","name","deserializeName","locate","callback","_this$locateSubscript","locateSubscription","remove","addListener","location","deserializeLocateResponse","setIsAvailable","setIsTracking","setMetadata","setName","subscribeToErrors","listener","rawErrors","subscribeToIsAvailable","subscribeToIsTracking","subscribeToLocation","res","map","error","Object","keys","find","key","response","deserializeLocationError","locationError","locationWithDeviationInternal","locationInternal","deviation","JSON","stringify","obj","_defineProperty"],"sources":["HyperTrack.ts"],"sourcesContent":["import {\n NativeModules,\n Platform,\n NativeEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { HyperTrackError } from './data_types/HyperTrackError';\nimport type { IsAvailable } from './data_types/internal/IsAvailable';\nimport type { IsTracking } from './data_types/internal/IsTracking';\nimport type { Location } from './data_types/Location';\nimport type { LocationError } from './data_types/LocationError';\nimport type { DeviceId } from './data_types/internal/DeviceId';\nimport type { GeotagData } from './data_types/internal/GeotagData';\nimport type { Name } from './data_types/internal/Name';\nimport type { HyperTrackErrorInternal } from './data_types/internal/HyperTrackErrorInternal';\nimport type { LocationWithDeviation } from './data_types/LocationWithDeviation';\nimport type { LocationErrorInternal } from './data_types/internal/LocationErrorInternal';\nimport type { Result } from './data_types/Result';\nimport type { LocationInternal } from './data_types/internal/LocationInternal';\nimport type { LocationWithDeviationInternal } from './data_types/internal/LocationWithDeviationInternal';\nimport type { Metadata } from './data_types/internal/Metadata';\n\nconst EVENT_ERRORS = 'errors';\nconst EVENT_IS_AVAILABLE = 'isAvailable';\nconst EVENT_IS_TRACKING = 'isTracking';\nconst EVENT_LOCATE = 'locate';\nconst EVENT_LOCATION = 'location';\n\nconst LINKING_ERROR =\n `The package 'hypertrack-sdk-react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperTrackSdk = NativeModules.HyperTrackReactNativePlugin\n ? NativeModules.HyperTrackReactNativePlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nconst EventEmitter = new NativeEventEmitter(HyperTrackSdk);\n\nexport default class HyperTrack {\n private static locateSubscription: EmitterSubscription | undefined;\n\n /**\n * Adds a new geotag\n *\n * @param {Object} data - Geotad data JSON\n * @returns current location if success or LocationError if failure\n */\n static async addGeotag(\n data: Object\n ): Promise<Result<Location, LocationError>>;\n\n /**\n * Adds a new geotag with expected location\n *\n * @param {Object} data - Geotad data JSON\n * @param {Location} expectedLocation - Expected location\n * @returns location with deviation if success or LocationError if failure\n */\n static async addGeotag(\n data: Object,\n expectedLocation: Location\n ): Promise<Result<LocationWithDeviation, LocationError>>;\n\n static async addGeotag(\n ...args: any[]\n ): Promise<Result<Location | LocationWithDeviation, LocationError>> {\n if (args.length === 1 && typeof args[0] === 'object') {\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: undefined,\n } as GeotagData).then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n } else if (\n args.length === 2 &&\n typeof args[0] === 'object' &&\n HyperTrack.isLocation(args[1])\n ) {\n let expectedLocation = args[1] as Location;\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: {\n type: 'location',\n value: {\n latitude: expectedLocation.latitude,\n longitude: expectedLocation.longitude,\n },\n } as LocationInternal,\n } as GeotagData).then(\n (\n locationResponse: Result<\n LocationWithDeviationInternal,\n LocationErrorInternal\n >\n ) => {\n return this.deserializeLocationWithDeviationResponse(\n locationResponse\n );\n }\n );\n } else {\n throw new Error('Invalid arguments');\n }\n }\n\n /**\n * Returns a string that is used to uniquely identify the device\n *\n * @returns {string} Device ID\n */\n static async getDeviceId(): Promise<string> {\n return HyperTrackSdk.getDeviceId().then(\n (deviceId: DeviceId) => deviceId.value\n );\n }\n\n /**\n * Returns a list of errors that blocks SDK from tracking\n *\n * @returns {HyperTrackError[]} List of errors\n */\n static async getErrors(): Promise<HyperTrackError[]> {\n return HyperTrackSdk.getErrors().then(\n (errors: HyperTrackErrorInternal[]) => {\n return this.deserializeHyperTrackErrors(errors);\n }\n );\n }\n\n /**\n * Reflects availability of the device for the Nearby search\n *\n * @returns true when is available or false when unavailable\n */\n static async getIsAvailable(): Promise<boolean> {\n return HyperTrackSdk.getIsAvailable().then(\n (isAvailable: IsAvailable) => isAvailable.value\n );\n }\n\n /**\n * Reflects the tracking intent for the device\n *\n * @returns {boolean} Whether the user's movement data is getting tracked or not.\n */\n static async getIsTracking(): Promise<boolean> {\n return HyperTrackSdk.getIsTracking().then(\n (isTracking: IsTracking) => isTracking.value\n );\n }\n\n /**\n * Reflects the current location of the user or an outage reason\n */\n static async getLocation(): Promise<Result<Location, LocationError>> {\n return HyperTrackSdk.getLocation().then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n }\n\n /**\n * Gets the metadata that is set for the device\n *\n * @returns {Object} Metadata JSON\n */\n static async getMetadata(): Promise<Object> {\n return HyperTrackSdk.getMetadata().then((metadata: Metadata) => {\n return this.deserializeMetadata(metadata);\n });\n }\n\n /**\n * Gets the name that is set for the device\n *\n * @returns {string} Device name\n */\n static async getName(): Promise<string> {\n return HyperTrackSdk.getName().then((name: Name) => {\n return this.deserializeName(name);\n });\n }\n\n /**\n * Requests one-time location update and returns the location once it is available, or error.\n *\n * Only one locate subscription can be active at a time. If you re-subscribe, the old EmitterSubscription\n * will be automaticaly removed.\n *\n * This method will start location tracking if called, and will stop it when the location is received or\n * the subscription is cancelled. If any other tracking intent is present (e.g. isAvailable is set to `true`),\n * the tracking will not be stopped.\n *\n * @param callback\n * @returns EmitterSubscription\n * @example ```js\n * const subscription = HyperTrack.locate(location => {\n * ...\n * })\n *\n * // to unsubscribe\n * subscription.remove()\n * ```\n */\n static locate(\n callback: (location: Result<Location, HyperTrackError[]>) => void\n ) {\n this.locateSubscription?.remove();\n this.locateSubscription = EventEmitter.addListener(\n EVENT_LOCATE,\n (location: Result<LocationInternal, HyperTrackErrorInternal[]>) => {\n callback(this.deserializeLocateResponse(location));\n }\n );\n HyperTrackSdk.locate();\n return this.locateSubscription;\n }\n\n /**\n * Sets the availability of the device for the Nearby search\n *\n * @param availability true when is available or false when unavailable\n */\n static async setIsAvailable(isAvailable: boolean) {\n HyperTrackSdk.setIsAvailable({\n type: 'isAvailable',\n value: isAvailable,\n } as IsAvailable);\n }\n\n /**\n * Sets the tracking intent for the device\n *\n * @param {boolean} isTracking\n */\n static async setIsTracking(isTracking: boolean): Promise<void> {\n HyperTrackSdk.setIsTracking({\n type: 'isTracking',\n value: isTracking,\n } as IsTracking);\n }\n\n /**\n * Sets the metadata for the device\n *\n * @param {Object} data - Metadata JSON\n */\n static async setMetadata(data: Object) {\n HyperTrackSdk.setMetadata({\n type: 'metadata',\n value: data,\n });\n }\n\n /**\n * Sets the name for the device\n *\n * @param {string} name\n */\n static async setName(name: string) {\n HyperTrackSdk.setName({\n type: 'name',\n value: name,\n } as Name);\n }\n\n /**\n * Subscribe to tracking errors\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToErrors(errors => {\n * errors.forEach(error => {\n * // ... error\n * })\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToErrors(\n listener: (errors: HyperTrackError[]) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_ERRORS,\n (rawErrors: HyperTrackErrorInternal[]) => {\n listener(this.deserializeHyperTrackErrors(rawErrors));\n }\n );\n }\n\n /**\n * Subscribe to availability changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsAvailable(isAvailable => {\n * if (isAvailable) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsAvailable(\n listener: (isAvailable: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_AVAILABLE,\n (isAvailable: IsAvailable) => {\n listener(isAvailable.value);\n }\n );\n }\n\n /**\n * Subscribe to tracking intent changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsTracking(isTracking => {\n * if (isTracking) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsTracking(\n listener: (isTracking: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_TRACKING,\n (isTracking: IsTracking) => {\n listener(isTracking.value);\n }\n );\n }\n\n /**\n * Subscribe to location changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToLocation(location => {\n * ...\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToLocation(\n listener: (location: Result<Location, LocationError>) => void\n ) {\n return EventEmitter.addListener(\n EVENT_LOCATION,\n (location: Result<LocationInternal, LocationErrorInternal>) => {\n listener(this.deserializeLocationResponse(location));\n }\n );\n }\n\n /** @ignore */\n private static deserializeHyperTrackErrors(\n errors: HyperTrackErrorInternal[]\n ): HyperTrackError[] {\n let res = errors.map((error: HyperTrackErrorInternal) => {\n if (error.type != 'error') {\n throw new Error('Invalid error type');\n }\n return Object.keys(HyperTrackError).find(\n (key) =>\n HyperTrackError[key as keyof typeof HyperTrackError] === error.value\n ) as HyperTrackError;\n });\n return res;\n }\n\n /** @ignore */\n private static deserializeLocateResponse(\n response: Result<LocationInternal, HyperTrackErrorInternal[]>\n ): Result<Location, HyperTrackError[]> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeHyperTrackErrors(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationError(\n locationError: LocationErrorInternal\n ): LocationError {\n switch (locationError.type) {\n case 'notRunning':\n case 'starting':\n return locationError;\n case 'errors':\n return {\n type: 'errors',\n value: this.deserializeHyperTrackErrors(locationError.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationResponse(\n response: Result<LocationInternal, LocationErrorInternal>\n ): Result<Location, LocationError> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationWithDeviationResponse(\n response: Result<LocationWithDeviationInternal, LocationErrorInternal>\n ): Result<LocationWithDeviation, LocationError> {\n switch (response.type) {\n case 'success':\n const locationWithDeviationInternal: LocationWithDeviationInternal =\n response.value;\n const locationInternal: LocationInternal =\n locationWithDeviationInternal.value.location;\n\n return {\n type: 'success',\n value: {\n location: locationInternal.value,\n deviation: locationWithDeviationInternal.value.deviation,\n } as LocationWithDeviation,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeMetadata(metadata: Metadata): Object {\n if (metadata.type != 'metadata') {\n throw new Error(`Invalid metadata: ${JSON.stringify(metadata)}`);\n }\n return metadata.value;\n }\n\n /** @ignore */\n private static deserializeName(name: Name): string {\n if (name.type != 'name') {\n throw new Error(`Invalid name: ${JSON.stringify(name)}`);\n }\n return name.value;\n }\n\n /** @ignore */\n private static isLocation(obj: Location): obj is Location {\n return (\n 'latitude' in obj &&\n typeof obj.latitude == 'number' &&\n 'longitude' in obj &&\n typeof obj.longitude == 'number'\n );\n }\n}\n"],"mappings":";;;AAAA,SACEA,aAAa,EACbC,QAAQ,EACRC,kBAAkB,QAEb,cAAc;AACrB,SAASC,eAAe,QAAQ,8BAA8B;AAgB9D,MAAMC,YAAY,GAAG,QAAQ;AAC7B,MAAMC,kBAAkB,GAAG,aAAa;AACxC,MAAMC,iBAAiB,GAAG,YAAY;AACtC,MAAMC,YAAY,GAAG,QAAQ;AAC7B,MAAMC,cAAc,GAAG,UAAU;AAEjC,MAAMC,aAAa,GAChB,sFAAqF,GACtFR,QAAQ,CAACS,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,aAAa,GAAGb,aAAa,CAACc,2BAA2B,GAC3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ACjD,IAAIA,IAAI,CAACnB,IAAI,IAAI,MAAM,EAAE;MACvB,MAAM,IAAIjB,KAAK,CAAE,iBAAgBqE,IAAI,CAACC,SAAS,CAAClC,IAAI,CAAE,EAAC,CAAC;IAC1D;IACA,OAAOA,IAAI,CAAClB,KAAK;EACnB;;EAEA;EACA,OAAeF,UAAUA,CAACuD,GAAa,EAAmB;IACxD,OACE,UAAU,IAAIA,GAAG,IACjB,OAAOA,GAAG,CAACpD,QAAQ,IAAI,QAAQ,IAC/B,WAAW,IAAIoD,GAAG,IAClB,OAAOA,GAAG,CAACnD,SAAS,IAAI,QAAQ;EAEpC;AACF;AAACoD,eAAA,CA5coBtE,UAAU"}
1
+ {"version":3,"names":["NativeModules","Platform","NativeEventEmitter","HyperTrackError","EVENT_ERRORS","EVENT_IS_AVAILABLE","EVENT_IS_TRACKING","EVENT_LOCATE","EVENT_LOCATION","LINKING_ERROR","select","ios","default","HyperTrackSdk","HyperTrackReactNativePlugin","Proxy","get","Error","EventEmitter","HyperTrack","addGeotag","args","length","data","expectedLocation","undefined","then","locationResponse","deserializeLocationResponse","isLocation","type","value","latitude","longitude","deserializeLocationWithDeviationResponse","getDeviceId","deviceId","getErrors","errors","deserializeHyperTrackErrors","getIsAvailable","isAvailable","getIsTracking","isTracking","getLocation","getMetadata","metadata","deserializeMetadata","getName","name","deserializeName","locate","callback","_this$locateSubscript","locateSubscription","remove","addListener","location","deserializeLocateResponse","setIsAvailable","setIsTracking","setMetadata","setName","subscribeToErrors","listener","rawErrors","subscribeToIsAvailable","subscribeToIsTracking","subscribeToLocation","res","map","error","Object","keys","find","key","response","deserializeLocationError","locationError","locationWithDeviationInternal","locationInternal","deviation","JSON","stringify","obj","_defineProperty"],"sources":["HyperTrack.ts"],"sourcesContent":["import {\n NativeModules,\n Platform,\n NativeEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { HyperTrackError } from './data_types/HyperTrackError';\nimport type { IsAvailable } from './data_types/internal/IsAvailable';\nimport type { IsTracking } from './data_types/internal/IsTracking';\nimport type { Location } from './data_types/Location';\nimport type { LocationError } from './data_types/LocationError';\nimport type { DeviceId } from './data_types/internal/DeviceId';\nimport type { GeotagData } from './data_types/internal/GeotagData';\nimport type { Name } from './data_types/internal/Name';\nimport type { HyperTrackErrorInternal } from './data_types/internal/HyperTrackErrorInternal';\nimport type { LocationWithDeviation } from './data_types/LocationWithDeviation';\nimport type { LocationErrorInternal } from './data_types/internal/LocationErrorInternal';\nimport type { Result } from './data_types/Result';\nimport type { LocationInternal } from './data_types/internal/LocationInternal';\nimport type { LocationWithDeviationInternal } from './data_types/internal/LocationWithDeviationInternal';\nimport type { Metadata } from './data_types/internal/Metadata';\n\nconst EVENT_ERRORS = 'errors';\nconst EVENT_IS_AVAILABLE = 'isAvailable';\nconst EVENT_IS_TRACKING = 'isTracking';\nconst EVENT_LOCATE = 'locate';\nconst EVENT_LOCATION = 'location';\n\nconst LINKING_ERROR =\n `The package 'hypertrack-sdk-react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst HyperTrackSdk = NativeModules.HyperTrackReactNativePlugin\n ? NativeModules.HyperTrackReactNativePlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nconst EventEmitter = new NativeEventEmitter(HyperTrackSdk);\n\nexport default class HyperTrack {\n private static locateSubscription: EmitterSubscription | undefined;\n\n /**\n * Adds a new geotag\n *\n * @param {Object} data - Geotad data JSON\n * @returns current location if success or LocationError if failure\n */\n static async addGeotag(\n data: Object\n ): Promise<Result<Location, LocationError>>;\n\n /**\n * Adds a new geotag with expected location\n *\n * @param {Object} data - Geotad data JSON\n * @param {Location} expectedLocation - Expected location\n * @returns location with deviation if success or LocationError if failure\n */\n static async addGeotag(\n data: Object,\n expectedLocation: Location\n ): Promise<Result<LocationWithDeviation, LocationError>>;\n\n static async addGeotag(\n ...args: any[]\n ): Promise<Result<Location | LocationWithDeviation, LocationError>> {\n if (args.length === 1 && typeof args[0] === 'object') {\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: undefined,\n } as GeotagData).then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n } else if (\n args.length === 2 &&\n typeof args[0] === 'object' &&\n HyperTrack.isLocation(args[1])\n ) {\n let expectedLocation = args[1] as Location;\n return HyperTrackSdk.addGeotag({\n data: args[0],\n expectedLocation: {\n type: 'location',\n value: {\n latitude: expectedLocation.latitude,\n longitude: expectedLocation.longitude,\n },\n } as LocationInternal,\n } as GeotagData).then(\n (\n locationResponse: Result<\n LocationWithDeviationInternal,\n LocationErrorInternal\n >\n ) => {\n return this.deserializeLocationWithDeviationResponse(\n locationResponse\n );\n }\n );\n } else {\n throw new Error('Invalid arguments');\n }\n }\n\n /**\n * Returns a string that is used to uniquely identify the device\n *\n * @returns {string} Device ID\n */\n static async getDeviceId(): Promise<string> {\n return HyperTrackSdk.getDeviceId().then(\n (deviceId: DeviceId) => deviceId.value\n );\n }\n\n /**\n * Returns a list of errors that blocks SDK from tracking\n *\n * @returns {HyperTrackError[]} List of errors\n */\n static async getErrors(): Promise<HyperTrackError[]> {\n return HyperTrackSdk.getErrors().then(\n (errors: HyperTrackErrorInternal[]) => {\n return this.deserializeHyperTrackErrors(errors);\n }\n );\n }\n\n /**\n * Reflects availability of the device for the Nearby search\n *\n * @returns true when is available or false when unavailable\n */\n static async getIsAvailable(): Promise<boolean> {\n return HyperTrackSdk.getIsAvailable().then(\n (isAvailable: IsAvailable) => isAvailable.value\n );\n }\n\n /**\n * Reflects the tracking intent for the device\n *\n * @returns {boolean} Whether the user's movement data is getting tracked or not.\n */\n static async getIsTracking(): Promise<boolean> {\n return HyperTrackSdk.getIsTracking().then(\n (isTracking: IsTracking) => isTracking.value\n );\n }\n\n /**\n * Reflects the current location of the user or an outage reason\n */\n static async getLocation(): Promise<Result<Location, LocationError>> {\n return HyperTrackSdk.getLocation().then(\n (locationResponse: Result<LocationInternal, LocationErrorInternal>) => {\n return this.deserializeLocationResponse(locationResponse);\n }\n );\n }\n\n /**\n * Gets the metadata that is set for the device\n *\n * @returns {Object} Metadata JSON\n */\n static async getMetadata(): Promise<Object> {\n return HyperTrackSdk.getMetadata().then((metadata: Metadata) => {\n return this.deserializeMetadata(metadata);\n });\n }\n\n /**\n * Gets the name that is set for the device\n *\n * @returns {string} Device name\n */\n static async getName(): Promise<string> {\n return HyperTrackSdk.getName().then((name: Name) => {\n return this.deserializeName(name);\n });\n }\n\n /**\n * Requests one-time location update and returns the location once it is available, or error.\n *\n * Only one locate subscription can be active at a time. If you re-subscribe, the old EmitterSubscription\n * will be automaticaly removed.\n *\n * This method will start location tracking if called, and will stop it when the location is received or\n * the subscription is cancelled. If any other tracking intent is present (e.g. isAvailable is set to `true`),\n * the tracking will not be stopped.\n *\n * @param callback\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.locate(location => {\n * ...\n * })\n *\n * // to unsubscribe\n * subscription.remove()\n * ```\n */\n static locate(\n callback: (location: Result<Location, HyperTrackError[]>) => void\n ) {\n this.locateSubscription?.remove();\n this.locateSubscription = EventEmitter.addListener(\n EVENT_LOCATE,\n (location: Result<LocationInternal, HyperTrackErrorInternal[]>) => {\n callback(this.deserializeLocateResponse(location));\n }\n );\n HyperTrackSdk.locate();\n return this.locateSubscription;\n }\n\n /**\n * Sets the availability of the device for the Nearby search\n *\n * @param availability true when is available or false when unavailable\n */\n static async setIsAvailable(isAvailable: boolean) {\n HyperTrackSdk.setIsAvailable({\n type: 'isAvailable',\n value: isAvailable,\n } as IsAvailable);\n }\n\n /**\n * Sets the tracking intent for the device\n *\n * @param {boolean} isTracking\n */\n static async setIsTracking(isTracking: boolean): Promise<void> {\n HyperTrackSdk.setIsTracking({\n type: 'isTracking',\n value: isTracking,\n } as IsTracking);\n }\n\n /**\n * Sets the metadata for the device\n *\n * @param {Object} data - Metadata JSON\n */\n static async setMetadata(data: Object) {\n HyperTrackSdk.setMetadata({\n type: 'metadata',\n value: data,\n });\n }\n\n /**\n * Sets the name for the device\n *\n * @param {string} name\n */\n static async setName(name: string) {\n HyperTrackSdk.setName({\n type: 'name',\n value: name,\n } as Name);\n }\n\n /**\n * Subscribe to tracking errors\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToErrors(errors => {\n * errors.forEach(error => {\n * // ... error\n * })\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToErrors(\n listener: (errors: HyperTrackError[]) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_ERRORS,\n (rawErrors: HyperTrackErrorInternal[]) => {\n listener(this.deserializeHyperTrackErrors(rawErrors));\n }\n );\n }\n\n /**\n * Subscribe to availability changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsAvailable(isAvailable => {\n * if (isAvailable) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsAvailable(\n listener: (isAvailable: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_AVAILABLE,\n (isAvailable: IsAvailable) => {\n listener(isAvailable.value);\n }\n );\n }\n\n /**\n * Subscribe to tracking intent changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToIsTracking(isTracking => {\n * if (isTracking) {\n * // ... ready to go\n * }\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToIsTracking(\n listener: (isTracking: boolean) => void\n ): EmitterSubscription {\n return EventEmitter.addListener(\n EVENT_IS_TRACKING,\n (isTracking: IsTracking) => {\n listener(isTracking.value);\n }\n );\n }\n\n /**\n * Subscribe to location changes\n *\n * @param listener\n * @returns EmitterSubscription\n * @example\n * ```js\n * const subscription = HyperTrack.subscribeToLocation(location => {\n * ...\n * })\n *\n * // later, to stop listening\n * subscription.remove()\n * ```\n */\n static subscribeToLocation(\n listener: (location: Result<Location, LocationError>) => void\n ) {\n return EventEmitter.addListener(\n EVENT_LOCATION,\n (location: Result<LocationInternal, LocationErrorInternal>) => {\n listener(this.deserializeLocationResponse(location));\n }\n );\n }\n\n /** @ignore */\n private static deserializeHyperTrackErrors(\n errors: HyperTrackErrorInternal[]\n ): HyperTrackError[] {\n let res = errors.map((error: HyperTrackErrorInternal) => {\n if (error.type != 'error') {\n throw new Error('Invalid error type');\n }\n return Object.keys(HyperTrackError).find(\n (key) =>\n HyperTrackError[key as keyof typeof HyperTrackError] === error.value\n ) as HyperTrackError;\n });\n return res;\n }\n\n /** @ignore */\n private static deserializeLocateResponse(\n response: Result<LocationInternal, HyperTrackErrorInternal[]>\n ): Result<Location, HyperTrackError[]> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeHyperTrackErrors(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationError(\n locationError: LocationErrorInternal\n ): LocationError {\n switch (locationError.type) {\n case 'notRunning':\n case 'starting':\n return locationError;\n case 'errors':\n return {\n type: 'errors',\n value: this.deserializeHyperTrackErrors(locationError.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationResponse(\n response: Result<LocationInternal, LocationErrorInternal>\n ): Result<Location, LocationError> {\n switch (response.type) {\n case 'success':\n return {\n type: 'success',\n value: response.value.value,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeLocationWithDeviationResponse(\n response: Result<LocationWithDeviationInternal, LocationErrorInternal>\n ): Result<LocationWithDeviation, LocationError> {\n switch (response.type) {\n case 'success':\n const locationWithDeviationInternal: LocationWithDeviationInternal =\n response.value;\n const locationInternal: LocationInternal =\n locationWithDeviationInternal.value.location;\n\n return {\n type: 'success',\n value: {\n location: locationInternal.value,\n deviation: locationWithDeviationInternal.value.deviation,\n } as LocationWithDeviation,\n };\n case 'failure':\n return {\n type: 'failure',\n value: this.deserializeLocationError(response.value),\n };\n }\n }\n\n /** @ignore */\n private static deserializeMetadata(metadata: Metadata): Object {\n if (metadata.type != 'metadata') {\n throw new Error(`Invalid metadata: ${JSON.stringify(metadata)}`);\n }\n return metadata.value;\n }\n\n /** @ignore */\n private static deserializeName(name: Name): string {\n if (name.type != 'name') {\n throw new Error(`Invalid name: ${JSON.stringify(name)}`);\n }\n return name.value;\n }\n\n /** @ignore */\n private static isLocation(obj: Location): obj is Location {\n return (\n 'latitude' in obj &&\n typeof obj.latitude == 'number' &&\n 'longitude' in obj &&\n typeof obj.longitude == 'number'\n );\n }\n}\n"],"mappings":";;;AAAA,SACEA,aAAa,EACbC,QAAQ,EACRC,kBAAkB,QAEb,cAAc;AACrB,SAASC,eAAe,QAAQ,8BAA8B;AAgB9D,MAAMC,YAAY,GAAG,QAAQ;AAC7B,MAAMC,kBAAkB,GAAG,aAAa;AACxC,MAAMC,iBAAiB,GAAG,YAAY;AACtC,MAAMC,YAAY,GAAG,QAAQ;AAC7B,MAAMC,cAAc,GAAG,UAAU;AAEjC,MAAMC,aAAa,GAChB,sFAAqF,GACtFR,QAAQ,CAACS,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,aAAa,GAAGb,aAAa,CAACc,2BAA2B,GAC3Dd,aAAa,CAACc,2BAA2B,GACzC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMS,YAAY,GAAG,IAAIhB,kBAAkB,CAACW,aAAa,CAA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,CA7coBlE,UAAU"}
@@ -73,7 +73,8 @@ export default class HyperTrack {
73
73
  *
74
74
  * @param callback
75
75
  * @returns EmitterSubscription
76
- * @example ```js
76
+ * @example
77
+ * ```js
77
78
  * const subscription = HyperTrack.locate(location => {
78
79
  * ...
79
80
  * })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypertrack-sdk-react-native",
3
- "version": "11.0.9",
3
+ "version": "11.0.11",
4
4
  "description": "React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into React Native apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -74,9 +74,9 @@
74
74
  "react-native": "^0.70.0",
75
75
  "react-native-builder-bob": "^0.18.3",
76
76
  "release-it": "^15.4.1",
77
- "typedoc": "^0.23.14",
78
- "typedoc-plugin-merge-modules": "^4.0.0",
79
- "typedoc-plugin-rename-defaults": "^0.6.1",
77
+ "typedoc": "^0.25.4",
78
+ "typedoc-plugin-merge-modules": "^5.1.0",
79
+ "typedoc-plugin-rename-defaults": "^0.7.0",
80
80
  "typescript": "^4.5.2"
81
81
  },
82
82
  "resolutions": {
@@ -205,7 +205,8 @@ export default class HyperTrack {
205
205
  *
206
206
  * @param callback
207
207
  * @returns EmitterSubscription
208
- * @example ```js
208
+ * @example
209
+ * ```js
209
210
  * const subscription = HyperTrack.locate(location => {
210
211
  * ...
211
212
  * })
@@ -1,2 +0,0 @@
1
- #Thu Apr 13 16:52:30 EEST 2023
2
- gradle.version=7.2
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="CompilerConfiguration">
4
- <bytecodeTargetLevel target="11" />
5
- </component>
6
- </project>
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="GradleMigrationSettings" migrationVersion="1" />
4
- <component name="GradleSettings">
5
- <option name="linkedExternalProjectsSettings">
6
- <GradleProjectSettings>
7
- <option name="testRunner" value="GRADLE" />
8
- <option name="distributionType" value="DEFAULT_WRAPPED" />
9
- <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
- <option name="gradleHome" value="/usr/local/Cellar/gradle/8.0.2/libexec" />
11
- <option name="modules">
12
- <set>
13
- <option value="$PROJECT_DIR$" />
14
- </set>
15
- </option>
16
- </GradleProjectSettings>
17
- </option>
18
- </component>
19
- </project>
@@ -1,35 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="RemoteRepositoriesConfiguration">
4
- <remote-repository>
5
- <option name="id" value="central" />
6
- <option name="name" value="Maven Central repository" />
7
- <option name="url" value="https://repo1.maven.org/maven2" />
8
- </remote-repository>
9
- <remote-repository>
10
- <option name="id" value="jboss.community" />
11
- <option name="name" value="JBoss Community repository" />
12
- <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
13
- </remote-repository>
14
- <remote-repository>
15
- <option name="id" value="MavenRepo" />
16
- <option name="name" value="MavenRepo" />
17
- <option name="url" value="https://repo.maven.apache.org/maven2/" />
18
- </remote-repository>
19
- <remote-repository>
20
- <option name="id" value="React Native sources" />
21
- <option name="name" value="React Native sources" />
22
- <option name="url" value="file:$PROJECT_DIR$/../node_modules/react-native/android/" />
23
- </remote-repository>
24
- <remote-repository>
25
- <option name="id" value="hypertrack" />
26
- <option name="name" value="hypertrack" />
27
- <option name="url" value="https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/" />
28
- </remote-repository>
29
- <remote-repository>
30
- <option name="id" value="Google" />
31
- <option name="name" value="Google" />
32
- <option name="url" value="https://dl.google.com/dl/android/maven2/" />
33
- </remote-repository>
34
- </component>
35
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="KotlinJpsPluginSettings">
4
- <option name="version" value="1.6.21" />
5
- </component>
6
- </project>
@@ -1,9 +0,0 @@
1
- <project version="4">
2
- <component name="ExternalStorageConfigurationManager" enabled="true" />
3
- <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="zulu-11" project-jdk-type="JavaSDK">
4
- <output url="file://$PROJECT_DIR$/build/classes" />
5
- </component>
6
- <component name="ProjectType">
7
- <option name="id" value="Android" />
8
- </component>
9
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
- </component>
6
- </project>
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Thu Jul 06 15:19:21 EEST 2023
8
- sdk.dir=/opt/homebrew/share/android-commandlinetools