@woosmap/react-native-plugin-geofencing 0.1.20 → 0.1.22

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 (54) hide show
  1. package/ios/WoosmapGeofenceService.swift +6 -2
  2. package/lib/commonjs/index.js +333 -0
  3. package/lib/commonjs/index.js.map +1 -0
  4. package/lib/commonjs/internal/Airship.js +28 -0
  5. package/lib/commonjs/internal/Airship.js.map +1 -0
  6. package/lib/commonjs/internal/Location.js +43 -0
  7. package/lib/commonjs/internal/Location.js.map +1 -0
  8. package/lib/commonjs/internal/MarketingCloud.js +28 -0
  9. package/lib/commonjs/internal/MarketingCloud.js.map +1 -0
  10. package/lib/commonjs/internal/Poi.js +80 -0
  11. package/lib/commonjs/internal/Poi.js.map +1 -0
  12. package/lib/commonjs/internal/Region.js +52 -0
  13. package/lib/commonjs/internal/Region.js.map +1 -0
  14. package/lib/commonjs/internal/Visit.js +39 -0
  15. package/lib/commonjs/internal/Visit.js.map +1 -0
  16. package/lib/commonjs/internal/Zoi.js +75 -0
  17. package/lib/commonjs/internal/Zoi.js.map +1 -0
  18. package/lib/commonjs/internal/nativeInterface.js +14 -0
  19. package/lib/commonjs/internal/nativeInterface.js.map +1 -0
  20. package/lib/commonjs/internal/types.js +2 -0
  21. package/lib/commonjs/internal/types.js.map +1 -0
  22. package/lib/module/index.js +325 -0
  23. package/lib/module/index.js.map +1 -0
  24. package/lib/module/internal/Airship.js +26 -0
  25. package/lib/module/internal/Airship.js.map +1 -0
  26. package/lib/module/internal/Location.js +36 -0
  27. package/lib/module/internal/Location.js.map +1 -0
  28. package/lib/module/internal/MarketingCloud.js +26 -0
  29. package/lib/module/internal/MarketingCloud.js.map +1 -0
  30. package/lib/module/internal/Poi.js +73 -0
  31. package/lib/module/internal/Poi.js.map +1 -0
  32. package/lib/module/internal/Region.js +45 -0
  33. package/lib/module/internal/Region.js.map +1 -0
  34. package/lib/module/internal/Visit.js +37 -0
  35. package/lib/module/internal/Visit.js.map +1 -0
  36. package/lib/module/internal/Zoi.js +73 -0
  37. package/lib/module/internal/Zoi.js.map +1 -0
  38. package/lib/module/internal/nativeInterface.js +7 -0
  39. package/lib/module/internal/nativeInterface.js.map +1 -0
  40. package/lib/module/internal/types.js +2 -0
  41. package/lib/module/internal/types.js.map +1 -0
  42. package/lib/typescript/__tests__/index.test.d.ts +0 -0
  43. package/lib/typescript/index.d.ts +156 -0
  44. package/lib/typescript/internal/Airship.d.ts +18 -0
  45. package/lib/typescript/internal/Location.d.ts +26 -0
  46. package/lib/typescript/internal/MarketingCloud.d.ts +18 -0
  47. package/lib/typescript/internal/Poi.d.ts +50 -0
  48. package/lib/typescript/internal/Region.d.ts +32 -0
  49. package/lib/typescript/internal/Visit.d.ts +25 -0
  50. package/lib/typescript/internal/Zoi.d.ts +49 -0
  51. package/lib/typescript/internal/nativeInterface.d.ts +2 -0
  52. package/lib/typescript/internal/types.d.ts +18 -0
  53. package/package.json +145 -1
  54. package/CHANGELOG.md +0 -8
@@ -104,13 +104,17 @@ import AirshipCore
104
104
 
105
105
  /// This callback received when application become active
106
106
  @objc func appDidBecomeActive() {
107
- WoosmapGeofencing.shared.didBecomeActive()
107
+ DispatchQueue.main.async {
108
+ WoosmapGeofencing.shared.didBecomeActive()
109
+ }
108
110
  }
109
111
 
110
112
  /// This callback recived when application enter in background mode
111
113
  @objc func appDidEnterBackground() {
112
114
  if CLLocationManager.authorizationStatus() != .notDetermined {
113
- WoosmapGeofencing.shared.startMonitoringInBackground()
115
+ DispatchQueue.main.async {
116
+ WoosmapGeofencing.shared.startMonitoringInBackground()
117
+ }
114
118
  }
115
119
  }
116
120
 
