@woosmap/react-native-plugin-geofencing 0.1.4 → 0.1.7

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 (78) hide show
  1. package/README.md +219 -20
  2. package/android/build.gradle +7 -0
  3. package/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingModule.java +328 -35
  4. package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapMessageAndKey.java +20 -3
  5. package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapTask.java +299 -0
  6. package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapUtil.java +108 -0
  7. package/ios/DataDistance.swift +14 -23
  8. package/ios/DataLocation.swift +16 -0
  9. package/ios/DataPOI.swift +11 -0
  10. package/ios/DataRegion.swift +32 -29
  11. package/ios/MarketingCloudEvents.swift +6 -6
  12. package/ios/PluginGeofencing.m +43 -0
  13. package/ios/PluginGeofencing.swift +380 -26
  14. package/ios/WoosmapGeofenceMessage.swift +12 -0
  15. package/ios/WoosmapGeofenceService.swift +203 -30
  16. package/lib/commonjs/index.js +171 -68
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/{Airship.js → internal/Airship.js} +0 -0
  19. package/lib/commonjs/{Airship.js.map → internal/Airship.js.map} +0 -0
  20. package/lib/commonjs/{Location.js → internal/Location.js} +0 -0
  21. package/lib/commonjs/{Location.js.map → internal/Location.js.map} +0 -0
  22. package/lib/commonjs/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
  23. package/lib/commonjs/{MarketingCloud.js.map → internal/MarketingCloud.js.map} +0 -0
  24. package/lib/{module → commonjs/internal}/Poi.js +10 -1
  25. package/lib/commonjs/internal/Poi.js.map +1 -0
  26. package/lib/commonjs/{Region.js → internal/Region.js} +0 -0
  27. package/lib/commonjs/{Region.js.map → internal/Region.js.map} +0 -0
  28. package/lib/commonjs/{Visit.js → internal/Visit.js} +0 -0
  29. package/lib/commonjs/{Visit.js.map → internal/Visit.js.map} +0 -0
  30. package/lib/commonjs/{Zoi.js → internal/Zoi.js} +0 -0
  31. package/lib/commonjs/{Zoi.js.map → internal/Zoi.js.map} +0 -0
  32. package/lib/commonjs/internal/nativeInterface.js +18 -0
  33. package/lib/commonjs/internal/nativeInterface.js.map +1 -0
  34. package/lib/commonjs/internal/types.js +2 -0
  35. package/lib/commonjs/internal/types.js.map +1 -0
  36. package/lib/module/index.js +155 -53
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/{Airship.js → internal/Airship.js} +0 -0
  39. package/lib/module/{Airship.js.map → internal/Airship.js.map} +0 -0
  40. package/lib/module/{Location.js → internal/Location.js} +0 -0
  41. package/lib/module/{Location.js.map → internal/Location.js.map} +0 -0
  42. package/lib/module/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
  43. package/lib/module/{MarketingCloud.js.map → internal/MarketingCloud.js.map} +0 -0
  44. package/lib/{commonjs → module/internal}/Poi.js +2 -3
  45. package/lib/module/internal/Poi.js.map +1 -0
  46. package/lib/module/{Region.js → internal/Region.js} +0 -0
  47. package/lib/module/{Region.js.map → internal/Region.js.map} +0 -0
  48. package/lib/module/{Visit.js → internal/Visit.js} +0 -0
  49. package/lib/module/{Visit.js.map → internal/Visit.js.map} +0 -0
  50. package/lib/module/{Zoi.js → internal/Zoi.js} +0 -0
  51. package/lib/module/{Zoi.js.map → internal/Zoi.js.map} +0 -0
  52. package/lib/module/internal/nativeInterface.js +9 -0
  53. package/lib/module/internal/nativeInterface.js.map +1 -0
  54. package/lib/module/internal/types.js +2 -0
  55. package/lib/module/internal/types.js.map +1 -0
  56. package/lib/typescript/index.d.ts +63 -4
  57. package/lib/typescript/{Airship.d.ts → internal/Airship.d.ts} +0 -0
  58. package/lib/typescript/{Location.d.ts → internal/Location.d.ts} +0 -0
  59. package/lib/typescript/{MarketingCloud.d.ts → internal/MarketingCloud.d.ts} +0 -0
  60. package/lib/typescript/{Poi.d.ts → internal/Poi.d.ts} +4 -2
  61. package/lib/typescript/{Region.d.ts → internal/Region.d.ts} +0 -0
  62. package/lib/typescript/{Visit.d.ts → internal/Visit.d.ts} +0 -0
  63. package/lib/typescript/{Zoi.d.ts → internal/Zoi.d.ts} +0 -0
  64. package/lib/typescript/internal/nativeInterface.d.ts +2 -0
  65. package/lib/typescript/internal/types.d.ts +18 -0
  66. package/package.json +1 -1
  67. package/src/index.tsx +173 -53
  68. package/src/{Airship.tsx → internal/Airship.tsx} +0 -0
  69. package/src/{Location.tsx → internal/Location.tsx} +0 -0
  70. package/src/{MarketingCloud.tsx → internal/MarketingCloud.tsx} +0 -0
  71. package/src/{Poi.tsx → internal/Poi.tsx} +4 -3
  72. package/src/{Region.tsx → internal/Region.tsx} +0 -0
  73. package/src/{Visit.tsx → internal/Visit.tsx} +0 -0
  74. package/src/{Zoi.tsx → internal/Zoi.tsx} +0 -0
  75. package/src/internal/nativeInterface.tsx +8 -0
  76. package/src/internal/types.tsx +20 -0
  77. package/lib/commonjs/Poi.js.map +0 -1
  78. package/lib/module/Poi.js.map +0 -1
package/src/index.tsx CHANGED
@@ -1,46 +1,19 @@
1
- import { NativeModules, NativeEventEmitter } from 'react-native';
1
+ import { NativeEventEmitter } from 'react-native';
2
2
  import uuid from 'react-native-uuid';
3
- import Location from './Location';
4
- import Region from './Region';
5
-
6
- // const LINKING_ERROR =
7
- // `The package 'react-native-plugin-geofencing' doesn't seem to be linked. Make sure: \n\n` +
8
- // Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
9
- // '- You rebuilt the app after installing the package\n' +
10
- // '- You are not using Expo managed workflow\n';
11
-
12
- // const PluginGeofencing = NativeModules.PluginGeofencing
13
- // ? NativeModules.PluginGeofencing
14
- // : new Proxy(
15
- // {},
16
- // {
17
- // get() {
18
- // throw new Error(LINKING_ERROR);
19
- // },
20
- // }
21
- // );
22
-
23
- if (!NativeModules.PluginGeofencing) {
24
- throw new Error('NativeModules.PluginGeofencing is undefined');
25
- }
26
- const PluginGeofencing = NativeModules.PluginGeofencing;
27
- // ? NativeModules.PluginGeofencing
28
- // : new Proxy(
29
- // {},
30
- // {
31
- // get() {
32
- // throw new Error(LINKING_ERROR);
33
- // },
34
- // }
35
- // );
3
+ import PluginGeofencing from './internal/nativeInterface';
4
+ import Location from './internal/Location';
5
+ import Region from './internal/Region';
6
+ import Poi from './internal/Poi';
7
+ import type {
8
+ GeofenceRegion,
9
+ RegionType,
10
+ ProfileSource,
11
+ } from './internal/types';
12
+
36
13
  const eventEmitter = new NativeEventEmitter(PluginGeofencing);
37
14
 
38
15
  let subscriptionsLocation: any = {};
39
16
  let subscriptionsRegion: any = {};