@@ -0,0 +1,333 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
9
+ var _nativeInterface = _interopRequireDefault(require("./internal/nativeInterface"));
10
+ var _Location = _interopRequireDefault(require("./internal/Location"));
11
+ var _Region = _interopRequireDefault(require("./internal/Region"));
12
+ var _Poi = _interopRequireDefault(require("./internal/Poi"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ const eventEmitter = new _reactNative.NativeEventEmitter(_nativeInterface.default);
15
+ let subscriptionsLocation = {};
16
+ let subscriptionsRegion = {};
17
+ /**
18
+ * Initializes the Woosmap object
19
+ * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
20
+ * @returns promise:success - A callback function that will be called on success.
21
+ error - A callback function that will be called on error.
22
+ */
23
+ function initialize(arg0) {
24
+ if (arg0 == null) {
25
+ arg0 = {};
26
+ }
27
+ return _nativeInterface.default.initialize(arg0);
28
+ }
29
+
30
+ /**
31
+ * A method that sets Woosmap private API key
32
+ * @param apiKey new API key.
33
+ * @returns promise:success - A callback function that will be called on success.
34
+ error - A callback function that will be called on error.
35
+ */
36
+ function setWoosmapApiKey(apiKey) {
37
+ return _nativeInterface.default.setWoosmapApiKey([apiKey]);
38
+ }
39
+
40
+ /**
41
+ * A method to start tracking the user's location.
42
+ * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.
43
+ * @returns promise:success - A callback function that will be called on success.
44
+ error - A callback function that will be called on error.
45
+ */
46
+ function startTracking(trackingProfile) {
47
+ return _nativeInterface.default.startTracking([trackingProfile]);
48
+ }
49
+
50
+ /**
51
+ * Stops tracking the user's location.
52
+ * @returns promise:success - A callback function that will be called on success.
53
+ error - A callback function that will be called on error.
54
+ */
55
+ function stopTracking() {
56
+ return _nativeInterface.default.stopTracking();
57
+ }
58
+
59
+ /**
60
+ * A method to request the required permissions to collect locations.
61
+ * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.
62
+ * @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission. The plugin will return an object with a message - 'Permission Denied'.
63
+ */
64
+ function requestPermissions(background) {
65
+ if (background == null) {
66
+ background = false;
67
+ }
68
+ return _nativeInterface.default.requestPermissions([background]);
69
+ }
70
+
71
+ /**
72
+ * A method to check if the app has granted required permissions to track location.
73
+ * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED
74
+ */
75
+ function getPermissionsStatus() {
76
+ return _nativeInterface.default.getPermissionsStatus();
77
+ }
78
+
79
+ /**
80
+ * Method will
81
+ invoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.
82
+ * @param success new location found callback
83
+ * @param error error status callback
84
+ * @returns watchid
85
+ */
86
+ function watchLocation(success, error) {
87
+ const watchID = _reactNativeUuid.default.v1().toString();
88
+ const successCallback = result => {
89
+ success(_Location.default.jsonToObj(result));
90
+ };
91
+ subscriptionsLocation[watchID] = [eventEmitter.addListener('geolocationDidChange', successCallback), error ? eventEmitter.addListener('geolocationError', error) : null];
92
+ return _nativeInterface.default.watchLocation(watchID);
93
+ }
94
+
95
+ /**
96
+ * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.
97
+ * @param watchID Reference ID.
98
+ * @returns return promise with same id back in case of success otherwise error info
99
+ */
100
+ function clearLocationWatch(watchID) {
101
+ if (watchID == null) {
102
+ eventEmitter.removeAllListeners('geolocationDidChange');
103
+ eventEmitter.removeAllListeners('geolocationError');
104
+ subscriptionsLocation = {};
105
+ return _nativeInterface.default.clearAllLocationWatch();
106
+ } else {
107
+ const saved = subscriptionsLocation[watchID];
108
+ if (saved) {
109
+ const arg0 = saved[0];
110
+ eventEmitter.removeListener('geolocationDidChange', arg0);
111
+ const arg1 = saved[1];
112
+ if (arg1) {
113
+ eventEmitter.removeListener('geolocationError', arg1);
114
+ }
115
+ subscriptionsLocation[watchID] = undefined;
116
+ }
117
+ return _nativeInterface.default.clearLocationWatch(watchID);
118
+ }
119
+ }
120
+
121
+ /**
122
+ * A method to to track Regions. Method will invoke a callback with Region object. Method will return
123
+ a watch id which can be used later to remove the callback.
124
+ * @param success new location found callback
125
+ * @param error error status callback
126
+ * @returns watchid
127
+ */
128
+ function watchRegions(success, error) {
129
+ const watchID = _reactNativeUuid.default.v1().toString();
130
+ const successCallback = result => {
131
+ success(_Region.default.jsonToObj(result));
132
+ };
133
+ subscriptionsRegion[watchID] = [eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback), error ? eventEmitter.addListener('woosmapgeofenceRegionError', error) : null];
134
+ return _nativeInterface.default.watchRegions(watchID);
135
+ }
136
+
137
+ /**
138
+ * A method to clear the specified watch tracing the regions. If the watchId is null or undefined then it will clear all the watches tracking the regions.
139
+ * @param watchID Reference ID.
140
+ * @returns return promise with same id back in case of success otherwise error info
141
+ */
142
+ function clearRegionsWatch(watchID) {
143
+ if (watchID == null) {
144
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');
145
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionError');
146
+ subscriptionsRegion = {};
147
+ return _nativeInterface.default.clearAllRegionsWatch();
148
+ } else {
149
+ const saved = subscriptionsRegion[watchID];
150
+ if (saved) {
151
+ const arg0 = saved[0];
152
+ eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);
153
+ const arg1 = saved[1];
154
+ if (arg1) {
155
+ eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);
156
+ }
157
+ subscriptionsRegion[watchID] = undefined;
158
+ }
159
+ return _nativeInterface.default.clearRegionsWatch(watchID);
160
+ }
161
+ }
162
+ /**
163
+ * Sets Sales Force Marketing Cloud (SFMC) credentials
164
+ * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.
165
+ * @returns promise with A callback that will be called on success or error.
166
+ */
167
+ function setSFMCCredentials(arg0) {
168
+ return _nativeInterface.default.setSFMCCredentials(arg0);
169
+ }
170
+
171
+ /**
172
+ * When you create a geofence around a POI, manually define the radius value (100.0) or choose the user_properties subfield that corresponds to radius value of the geofence ("radiusPOI").
173
+ * @param radius can be integer or string.
174
+ * @returns promise with A callback that will be called on success or error.
175
+ */
176
+ function setPoiRadius(radius) {
177
+ return _nativeInterface.default.setPoiRadius(radius);
178
+ }
179
+ /**
180
+ * Adds a custom region that you want to monitor.
181
+ * @param region A GeofenceRegion object with latitude, longitude, radius and type.
182
+ * @returns promise with A callback that will be called on success or error.
183
+ */
184
+
185
+ function addRegion(region) {
186
+ return _nativeInterface.default.addRegion(region);
187
+ }
188
+ /**
189
+ * Retrieve saved region info
190
+ * @param regionID If it pass return info for given region or return all region info
191
+ * @returns promise with A callback that will be called on success or error.
192
+ */
193
+ function getRegions(regionID) {
194
+ if (regionID == null) {
195
+ return _nativeInterface.default.getAllRegions().then(result => {
196
+ var formatted = [];
197
+ result.forEach(item => {
198
+ formatted.push(_Region.default.jsonToObj(item));
199
+ });
200
+ return Promise.resolve(formatted);
201
+ }).catch(e => {
202
+ return Promise.reject(e);
203
+ });
204
+ } else {
205
+ return _nativeInterface.default.getRegions(regionID).then(result => {
206
+ var formatted = [];
207
+ formatted.push(_Region.default.jsonToObj(result));
208
+ return Promise.resolve(formatted);
209
+ }).catch(e => {
210
+ return Promise.reject(e);
211
+ });
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Retrieve saved location info
217
+ * @param locationID - Optional in case of location id pass it return only that location info
218
+ * @returns promise with A callback that will be called on success or error.
219
+ */
220
+ function getLocations(locationID) {
221
+ if (locationID == null) {
222
+ return _nativeInterface.default.getAllLocations().then(result => {
223
+ var formatted = [];
224
+ result.forEach(item => {
225
+ formatted.push(_Location.default.jsonToObj(item));
226
+ });
227
+ return Promise.resolve(formatted);
228
+ }).catch(e => {
229
+ return Promise.reject(e);
230
+ });
231
+ } else {
232
+ return _nativeInterface.default.getLocation(locationID).then(result => {
233
+ var formatted = [];
234
+ formatted.push(_Location.default.jsonToObj(result));
235
+ return Promise.resolve(formatted);
236
+ }).catch(e => {
237
+ return Promise.reject(e);
238
+ });
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Retrieve saved POI info
244
+ * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
245
+ * @returns promise with A callback that will be called on success or error.
246
+ */
247
+ function getPois(poiID) {
248
+ if (poiID == null) {
249
+ return _nativeInterface.default.getAllPois().then(result => {
250
+ var formatted = [];
251
+ result.forEach(item => {
252
+ formatted.push(_Poi.default.jsonToObj(item));
253
+ });
254
+ return Promise.resolve(formatted);
255
+ }).catch(e => {
256
+ return Promise.reject(e);
257
+ });
258
+ } else {
259
+ return _nativeInterface.default.getPoi(poiID).then(result => {
260
+ var formatted = [];
261
+ formatted.push(_Poi.default.jsonToObj(result));
262
+ return Promise.resolve(formatted);
263
+ }).catch(e => {
264
+ return Promise.reject(e);
265
+ });
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Remove saved region info
271
+ * @param regionID If it pass remove info for given region or removes all region info
272
+ * @returns promise with A callback that will be called on success or error.
273
+ */
274
+ function removeRegions(regionID) {
275
+ if (regionID == null) {
276
+ return _nativeInterface.default.removeAllRegions();
277
+ } else {
278
+ return _nativeInterface.default.removeRegion(regionID);
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Remove saved location info
284
+ * @returns promise with A callback that will be called on success or error.
285
+ */
286
+ function removeLocations() {
287
+ return _nativeInterface.default.removeAllLocations();
288
+ }
289
+
290
+ /**
291
+ * Remove saved POI info
292
+ * @returns promise with A callback that will be called on success or error.
293
+ */
294
+ function removePois() {
295
+ return _nativeInterface.default.removeAllPois();
296
+ }
297
+ /**
298
+ * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
299
+ * There are two way to host the json file:
300
+ * - included in the client application (local)
301
+ * - hosted externally in a file folder in your information system (external)
302
+ * @param sourceType local/external
303
+ * @param source location of profile to be fetch
304
+ * @returns promise with A callback that will be called on success or error.
305
+ */
306
+ function startCustomTracking(sourceType, source) {
307
+ return _nativeInterface.default.startCustomTracking(sourceType, source);
308
+ }
309
+ const WoosmapGeofencing = {
310
+ initialize,
311
+ setWoosmapApiKey,
312
+ startTracking,
313
+ requestPermissions,
314
+ getPermissionsStatus,
315
+ stopTracking,
316
+ watchLocation,
317
+ clearLocationWatch,
318
+ watchRegions,
319
+ clearRegionsWatch,
320
+ setSFMCCredentials,
321
+ setPoiRadius,
322
+ addRegion,
323
+ getRegions,
324
+ removeRegions,
325
+ getLocations,
326
+ removeLocations,
327
+ getPois,
328
+ removePois,
329
+ startCustomTracking
330
+ };
331
+ var _default = WoosmapGeofencing;
332
+ exports.default = _default;
333
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["eventEmitter","NativeEventEmitter","PluginGeofencing","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","uuid","v1","toString","successCallback","result","Location","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","Region","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","addRegion","region","getRegions","regionID","getAllRegions","then","formatted","forEach","item","push","Promise","resolve","catch","e","reject","getLocations","locationID","getAllLocations","getLocation","getPois","poiID","getAllPois","Poi","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","WoosmapGeofencing"],"sources":["index.tsx"],"sourcesContent":["import { NativeEventEmitter } from 'react-native';\nimport uuid from 'react-native-uuid';\nimport PluginGeofencing from './internal/nativeInterface';\nimport Location from './internal/Location';\nimport Region from './internal/Region';\nimport Poi from './internal/Poi';\nimport type {\n GeofenceRegion,\n RegionType,\n ProfileSource,\n} from './internal/types';\n\nconst eventEmitter = new NativeEventEmitter(PluginGeofencing);\n\nlet subscriptionsLocation: any = {};\nlet subscriptionsRegion: any = {};\n/**\n * Initializes the Woosmap object\n * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction initialize(arg0?: any): Promise<string> {\n if (arg0 == null) {\n arg0 = {};\n }\n return PluginGeofencing.initialize(arg0);\n}\n\n/**\n * A method that sets Woosmap private API key\n * @param apiKey new API key.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction setWoosmapApiKey(apiKey: string): Promise<string> {\n return PluginGeofencing.setWoosmapApiKey([apiKey]);\n}\n\n/**\n * A method to start tracking the user's location.\n * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction startTracking(trackingProfile: string): Promise<string> {\n return PluginGeofencing.startTracking([trackingProfile]);\n}\n\n/**\n * Stops tracking the user's location.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction stopTracking(): Promise<string> {\n return PluginGeofencing.stopTracking();\n}\n\n/**\n * A method to request the required permissions to collect locations.\n * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.\n * @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission. The plugin will return an object with a message - 'Permission Denied'.\n */\nfunction requestPermissions(background?: boolean): Promise<string> {\n if (background == null) {\n background = false;\n }\n return PluginGeofencing.requestPermissions([background]);\n}\n\n/**\n * A method to check if the app has granted required permissions to track location.\n * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED\n */\nfunction getPermissionsStatus(): Promise<string> {\n return PluginGeofencing.getPermissionsStatus();\n}\n\n/**\n * Method will\ninvoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchLocation(\n success: (result: Location) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Location.jsonToObj(result));\n };\n\n subscriptionsLocation[watchID] = [\n eventEmitter.addListener('geolocationDidChange', successCallback),\n error ? eventEmitter.addListener('geolocationError', error) : null,\n ];\n return PluginGeofencing.watchLocation(watchID);\n}\n\n/**\n * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearLocationWatch(watchID?: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('geolocationDidChange');\n eventEmitter.removeAllListeners('geolocationError');\n subscriptionsLocation = {};\n return PluginGeofencing.clearAllLocationWatch();\n } else {\n const saved = subscriptionsLocation[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('geolocationDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('geolocationError', arg1);\n }\n subscriptionsLocation[watchID] = undefined;\n }\n return PluginGeofencing.clearLocationWatch(watchID);\n }\n}\n\n/**\n * A method to to track Regions. Method will invoke a callback with Region object. Method will return\na watch id which can be used later to remove the callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchRegions(\n success: (result: Region) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Region.jsonToObj(result));\n };\n\n subscriptionsRegion[watchID] = [\n eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback),\n error\n ? eventEmitter.addListener('woosmapgeofenceRegionError', error)\n : null,\n ];\n return PluginGeofencing.watchRegions(watchID);\n}\n\n/**\n * A method to clear the specified watch tracing the regions. If the watchId is null or undefined then it will clear all the watches tracking the regions.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearRegionsWatch(watchID: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');\n eventEmitter.removeAllListeners('woosmapgeofenceRegionError');\n subscriptionsRegion = {};\n return PluginGeofencing.clearAllRegionsWatch();\n } else {\n const saved = subscriptionsRegion[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);\n }\n subscriptionsRegion[watchID] = undefined;\n }\n return PluginGeofencing.clearRegionsWatch(watchID);\n }\n}\n/**\n * Sets Sales Force Marketing Cloud (SFMC) credentials\n * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setSFMCCredentials(arg0: Object): Promise<string> {\n return PluginGeofencing.setSFMCCredentials(arg0);\n}\n\n/**\n * When you create a geofence around a POI, manually define the radius value (100.0) or choose the user_properties subfield that corresponds to radius value of the geofence (\"radiusPOI\").\n * @param radius can be integer or string.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setPoiRadius(radius: string): Promise<string> {\n return PluginGeofencing.setPoiRadius(radius);\n}\n/**\n * Adds a custom region that you want to monitor.\n * @param region A GeofenceRegion object with latitude, longitude, radius and type.\n * @returns promise with A callback that will be called on success or error.\n */\n\nfunction addRegion(region: GeofenceRegion): Promise<string> {\n return PluginGeofencing.addRegion(region);\n}\n/**\n * Retrieve saved region info\n * @param regionID If it pass return info for given region or return all region info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getRegions(regionID?: string): Promise<Region[]> {\n if (regionID == null) {\n return PluginGeofencing.getAllRegions()\n .then((result: any[]) => {\n var formatted: Region[] = [];\n result.forEach((item) => {\n formatted.push(Region.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getRegions(regionID)\n .then((result: any) => {\n var formatted: Region[] = [];\n formatted.push(Region.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Retrieve saved location info\n * @param locationID - Optional in case of location id pass it return only that location info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getLocations(locationID?: string): Promise<Location[]> {\n if (locationID == null) {\n return PluginGeofencing.getAllLocations()\n .then((result: any[]) => {\n var formatted: Location[] = [];\n result.forEach((item) => {\n formatted.push(Location.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getLocation(locationID)\n .then((result: any) => {\n var formatted: Location[] = [];\n formatted.push(Location.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Retrieve saved POI info\n * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getPois(poiID?: string): Promise<Poi[]> {\n if (poiID == null) {\n return PluginGeofencing.getAllPois()\n .then((result: any[]) => {\n var formatted: Poi[] = [];\n result.forEach((item) => {\n formatted.push(Poi.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getPoi(poiID)\n .then((result: any) => {\n var formatted: Poi[] = [];\n formatted.push(Poi.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Remove saved region info\n * @param regionID If it pass remove info for given region or removes all region info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeRegions(regionID?: string): Promise<string> {\n if (regionID == null) {\n return PluginGeofencing.removeAllRegions();\n } else {\n return PluginGeofencing.removeRegion(regionID);\n }\n}\n\n/**\n * Remove saved location info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeLocations(): Promise<string> {\n return PluginGeofencing.removeAllLocations();\n}\n\n/**\n * Remove saved POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removePois(): Promise<string> {\n return PluginGeofencing.removeAllPois();\n}\n/**\n * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method. \n * There are two way to host the json file:\n * - included in the client application (local)\n * - hosted externally in a file folder in your information system (external)\n * @param sourceType local/external\n * @param source location of profile to be fetch\n * @returns promise with A callback that will be called on success or error.\n */\nfunction startCustomTracking(\n sourceType: ProfileSource,\n source: string\n): Promise<string> {\n return PluginGeofencing.startCustomTracking(sourceType, source);\n}\n\nexport type {\n RegionType,\n GeofenceRegion,\n Region,\n Location,\n Poi,\n ProfileSource,\n};\n\nconst WoosmapGeofencing = {\n initialize,\n setWoosmapApiKey,\n startTracking,\n requestPermissions,\n getPermissionsStatus,\n stopTracking,\n watchLocation,\n clearLocationWatch,\n watchRegions,\n clearRegionsWatch,\n setSFMCCredentials,\n setPoiRadius,\n addRegion,\n getRegions,\n removeRegions,\n getLocations,\n removeLocations,\n getPois,\n removePois,\n startCustomTracking,\n};\n\nexport default WoosmapGeofencing;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAAiC;AAOjC,MAAMA,YAAY,GAAG,IAAIC,+BAAkB,CAACC,wBAAgB,CAAC;AAE7D,IAAIC,qBAA0B,GAAG,CAAC,CAAC;AACnC,IAAIC,mBAAwB,GAAG,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAU,CAACC,IAAU,EAAmB;EAC/C,IAAIA,IAAI,IAAI,IAAI,EAAE;IAChBA,IAAI,GAAG,CAAC,CAAC;EACX;EACA,OAAOJ,wBAAgB,CAACG,UAAU,CAACC,IAAI,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgB,CAACC,MAAc,EAAmB;EACzD,OAAON,wBAAgB,CAACK,gBAAgB,CAAC,CAACC,MAAM,CAAC,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAa,CAACC,eAAuB,EAAmB;EAC/D,OAAOR,wBAAgB,C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AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASW,aAAa,CAACrB,QAAiB,EAAmB;EACzD,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAO1C,wBAAgB,CAACgE,gBAAgB,EAAE;EAC5C,CAAC,MAAM;IACL,OAAOhE,wBAAgB,CAACiE,YAAY,CAACvB,QAAQ,CAAC;EAChD;AACF;;AAEA;AACA;AACA;AACA;AACA,SAASwB,eAAe,GAAoB;EAC1C,OAAOlE,wBAAgB,CAACmE,kBAAkB,EAAE;AAC9C;;AAEA;AACA;AACA;AACA;AACA,SAASC,UAAU,GAAoB;EACrC,OAAOpE,wBAAgB,CAACqE,aAAa,EAAE;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmB,CAC1BC,UAAyB,EACzBC,MAAc,EACG;EACjB,OAAOxE,wBAAgB,CAACsE,mBAAmB,CAACC,UAAU,EAAEC,MAAM,CAAC;AACjE;AAWA,MAAMC,iBAAiB,GAAG;EACxBtE,UAAU;EACVE,gBAAgB;EAChBE,aAAa;EACbG,kBAAkB;EAClBE,oBAAoB;EACpBH,YAAY;EACZI,aAAa;EACbY,kBAAkB;EAClBO,YAAY;EACZE,iBAAiB;EACjBE,kBAAkB;EAClBC,YAAY;EACZE,SAAS;EACTE,UAAU;EACVsB,aAAa;EACbT,YAAY;EACZY,eAAe;EACfR,OAAO;EACPU,UAAU;EACVE;AACF,CAAC;AAAC,eAEaG,iBAAiB;AAAA"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ /**
5
+ * @classdesc A class that represents the Airship object.
6
+ * @constructs Airship
7
+ * @param {string} name The name of the custom event.
8
+ * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.
9
+ */
10
+ class Airship {
11
+ constructor(name, properties) {
12
+ _defineProperty(this, "Name", void 0);
13
+ _defineProperty(this, "Properties", void 0);
14
+ this.Name = name;
15
+ this.Properties = properties;
16
+ }
17
+ /**
18
+ * Converts json object to an object of type Airship.
19
+ * @param {Object} json The json representation of Airship.
20
+ * @returns Object
21
+ * @memberof Airship
22
+ */
23
+ static jsonToObj(json) {
24
+ return new Airship(json.name, json.properties);
25
+ }
26
+ }
27
+ module.exports = Airship;
28
+ //# sourceMappingURL=Airship.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Airship","constructor","name","properties","Name","Properties","jsonToObj","json","module","exports"],"sources":["Airship.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Airship object.\n * @constructs Airship\n * @param {string} name The name of the custom event.\n * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.\n */\nclass Airship {\n Name: String;\n Properties: String;\n constructor(name: String, properties: String) {\n this.Name = name;\n this.Properties = properties;\n }\n /**\n * Converts json object to an object of type Airship.\n * @param {Object} json The json representation of Airship.\n * @returns Object\n * @memberof Airship\n */\n static jsonToObj(json: any) {\n return new Airship(json.name, json.properties);\n }\n}\nmodule.exports = Airship;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,OAAO,CAAC;EAGZC,WAAW,CAACC,IAAY,EAAEC,UAAkB,EAAE;IAAA;IAAA;IAC5C,IAAI,CAACC,IAAI,GAAGF,IAAI;IAChB,IAAI,CAACG,UAAU,GAAGF,UAAU;EAC9B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOG,SAAS,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIP,OAAO,CAACO,IAAI,CAACL,IAAI,EAAEK,IAAI,CAACJ,UAAU,CAAC;EAChD;AACF;AACAK,MAAM,CAACC,OAAO,GAAGT,OAAO"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ /**
9
+ * @classdesc A class that represents the location object.
10
+ * @constructs Location
11
+ * @param {number} date The datetime stamp.
12
+ * @param {number} latitude The latitude of the location.
13
+
14
+ * @param {string} Locationdescription The description of the location.
15
+ * @param {string} Locationid A unique identifier for the location.
16
+ * @param {number} longitude The longitude of the location.
17
+ */
18
+ class Location {
19
+ constructor(date, latitude, locationdescription, locationid, longitude) {
20
+ _defineProperty(this, "Date", void 0);
21
+ _defineProperty(this, "Latitude", void 0);
22
+ _defineProperty(this, "Locationdescription", void 0);
23
+ _defineProperty(this, "Locationid", void 0);
24
+ _defineProperty(this, "Longitude", void 0);
25
+ this.Date = date;
26
+ this.Latitude = latitude;
27
+ this.Locationdescription = locationdescription;
28
+ this.Locationid = locationid;
29
+ this.Longitude = longitude;
30
+ }
31
+ /**
32
+ * Converts json object to an object of type Location.
33
+ * @param {Object} json The json representation of the Location.
34
+ * @returns Object
35
+ * @memberof Location
36
+ */
37
+ static jsonToObj(json) {
38
+ return new Location(json.date, json.latitude, json.locationdescription, json.locationid, json.longitude);
39
+ }
40
+ }
41
+ var _default = Location;
42
+ exports.default = _default;
43
+ //# sourceMappingURL=Location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Location","constructor","date","latitude","locationdescription","locationid","longitude","Date","Latitude","Locationdescription","Locationid","Longitude","jsonToObj","json"],"sources":["Location.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the location object.\n * @constructs Location\n * @param {number} date The datetime stamp.\n * @param {number} latitude The latitude of the location.\n\n * @param {string} Locationdescription The description of the location. \n * @param {string} Locationid A unique identifier for the location.\n * @param {number} longitude The longitude of the location.\n */\nclass Location {\n Date: number;\n Latitude: number;\n Locationdescription: string;\n Locationid: string;\n Longitude: number;\n constructor(\n date: number,\n latitude: number,\n locationdescription: string,\n locationid: string,\n longitude: number\n ) {\n this.Date = date;\n this.Latitude = latitude;\n this.Locationdescription = locationdescription;\n this.Locationid = locationid;\n this.Longitude = longitude;\n }\n /**\n * Converts json object to an object of type Location.\n * @param {Object} json The json representation of the Location.\n * @returns Object\n * @memberof Location\n */\n static jsonToObj(json: any) {\n return new Location(\n json.date,\n json.latitude,\n json.locationdescription,\n json.locationid,\n json.longitude\n );\n }\n}\nexport default Location;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,CAAC;EAMbC,WAAW,CACTC,IAAY,EACZC,QAAgB,EAChBC,mBAA2B,EAC3BC,UAAkB,EAClBC,SAAiB,EACjB;IAAA;IAAA;IAAA;IAAA;IAAA;IACA,IAAI,CAACC,IAAI,GAAGL,IAAI;IAChB,IAAI,CAACM,QAAQ,GAAGL,QAAQ;IACxB,IAAI,CAACM,mBAAmB,GAAGL,mBAAmB;IAC9C,IAAI,CAACM,UAAU,GAAGL,UAAU;IAC5B,IAAI,CAACM,SAAS,GAAGL,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOM,SAAS,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIb,QAAQ,CACjBa,IAAI,CAACX,IAAI,EACTW,IAAI,CAACV,QAAQ,EACbU,IAAI,CAACT,mBAAmB,EACxBS,IAAI,CAACR,UAAU,EACfQ,IAAI,CAACP,SAAS,CACf;EACH;AACF;AAAC,eACcN,QAAQ;AAAA"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ /**
5
+ * @classdesc A class that represents the Marketing Cloud object.
6
+ * @constructs MarketingCloud
7
+ * @param {string} name The name of the custom event.
8
+ * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.
9
+ */
10
+ class MarketingCloud {
11
+ constructor(name, properties) {
12
+ _defineProperty(this, "Name", void 0);
13
+ _defineProperty(this, "Properties", void 0);
14
+ this.Name = name;
15
+ this.Properties = properties;
16
+ }
17
+ /**
18
+ * Converts json object to an object of type MarketingCloud.
19
+ * @param {Object} json The json representation of MarketingCloud.
20
+ * @returns Object
21
+ * @memberof MarketingCloud
22
+ */
23
+ static jsonToObj(json) {
24
+ return new MarketingCloud(json.name, json.properties);
25
+ }
26
+ }
27
+ module.exports = MarketingCloud;
28
+ //# sourceMappingURL=MarketingCloud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MarketingCloud","constructor","name","properties","Name","Properties","jsonToObj","json","module","exports"],"sources":["MarketingCloud.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Marketing Cloud object.\n * @constructs MarketingCloud\n * @param {string} name The name of the custom event.\n * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.\n */\nclass MarketingCloud {\n Name: string;\n Properties: string;\n constructor(name: string, properties: string) {\n this.Name = name;\n this.Properties = properties;\n }\n /**\n * Converts json object to an object of type MarketingCloud.\n * @param {Object} json The json representation of MarketingCloud.\n * @returns Object\n * @memberof MarketingCloud\n */\n static jsonToObj(json: any) {\n return new MarketingCloud(json.name, json.properties);\n }\n}\nmodule.exports = MarketingCloud;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,CAAC;EAGnBC,WAAW,CAACC,IAAY,EAAEC,UAAkB,EAAE;IAAA;IAAA;IAC5C,IAAI,CAACC,IAAI,GAAGF,IAAI;IAChB,IAAI,CAACG,UAAU,GAAGF,UAAU;EAC9B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOG,SAAS,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIP,cAAc,CAACO,IAAI,CAACL,IAAI,EAAEK,IAAI,CAACJ,UAAU,CAAC;EACvD;AACF;AACAK,MAAM,CAACC,OAAO,GAAGT,cAAc"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ /**
9
+ * A class that represents the POI object.
10
+ * @classdesc A class that represents the POI object.
11
+ * @constructs Poi
12
+ * @param {Object} jsonData A json object representing the POI.
13
+ * @param {string} city The name of the city the POI belongs to.
14
+ * @param {string} idstore A unique identifier for the POI.
15
+ * @param {name} name The name of the POI.
16
+ * @param {number} date The datetime stamp.
17
+ * @param {number} distance The distance between the POI and the user's location.
18
+ * @param {number} duration The duration to travel to the POI from the user's location.
19
+ * @param {number} latitude The latitude of the POI.
20
+ * @param {string} locationid Location id of the POI.
21
+ * @param {number} longitude The longitude of the POI.
22
+ * @param {string} zipcode The zip code of the POI.
23
+ * @param {number} radius The radius of the POI.
24
+ * @param {string} address The address of the POI.
25
+ * @param {string} countrycode The countrycode of the POI.
26
+ * @param {string} tags The tags for the POI.
27
+ * @param {string} types The types of the POI.
28
+ * @param {string} contact The contact for the POI.
29
+ */
30
+ class Poi {
31
+ constructor(jsondata, city, idstore, name, date, distance, duration, latitude, locationid, longitude, zipcode, radius, address, countrycode, tags, types, contact) {
32
+ _defineProperty(this, "Jsondata", void 0);
33
+ _defineProperty(this, "City", void 0);
34
+ _defineProperty(this, "Idstore", void 0);
35
+ _defineProperty(this, "Name", void 0);
36
+ _defineProperty(this, "Date", void 0);
37
+ _defineProperty(this, "Distance", void 0);
38
+ _defineProperty(this, "Duration", void 0);
39
+ _defineProperty(this, "Latitude", void 0);
40
+ _defineProperty(this, "Locationid", void 0);
41
+ _defineProperty(this, "Longitude", void 0);
42
+ _defineProperty(this, "Zipcode", void 0);
43
+ _defineProperty(this, "Radius", void 0);
44
+ _defineProperty(this, "Countrycode", void 0);
45
+ _defineProperty(this, "Tags", void 0);
46
+ _defineProperty(this, "Types", void 0);
47
+ _defineProperty(this, "Contact", void 0);
48
+ _defineProperty(this, "Address", void 0);
49
+ this.Jsondata = jsondata;
50
+ this.City = city;
51
+ this.Idstore = idstore;
52
+ this.Name = name;
53
+ this.Date = date;
54
+ this.Distance = distance;
55
+ this.Duration = duration;
56
+ this.Latitude = latitude;
57
+ this.Locationid = locationid;
58
+ this.Longitude = longitude;
59
+ this.Zipcode = zipcode;
60
+ this.Radius = radius;
61
+ this.Idstore = idstore;
62
+ this.Countrycode = countrycode;
63
+ this.Tags = tags;
64
+ this.Types = types;
65
+ this.Contact = contact;
66
+ this.Address = address;
67
+ }
68
+ /**
69
+ * Converts json object to an object of type Poi.
70
+ * @param {Object} json The json representation of the Poi.
71
+ * @returns Object
72
+ * @memberof Poi
73
+ */
74
+ static jsonToObj(json) {
75
+ return new Poi(json.jsondata, json.city, json.idstore, json.name, json.date, json.distance, json.duration, json.latitude, json.locationid, json.longitude, json.zipcode, json.radius, json.address, json.countrycode, json.tags, json.types, json.contact);
76
+ }
77
+ }
78
+ var _default = Poi;
79
+ exports.default = _default;
80
+ //# sourceMappingURL=Poi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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"],"sources":["Poi.tsx"],"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 {string} locationid Location id 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: string;\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: string,\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}\nexport default Poi;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,GAAG,CAAC;EAkBRC,WAAW,CACTC,QAAgB,EAChBC,IAAY,EACZC,OAAe,EACfC,IAAY,EACZC,IAAY,EACZC,QAAg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