40
-
41
- function multiply(a: number, b: number): Promise<number> {
42
- return PluginGeofencing.multiply(a, b);
43
- }
44
17
  /**
45
18
  * Initializes the Woosmap object
46
19
  * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
@@ -221,9 +194,162 @@ function setSFMCCredentials(arg0: Object): Promise<string> {
221
194
  function setPoiRadius(radius: string): Promise<string> {
222
195
  return PluginGeofencing.setPoiRadius(radius);
223
196
  }
197
+ /**
198
+ * Adds a custom region that you want to monitor.
199
+ * @param region A GeofenceRegion object with latitude, longitude, radius and type.
200
+ * @returns promise with A callback that will be called on success or error.
201
+ */
202
+
203
+ function addRegion(region: GeofenceRegion): Promise<string> {
204
+ return PluginGeofencing.addRegion(region);
205
+ }
206
+ /**
207
+ * Retrieve saved region info
208
+ * @param regionID If it pass return info for given region or return all region info
209
+ * @returns promise with A callback that will be called on success or error.
210
+ */
211
+ function getRegions(regionID?: string): Promise<Region[]> {
212
+ if (regionID == null) {
213
+ return PluginGeofencing.getAllRegions()
214
+ .then((result: any[]) => {
215
+ var formatted: Region[] = [];
216
+ result.forEach((item) => {
217
+ formatted.push(Region.jsonToObj(item));
218
+ });
219
+ return Promise.resolve(formatted);
220
+ })
221
+ .catch((e: any) => {
222
+ return Promise.reject(e);
223
+ });
224
+ } else {
225
+ return PluginGeofencing.getRegions(regionID)
226
+ .then((result: any) => {
227
+ var formatted: Region[] = [];
228
+ formatted.push(Region.jsonToObj(result));
229
+ return Promise.resolve(formatted);
230
+ })
231
+ .catch((e: any) => {
232
+ return Promise.reject(e);
233
+ });
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Retrieve saved location info
239
+ * @param locationID - Optional in case of location id pass it return only that location info
240
+ * @returns promise with A callback that will be called on success or error.
241
+ */
242
+ function getLocations(locationID?: string): Promise<Location[]> {
243
+ if (locationID == null) {
244
+ return PluginGeofencing.getAllLocations()
245
+ .then((result: any[]) => {
246
+ var formatted: Location[] = [];
247
+ result.forEach((item) => {
248
+ formatted.push(Location.jsonToObj(item));
249
+ });
250
+ return Promise.resolve(formatted);
251
+ })
252
+ .catch((e: any) => {
253
+ return Promise.reject(e);
254
+ });
255
+ } else {
256
+ return PluginGeofencing.getLocation(locationID)
257
+ .then((result: any) => {
258
+ var formatted: Location[] = [];
259
+ formatted.push(Location.jsonToObj(result));
260
+ return Promise.resolve(formatted);
261
+ })
262
+ .catch((e: any) => {
263
+ return Promise.reject(e);
264
+ });
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Retrieve saved POI info
270
+ * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
271
+ * @returns promise with A callback that will be called on success or error.
272
+ */
273
+ function getPois(poiID?: string): Promise<Poi[]> {
274
+ if (poiID == null) {
275
+ return PluginGeofencing.getAllPois()
276
+ .then((result: any[]) => {
277
+ var formatted: Poi[] = [];
278
+ result.forEach((item) => {
279
+ formatted.push(Poi.jsonToObj(item));
280
+ });
281
+ return Promise.resolve(formatted);
282
+ })
283
+ .catch((e: any) => {
284
+ return Promise.reject(e);
285
+ });
286
+ } else {
287
+ return PluginGeofencing.getPoi(poiID)
288
+ .then((result: any) => {
289
+ var formatted: Poi[] = [];
290
+ formatted.push(Poi.jsonToObj(result));
291
+ return Promise.resolve(formatted);
292
+ })
293
+ .catch((e: any) => {
294
+ return Promise.reject(e);
295
+ });
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Remove saved region info
301
+ * @param regionID If it pass remove info for given region or removes all region info
302
+ * @returns promise with A callback that will be called on success or error.
303
+ */
304
+ function removeRegions(regionID?: string): Promise<string> {
305
+ if (regionID == null) {
306
+ return PluginGeofencing.removeAllRegions();
307
+ } else {
308
+ return PluginGeofencing.removeRegion(regionID);
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Remove saved location info
314
+ * @returns promise with A callback that will be called on success or error.
315
+ */
316
+ function removeLocations(): Promise<string> {
317
+ return PluginGeofencing.removeAllLocations();
318
+ }
319
+
320
+ /**
321
+ * Remove saved POI info
322
+ * @returns promise with A callback that will be called on success or error.
323
+ */
324
+ function removePois(): Promise<string> {
325
+ return PluginGeofencing.removeAllPois();
326
+ }
327
+ /**
328
+ * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
329
+ * There are two way to host the json file:
330
+ * - included in the client application (local)
331
+ * - hosted externally in a file folder in your information system (external)
332
+ * @param sourceType local/external
333
+ * @param source location of profile to be fetch
334
+ * @returns promise with A callback that will be called on success or error.
335
+ */
336
+ function startCustomTracking(
337
+ sourceType: ProfileSource,
338
+ source: string
339
+ ): Promise<string> {
340
+ return PluginGeofencing.startCustomTracking(sourceType, source);
341
+ }
342
+
343
+ export type {
344
+ RegionType,
345
+ GeofenceRegion,
346
+ Region,
347
+ Location,
348
+ Poi,
349
+ ProfileSource,
350
+ };
224
351
 
225
352
  const WoosmapGeofencing = {
226
- multiply,
227
353
  initialize,
228
354
  setWoosmapApiKey,
229
355
  startTracking,
@@ -236,20 +362,14 @@ const WoosmapGeofencing = {
236
362
  clearRegionsWatch,
237
363
  setSFMCCredentials,
238
364
  setPoiRadius,
365
+ addRegion,
366
+ getRegions,
367
+ removeRegions,
368
+ getLocations,
369
+ removeLocations,
370
+ getPois,
371
+ removePois,
372
+ startCustomTracking,
239
373
  };
240
374
 
241
- /* We export the native interface in this way to give easy shared access to it between the
242
- * JavaScript code and the tests
243
- */
244
- //let nativeEventEmitter: NativeEventEmitter | null = null;
245
-
246
375
  export default WoosmapGeofencing;
247
- // module.exports = {
248
- // WoosmapGeofencing,
249
- // get GeolocationEventEmitter() {
250
- // if (!nativeEventEmitter) {
251
- // nativeEventEmitter = new NativeEventEmitter(PluginGeofencing);
252
- // }
253
- // return nativeEventEmitter;
254
- // },
255
- // };
File without changes
File without changes
@@ -10,6 +10,7 @@
10
10
  * @param {number} distance The distance between the POI and the user's location.
11
11
  * @param {number} duration The duration to travel to the POI from the user's location.
12
12
  * @param {number} latitude The latitude of the POI.
13
+ * @param {string} locationid Location id of the POI.
13
14
  * @param {number} longitude The longitude of the POI.
14
15
  * @param {string} zipcode The zip code of the POI.
15
16
  * @param {number} radius The radius of the POI.
@@ -28,7 +29,7 @@ class Poi {
28
29
  Distance: number;
29
30
  Duration: number;
30
31
  Latitude: number;
31
- Locationid: number;
32
+ Locationid: string;
32
33
  Longitude: number;
33
34
  Zipcode: string;
34
35
  Radius: number;
@@ -46,7 +47,7 @@ class Poi {
46
47
  distance: number,
47
48
  duration: number,
48
49
  latitude: number,
49
- locationid: number,
50
+ locationid: string,
50
51
  longitude: number,
51
52
  zipcode: string,
52
53
  radius: number,
@@ -103,4 +104,4 @@ class Poi {
103
104
  );
104
105
  }
105
106
  }
106
- module.exports = Poi;
107
+ export default Poi;
File without changes
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ import { NativeModules } from 'react-native';
2
+ let PluginGeofencing = NativeModules.PluginGeofencing;
3
+
4
+ if (!PluginGeofencing) {
5
+ throw new Error('NativeModules.PluginGeofencing is undefined');
6
+ }
7
+
8
+ export default PluginGeofencing;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Geofence region types
3
+ */
4
+ export type RegionType = 'circle' | 'isochrone';
5
+
6
+ /**
7
+ * Location of custom profile to fetch
8
+ */
9
+ export type ProfileSource = 'local' | 'external';
10
+
11
+ /**
12
+ * GeofenceRegion structure
13
+ */
14
+ export interface GeofenceRegion {
15
+ regionId: string;
16
+ lat: number;
17
+ lng: number;
18
+ radius: number;
19
+ type: RegionType;
20
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Poi.tsx"],"names":["Poi","constructor","jsondata","city","idstore","name","date","distance","duration","latitude","locationid","longitude","zipcode","radius","address","countrycode","tags","types","contact","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json","module","exports"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,GAAN,CAAU;AAkBRC,EAAAA,WAAW,CACTC,QADS,EAETC,IAFS,EAGTC,OAHS,EAITC,IAJS,EAKTC,IALS,EAMTC,QANS,EAOTC,QAPS,EAQTC,QARS,EASTC,UATS,EAUTC,SAVS,EAWTC,OAXS,EAYTC,MAZS,EAaTC,OAbS,EAcTC,WAdS,EAeTC,IAfS,EAgBTC,KAhBS,EAiBTC,OAjBS,EAkBT;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACA,SAAKC,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,UAAL,GAAkBjB,UAAlB;AACA,SAAKkB,SAAL,GAAiBjB,SAAjB;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,MAAL,GAAcjB,MAAd;AACA,SAAKQ,OAAL,GAAejB,OAAf;AACA,SAAK2B,WAAL,GAAmBhB,WAAnB;AACA,SAAKiB,IAAL,GAAYhB,IAAZ;AACA,SAAKiB,KAAL,GAAahB,KAAb;AACA,SAAKiB,OAAL,GAAehB,OAAf;AACA,SAAKiB,OAAL,GAAerB,OAAf;AACD;AACD;AACF;AACA;AACA;AACA;AACA;;;AACkB,SAATsB,SAAS,CAACC,IAAD,EAAY;AAC1B,WAAO,IAAIrC,GAAJ,CACLqC,IAAI,CAACnC,QADA,EAELmC,IAAI,CAAClC,IAFA,EAGLkC,IAAI,CAACjC,OAHA,EAILiC,IAAI,CAAChC,IAJA,EAKLgC,IAAI,CAAC/B,IALA,EAML+B,IAAI,CAAC9B,QANA,EAOL8B,IAAI,CAAC7B,QAPA,EAQL6B,IAAI,CAAC5B,QARA,EASL4B,IAAI,CAAC3B,UATA,EAUL2B,IAAI,CAAC1B,SAVA,EAWL0B,IAAI,CAACzB,OAXA,EAYLyB,IAAI,CAACxB,MAZA,EAaLwB,IAAI,CAACvB,OAbA,EAcLuB,IAAI,CAACtB,WAdA,EAeLsB,IAAI,CAACrB,IAfA,EAgBLqB,IAAI,CAACpB,KAhBA,EAiBLoB,IAAI,CAACnB,OAjBA,CAAP;AAmBD;;AAlFO;;AAoFVoB,MAAM,CAACC,OAAP,GAAiBvC,GAAjB","sourcesContent":["/**\n * A class that represents the POI object.\n * @classdesc A class that represents the POI object.\n * @constructs Poi\n * @param {Object} jsonData A json object representing the POI.\n * @param {string} city The name of the city the POI belongs to.\n * @param {string} idstore A unique identifier for the POI.\n * @param {name} name The name of the POI.\n * @param {number} date The datetime stamp.\n * @param {number} distance The distance between the POI and the user's location.\n * @param {number} duration The duration to travel to the POI from the user's location.\n * @param {number} latitude The latitude of the POI.\n * @param {number} longitude The longitude of the POI.\n * @param {string} zipcode The zip code of the POI.\n * @param {number} radius The radius of the POI.\n * @param {string} address The address of the POI.\n * @param {string} countrycode The countrycode of the POI.\n * @param {string} tags The tags for the POI.\n * @param {string} types The types of the POI.\n * @param {string} contact The contact for the POI.\n */\nclass Poi {\n Jsondata: object;\n City: string;\n Idstore: string;\n Name: string;\n Date: number;\n Distance: number;\n Duration: number;\n Latitude: number;\n Locationid: number;\n Longitude: number;\n Zipcode: string;\n Radius: number;\n Countrycode: string;\n Tags: string;\n Types: string;\n Contact: string;\n Address: string;\n constructor(\n jsondata: object,\n city: string,\n idstore: string,\n name: string,\n date: number,\n distance: number,\n duration: number,\n latitude: number,\n locationid: number,\n longitude: number,\n zipcode: string,\n radius: number,\n address: string,\n countrycode: string,\n tags: string,\n types: string,\n contact: string\n ) {\n this.Jsondata = jsondata;\n this.City = city;\n this.Idstore = idstore;\n this.Name = name;\n this.Date = date;\n this.Distance = distance;\n this.Duration = duration;\n this.Latitude = latitude;\n this.Locationid = locationid;\n this.Longitude = longitude;\n this.Zipcode = zipcode;\n this.Radius = radius;\n this.Idstore = idstore;\n this.Countrycode = countrycode;\n this.Tags = tags;\n this.Types = types;\n this.Contact = contact;\n this.Address = address;\n }\n /**\n * Converts json object to an object of type Poi.\n * @param {Object} json The json representation of the Poi.\n * @returns Object\n * @memberof Poi\n */\n static jsonToObj(json: any) {\n return new Poi(\n json.jsondata,\n json.city,\n json.idstore,\n json.name,\n json.date,\n json.distance,\n json.duration,\n json.latitude,\n json.locationid,\n json.longitude,\n json.zipcode,\n json.radius,\n json.address,\n json.countrycode,\n json.tags,\n json.types,\n json.contact\n );\n }\n}\nmodule.exports = Poi;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Poi.tsx"],"names":["Poi","constructor","jsondata","city","idstore","name","date","distance","duration","latitude","locationid","longitude","zipcode","radius","address","countrycode","tags","types","contact","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json","module","exports"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,GAAN,CAAU;AAkBRC,EAAAA,WAAW,CACTC,QADS,EAETC,IAFS,EAGTC,OAHS,EAITC,IAJS,EAKTC,IALS,EAMTC,QANS,EAOTC,QAPS,EAQTC,QARS,EASTC,UATS,EAUTC,SAVS,EAWTC,OAXS,EAYTC,MAZS,EAaTC,OAbS,EAcTC,WAdS,EAeTC,IAfS,EAgBTC,KAhBS,EAiBTC,OAjBS,EAkBT;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACA,SAAKC,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,UAAL,GAAkBjB,UAAlB;AACA,SAAKkB,SAAL,GAAiBjB,SAAjB;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,MAAL,GAAcjB,MAAd;AACA,SAAKQ,OAAL,GAAejB,OAAf;AACA,SAAK2B,WAAL,GAAmBhB,WAAnB;AACA,SAAKiB,IAAL,GAAYhB,IAAZ;AACA,SAAKiB,KAAL,GAAahB,KAAb;AACA,SAAKiB,OAAL,GAAehB,OAAf;AACA,SAAKiB,OAAL,GAAerB,OAAf;AACD;AACD;AACF;AACA;AACA;AACA;AACA;;;AACkB,SAATsB,SAAS,CAACC,IAAD,EAAY;AAC1B,WAAO,IAAIrC,GAAJ,CACLqC,IAAI,CAACnC,QADA,EAELmC,IAAI,CAAClC,IAFA,EAGLkC,IAAI,CAACjC,OAHA,EAILiC,IAAI,CAAChC,IAJA,EAKLgC,IAAI,CAAC/B,IALA,EAML+B,IAAI,CAAC9B,QANA,EAOL8B,IAAI,CAAC7B,QAPA,EAQL6B,IAAI,CAAC5B,QARA,EASL4B,IAAI,CAAC3B,UATA,EAUL2B,IAAI,CAAC1B,SAVA,EAWL0B,IAAI,CAACzB,OAXA,EAYLyB,IAAI,CAACxB,MAZA,EAaLwB,IAAI,CAACvB,OAbA,EAcLuB,IAAI,CAACtB,WAdA,EAeLsB,IAAI,CAACrB,IAfA,EAgBLqB,IAAI,CAACpB,KAhBA,EAiBLoB,IAAI,CAACnB,OAjBA,CAAP;AAmBD;;AAlFO;;AAoFVoB,MAAM,CAACC,OAAP,GAAiBvC,GAAjB","sourcesContent":["/**\n * A class that represents the POI object.\n * @classdesc A class that represents the POI object.\n * @constructs Poi\n * @param {Object} jsonData A json object representing the POI.\n * @param {string} city The name of the city the POI belongs to.\n * @param {string} idstore A unique identifier for the POI.\n * @param {name} name The name of the POI.\n * @param {number} date The datetime stamp.\n * @param {number} distance The distance between the POI and the user's location.\n * @param {number} duration The duration to travel to the POI from the user's location.\n * @param {number} latitude The latitude of the POI.\n * @param {number} longitude The longitude of the POI.\n * @param {string} zipcode The zip code of the POI.\n * @param {number} radius The radius of the POI.\n * @param {string} address The address of the POI.\n * @param {string} countrycode The countrycode of the POI.\n * @param {string} tags The tags for the POI.\n * @param {string} types The types of the POI.\n * @param {string} contact The contact for the POI.\n */\nclass Poi {\n Jsondata: object;\n City: string;\n Idstore: string;\n Name: string;\n Date: number;\n Distance: number;\n Duration: number;\n Latitude: number;\n Locationid: number;\n Longitude: number;\n Zipcode: string;\n Radius: number;\n Countrycode: string;\n Tags: string;\n Types: string;\n Contact: string;\n Address: string;\n constructor(\n jsondata: object,\n city: string,\n idstore: string,\n name: string,\n date: number,\n distance: number,\n duration: number,\n latitude: number,\n locationid: number,\n longitude: number,\n zipcode: string,\n radius: number,\n address: string,\n countrycode: string,\n tags: string,\n types: string,\n contact: string\n ) {\n this.Jsondata = jsondata;\n this.City = city;\n this.Idstore = idstore;\n this.Name = name;\n this.Date = date;\n this.Distance = distance;\n this.Duration = duration;\n this.Latitude = latitude;\n this.Locationid = locationid;\n this.Longitude = longitude;\n this.Zipcode = zipcode;\n this.Radius = radius;\n this.Idstore = idstore;\n this.Countrycode = countrycode;\n this.Tags = tags;\n this.Types = types;\n this.Contact = contact;\n this.Address = address;\n }\n /**\n * Converts json object to an object of type Poi.\n * @param {Object} json The json representation of the Poi.\n * @returns Object\n * @memberof Poi\n */\n static jsonToObj(json: any) {\n return new Poi(\n json.jsondata,\n json.city,\n json.idstore,\n json.name,\n json.date,\n json.distance,\n json.duration,\n json.latitude,\n json.locationid,\n json.longitude,\n json.zipcode,\n json.radius,\n json.address,\n json.countrycode,\n json.tags,\n json.types,\n json.contact\n );\n }\n}\nmodule.exports = Poi;\n"]}