@woosmap/react-native-plugin-geofencing 0.6.0-beta.1 → 0.6.0-beta.3

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 (69) hide show
  1. package/lib/commonjs/index.js +429 -0
  2. package/lib/commonjs/index.js.map +1 -0
  3. package/lib/commonjs/internal/Airship.js +25 -0
  4. package/lib/commonjs/internal/Airship.js.map +1 -0
  5. package/lib/commonjs/internal/IndoorBeacon.js +73 -0
  6. package/lib/commonjs/internal/IndoorBeacon.js.map +1 -0
  7. package/lib/commonjs/internal/Location.js +36 -0
  8. package/lib/commonjs/internal/Location.js.map +1 -0
  9. package/lib/commonjs/internal/MarketingCloud.js +25 -0
  10. package/lib/commonjs/internal/MarketingCloud.js.map +1 -0
  11. package/lib/commonjs/internal/Poi.js +62 -0
  12. package/lib/commonjs/internal/Poi.js.map +1 -0
  13. package/lib/commonjs/internal/Region.js +44 -0
  14. package/lib/commonjs/internal/Region.js.map +1 -0
  15. package/lib/commonjs/internal/Visit.js +32 -0
  16. package/lib/commonjs/internal/Visit.js.map +1 -0
  17. package/lib/commonjs/internal/Zoi.js +57 -0
  18. package/lib/commonjs/internal/Zoi.js.map +1 -0
  19. package/lib/commonjs/internal/nativeInterface.js +13 -0
  20. package/lib/commonjs/internal/nativeInterface.js.map +1 -0
  21. package/lib/commonjs/internal/types.js +2 -0
  22. package/lib/commonjs/internal/types.js.map +1 -0
  23. package/lib/commonjs/package.json +1 -0
  24. package/lib/module/index.js +424 -0
  25. package/lib/module/index.js.map +1 -0
  26. package/lib/module/internal/Airship.js +25 -0
  27. package/lib/module/internal/Airship.js.map +1 -0
  28. package/lib/module/internal/IndoorBeacon.js +69 -0
  29. package/lib/module/internal/IndoorBeacon.js.map +1 -0
  30. package/lib/module/internal/Location.js +32 -0
  31. package/lib/module/internal/Location.js.map +1 -0
  32. package/lib/module/internal/MarketingCloud.js +25 -0
  33. package/lib/module/internal/MarketingCloud.js.map +1 -0
  34. package/lib/module/internal/Poi.js +58 -0
  35. package/lib/module/internal/Poi.js.map +1 -0
  36. package/lib/module/internal/Region.js +40 -0
  37. package/lib/module/internal/Region.js.map +1 -0
  38. package/lib/module/internal/Visit.js +32 -0
  39. package/lib/module/internal/Visit.js.map +1 -0
  40. package/lib/module/internal/Zoi.js +57 -0
  41. package/lib/module/internal/Zoi.js.map +1 -0
  42. package/lib/module/internal/nativeInterface.js +9 -0
  43. package/lib/module/internal/nativeInterface.js.map +1 -0
  44. package/lib/module/internal/types.js +2 -0
  45. package/lib/module/internal/types.js.map +1 -0
  46. package/lib/module/package.json +1 -0
  47. package/lib/typescript/src/index.d.ts +191 -0
  48. package/lib/typescript/src/index.d.ts.map +1 -0
  49. package/lib/typescript/src/internal/Airship.d.ts +19 -0
  50. package/lib/typescript/src/internal/Airship.d.ts.map +1 -0
  51. package/lib/typescript/src/internal/IndoorBeacon.d.ts +50 -0
  52. package/lib/typescript/src/internal/IndoorBeacon.d.ts.map +1 -0
  53. package/lib/typescript/src/internal/Location.d.ts +27 -0
  54. package/lib/typescript/src/internal/Location.d.ts.map +1 -0
  55. package/lib/typescript/src/internal/MarketingCloud.d.ts +19 -0
  56. package/lib/typescript/src/internal/MarketingCloud.d.ts.map +1 -0
  57. package/lib/typescript/src/internal/Poi.d.ts +52 -0
  58. package/lib/typescript/src/internal/Poi.d.ts.map +1 -0
  59. package/lib/typescript/src/internal/Region.d.ts +35 -0
  60. package/lib/typescript/src/internal/Region.d.ts.map +1 -0
  61. package/lib/typescript/src/internal/Visit.d.ts +26 -0
  62. package/lib/typescript/src/internal/Visit.d.ts.map +1 -0
  63. package/lib/typescript/src/internal/Zoi.d.ts +50 -0
  64. package/lib/typescript/src/internal/Zoi.d.ts.map +1 -0
  65. package/lib/typescript/src/internal/nativeInterface.d.ts +3 -0
  66. package/lib/typescript/src/internal/nativeInterface.d.ts.map +1 -0
  67. package/lib/typescript/src/internal/types.d.ts +19 -0
  68. package/lib/typescript/src/internal/types.d.ts.map +1 -0
  69. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * A class that represents the POI object.
9
+ * @classdesc A class that represents the POI object.
10
+ * @constructs Poi
11
+ * @param {Object} jsonData A json object representing the POI.
12
+ * @param {string} city The name of the city the POI belongs to.
13
+ * @param {string} idstore A unique identifier for the POI.
14
+ * @param {name} name The name of the POI.
15
+ * @param {number} date The datetime stamp.
16
+ * @param {number} distance The distance between the POI and the user's location.
17
+ * @param {number} duration The duration to travel to the POI from the user's location.
18
+ * @param {number} latitude The latitude of the POI.
19
+ * @param {string} locationid Location id of the POI.
20
+ * @param {number} longitude The longitude of the POI.
21
+ * @param {string} zipcode The zip code of the POI.
22
+ * @param {number} radius The radius of the POI.
23
+ * @param {string} address The address of the POI.
24
+ * @param {string} countrycode The countrycode of the POI.
25
+ * @param {string} tags The tags for the POI.
26
+ * @param {string} types The types of the POI.
27
+ * @param {string} contact The contact for the POI.
28
+ */
29
+ class Poi {
30
+ constructor(jsondata, city, idstore, name, date, distance, duration, latitude, locationid, longitude, zipcode, radius, address, countrycode, tags, types, contact, userProperties) {
31
+ this.Jsondata = jsondata;
32
+ this.City = city;
33
+ this.Idstore = idstore;
34
+ this.Name = name;
35
+ this.Date = date;
36
+ this.Distance = distance;
37
+ this.Duration = duration;
38
+ this.Latitude = latitude;
39
+ this.Locationid = locationid;
40
+ this.Longitude = longitude;
41
+ this.Zipcode = zipcode;
42
+ this.Radius = radius;
43
+ this.Idstore = idstore;
44
+ this.Countrycode = countrycode;
45
+ this.Tags = tags;
46
+ this.Types = types;
47
+ this.Contact = contact;
48
+ this.Address = address;
49
+ this.userProperties = userProperties;
50
+ }
51
+ /**
52
+ * Converts json object to an object of type Poi.
53
+ * @param {Object} json The json representation of the Poi.
54
+ * @returns Object
55
+ * @memberof Poi
56
+ */
57
+ static jsonToObj(json) {
58
+ 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, json.userProperties);
59
+ }
60
+ }
61
+ var _default = exports.default = Poi;
62
+ //# 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","userProperties","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json","_default","exports","default"],"sourceRoot":"../../../src","sources":["internal/Poi.tsx"],"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;EAmBRC,WAAWA,CACTC,QAAgB,EAChBC,IAAY,EACZC,OAAe,EACfC,IAAY,EACZC,IAAY,EACZC,QAAgB,EAChBC,QAAgB,EAChBC,QAAgB,EAChBC,UAAkB,EAClBC,SAAiB,EACjBC,OAAe,EACfC,MAAc,EACdC,OAAe,EACfC,WAAmB,EACnBC,IAAY,EACZC,KAAa,EACbC,OAAe,EACfC,cAA6B,EAC7B;IACA,IAAI,CAACC,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,IAAI,GAAGlB,IAAI;IAChB,IAAI,CAACmB,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAACmB,IAAI,GAAGlB,IAAI;IAChB,IAAI,CAACmB,IAAI,GAAGlB,IAAI;IAChB,IAAI,CAACmB,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,UAAU,GAAGlB,UAAU;IAC5B,IAAI,CAACmB,SAAS,GAAGlB,SAAS;IAC1B,IAAI,CAACmB,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAACmB,MAAM,GAAGlB,MAAM;IACpB,IAAI,CAACS,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAAC4B,WAAW,GAAGjB,WAAW;IAC9B,IAAI,CAACkB,IAAI,GAAGjB,IAAI;IAChB,IAAI,CAACkB,KAAK,GAAGjB,KAAK;IAClB,IAAI,CAACkB,OAAO,GAAGjB,OAAO;IACtB,IAAI,CAACkB,OAAO,GAAGtB,OAAO;IACtB,IAAI,CAACK,cAAc,GAAGA,cAAc;EACtC;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOkB,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAItC,GAAG,CACZsC,IAAI,CAACpC,QAAQ,EACboC,IAAI,CAACnC,IAAI,EACTmC,IAAI,CAAClC,OAAO,EACZkC,IAAI,CAACjC,IAAI,EACTiC,IAAI,CAAChC,IAAI,EACTgC,IAAI,CAAC/B,QAAQ,EACb+B,IAAI,CAAC9B,QAAQ,EACb8B,IAAI,CAAC7B,QAAQ,EACb6B,IAAI,CAAC5B,UAAU,EACf4B,IAAI,CAAC3B,SAAS,EACd2B,IAAI,CAAC1B,OAAO,EACZ0B,IAAI,CAACzB,MAAM,EACXyB,IAAI,CAACxB,OAAO,EACZwB,IAAI,CAACvB,WAAW,EAChBuB,IAAI,CAACtB,IAAI,EACTsB,IAAI,CAACrB,KAAK,EACVqB,IAAI,CAACpB,OAAO,EACZoB,IAAI,CAACnB,cACP,CAAC;EACH;AACF;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACczC,GAAG","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * A class that represents the Region object.
9
+ * @classdesc A class that represents the Region object.
10
+ * @constructs Region
11
+ * @param {number} date The datetime stamp.
12
+ * @param {boolean} didEnter A boolean value indicating whether the region was entered.
13
+ * @param {string} identifier An alphanumeric unique identifier for the region.
14
+ * @param {number} latitude The latitude of the region.
15
+ * @param {number} longitude The longitude of the region.
16
+ * @param {number} radius The radius of the region in meters.
17
+ * @param {boolean} frompositiondetection Determines whether the user's current position is inside the region.
18
+ * @param {string} eventName Describe cause of region event, Entry or Exit.
19
+ * @param {number} spenttime Number of seconds the user spent in region in case of event name Exit.
20
+ */
21
+ class Region {
22
+ constructor(date, didenter, identifier, latitude, longitude, radius, frompositiondetection, eventname, spenttime) {
23
+ this.Date = date;
24
+ this.Didenter = didenter;
25
+ this.Identifier = identifier;
26
+ this.Latitude = latitude;
27
+ this.Longitude = longitude;
28
+ this.Radius = radius;
29
+ this.Frompositiondetection = frompositiondetection;
30
+ this.Eventname = eventname;
31
+ this.SpentTime = spenttime;
32
+ }
33
+ /**
34
+ * Converts json object to an object of type Region.
35
+ * @param {Object} json The json representation of the region.
36
+ * @returns Object
37
+ * @memberof Region
38
+ */
39
+ static jsonToObj(json) {
40
+ return new Region(json.date, json.didenter, json.identifier, json.latitude, json.longitude, json.radius, json.frompositiondetection, json.eventname, json.spenttime);
41
+ }
42
+ }
43
+ var _default = exports.default = Region;
44
+ //# sourceMappingURL=Region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Region","constructor","date","didenter","identifier","latitude","longitude","radius","frompositiondetection","eventname","spenttime","Date","Didenter","Identifier","Latitude","Longitude","Radius","Frompositiondetection","Eventname","SpentTime","jsonToObj","json","_default","exports","default"],"sourceRoot":"../../../src","sources":["internal/Region.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAM,CAAC;EAUXC,WAAWA,CACTC,IAAY,EACZC,QAAiB,EACjBC,UAAkB,EAClBC,QAAgB,EAChBC,SAAiB,EACjBC,MAAc,EACdC,qBAA8B,EAC9BC,SAAiB,EACjBC,SAAiB,EACjB;IACA,IAAI,CAACC,IAAI,GAAGT,IAAI;IAChB,IAAI,CAACU,QAAQ,GAAGT,QAAQ;IACxB,IAAI,CAACU,UAAU,GAAGT,UAAU;IAC5B,IAAI,CAACU,QAAQ,GAAGT,QAAQ;IACxB,IAAI,CAACU,SAAS,GAAGT,SAAS;IAC1B,IAAI,CAACU,MAAM,GAAGT,MAAM;IACpB,IAAI,CAACU,qBAAqB,GAAGT,qBAAqB;IAClD,IAAI,CAACU,SAAS,GAAGT,SAAS;IAC1B,IAAI,CAACU,SAAS,GAAGT,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOU,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIrB,MAAM,CACfqB,IAAI,CAACnB,IAAI,EACTmB,IAAI,CAAClB,QAAQ,EACbkB,IAAI,CAACjB,UAAU,EACfiB,IAAI,CAAChB,QAAQ,EACbgB,IAAI,CAACf,SAAS,EACde,IAAI,CAACd,MAAM,EACXc,IAAI,CAACb,qBAAqB,EAC1Ba,IAAI,CAACZ,SAAS,EACdY,IAAI,CAACX,SACP,CAAC;EACH;AACF;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACcxB,MAAM","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @classdesc A class that represents the visits object.
5
+ * @constructs Visit
6
+ * @param {number} accuracy The accuracy in meters.
7
+ * @param {number} arrivalDate The datetime stamp for the arrival at the place of visit.
8
+ * @param {number} date Current datetime stamp.
9
+ * @param {number} latitude The latitude of the place of visit.
10
+ * @param {number} longitude The longitude of the plaee of visit.
11
+ */
12
+ class Visit {
13
+ constructor(accuracy, arrivaldate, date, departuredate, latitude, longitude) {
14
+ this.Accuracy = accuracy;
15
+ this.Arrivaldate = arrivaldate;
16
+ this.Date = date;
17
+ this.Departuredate = departuredate;
18
+ this.Latitude = latitude;
19
+ this.Longitude = longitude;
20
+ }
21
+ /**
22
+ * Converts json object to an object of type Visits.
23
+ * @param {Object} json The json representation of the Visits.
24
+ * @returns Visit
25
+ * @memberof Visit
26
+ */
27
+ static jsonToObj(json) {
28
+ return new Visit(json.accuracy, json.arrivaldate, json.date, json.departuredate, json.latitude, json.longitude);
29
+ }
30
+ }
31
+ module.exports = Visit;
32
+ //# sourceMappingURL=Visit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Visit","constructor","accuracy","arrivaldate","date","departuredate","latitude","longitude","Accuracy","Arrivaldate","Date","Departuredate","Latitude","Longitude","jsonToObj","json","module","exports"],"sourceRoot":"../../../src","sources":["internal/Visit.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,CAAC;EAOVC,WAAWA,CACTC,QAAgB,EAChBC,WAAmB,EACnBC,IAAY,EACZC,aAAqB,EACrBC,QAAgB,EAChBC,SAAiB,EACjB;IACA,IAAI,CAACC,QAAQ,GAAGN,QAAQ;IACxB,IAAI,CAACO,WAAW,GAAGN,WAAW;IAC9B,IAAI,CAACO,IAAI,GAAGN,IAAI;IAChB,IAAI,CAACO,aAAa,GAAGN,aAAa;IAClC,IAAI,CAACO,QAAQ,GAAGN,QAAQ;IACxB,IAAI,CAACO,SAAS,GAAGN,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOO,SAASA,CAACC,IAAS,EAAS;IACjC,OAAO,IAAIf,KAAK,CACde,IAAI,CAACb,QAAQ,EACba,IAAI,CAACZ,WAAW,EAChBY,IAAI,CAACX,IAAI,EACTW,IAAI,CAACV,aAAa,EAClBU,IAAI,CAACT,QAAQ,EACbS,IAAI,CAACR,SACP,CAAC;EACH;AACF;AACAS,MAAM,CAACC,OAAO,GAAGjB,KAAK","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @classdesc A class that represents the Zones of Interest (ZOI) object.
5
+ * @constructs Zoi
6
+ * @param {number} accumulator Represents the number of visits used to build the ZOI (only for calculation of ZOI)
7
+ * @param {number} age Age is used to determine if a ZOI should be deleted by the algorithm (only for calculation of ZOI)
8
+ * @param {number} covariance_det The covariance determinant (only for calculation of ZOI)
9
+ * @param {number} duration The duration of all the accumulated visits of the ZOI
10
+ * @param {number} endtime The exit date of the last ZOI visit
11
+ * @param {string[]} idvisits The list of id visits included in this ZOI
12
+ * @param {number} latmean The latitude of the center of the ZOI
13
+ * @param {number} lngmean The longitude of the center of the ZOI
14
+ * @param {string} period The classification of the period (HOME, WORK, OTHER or NO QUALIFIER)
15
+ * @param {number} prior_probability Estimation of probability (only for calculation of ZOI)
16
+ * @param {number} starttime The entry date for the first ZOI visit
17
+ * @param {number} weekly_density The weekly density of the ZOI visit (only for classification of ZOI)
18
+ * @param {string} wktpolygon This is the Well-known text representation of geometry of the ZOI polygon.
19
+ * @param {number} x00covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
20
+ * @param {number} x01covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
21
+ * @param {number} x10covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
22
+ * @param {number} x11covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
23
+
24
+ */
25
+ class Zoi {
26
+ constructor(accumulator, age, covariance_det, duration, endtime, idvisits, latmean, lngmean, period, prior_probability, starttime, weekly_density, wktpolygon, x00covariance_matrix_inverse, x01covariance_matrix_inverse, x10covariance_matrix_inverse, x11covariance_matrix_inverse) {
27
+ this.Accumulator = accumulator;
28
+ this.Age = age;
29
+ this.Covariance_Det = covariance_det;
30
+ this.Duration = duration;
31
+ this.Endtime = endtime;
32
+ this.Idvisits = idvisits;
33
+ this.Latmean = latmean;
34
+ this.Lngmean = lngmean;
35
+ this.Period = period;
36
+ this.Prior_Probability = prior_probability;
37
+ this.Starttime = starttime;
38
+ this.Weekly_Density = weekly_density;
39
+ this.Covariance_Det = covariance_det;
40
+ this.Wktpolygon = wktpolygon;
41
+ this.X00Covariance_Matrix_Inverse = x00covariance_matrix_inverse;
42
+ this.X01Covariance_Matrix_Inverse = x01covariance_matrix_inverse;
43
+ this.X10Covariance_Matrix_Inverse = x10covariance_matrix_inverse;
44
+ this.X11Covariance_Matrix_Inverse = x11covariance_matrix_inverse;
45
+ }
46
+ /**
47
+ * Converts json object to an object of type Zoi.
48
+ * @param {Object} json The json representation of the Zoi.
49
+ * @returns Object
50
+ * @memberof Zoi
51
+ */
52
+ static jsonToObj(json) {
53
+ return new Zoi(json.accumulator, json.age, json.covariance_det, json.duration, json.endtime, json.idvisits, json.latmean, json.lngmean, json.period, json.prior_probability, json.starttime, json.weekly_density, json.wktpolygon, json.x00covariance_matrix_inverse, json.x01covariance_matrix_inverse, json.x10covariance_matrix_inverse, json.x11covariance_matrix_inverse);
54
+ }
55
+ }
56
+ module.exports = Zoi;
57
+ //# sourceMappingURL=Zoi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Zoi","constructor","accumulator","age","covariance_det","duration","endtime","idvisits","latmean","lngmean","period","prior_probability","starttime","weekly_density","wktpolygon","x00covariance_matrix_inverse","x01covariance_matrix_inverse","x10covariance_matrix_inverse","x11covariance_matrix_inverse","Accumulator","Age","Covariance_Det","Duration","Endtime","Idvisits","Latmean","Lngmean","Period","Prior_Probability","Starttime","Weekly_Density","Wktpolygon","X00Covariance_Matrix_Inverse","X01Covariance_Matrix_Inverse","X10Covariance_Matrix_Inverse","X11Covariance_Matrix_Inverse","jsonToObj","json","module","exports"],"sourceRoot":"../../../src","sources":["internal/Zoi.tsx"],"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,WAAWA,CACTC,WAAmB,EACnBC,GAAW,EACXC,cAAsB,EACtBC,QAAgB,EAChBC,OAAe,EACfC,QAAkB,EAClBC,OAAe,EACfC,OAAe,EACfC,MAAc,EACdC,iBAAyB,EACzBC,SAAiB,EACjBC,cAAsB,EACtBC,UAAkB,EAClBC,4BAAoC,EACpCC,4BAAoC,EACpCC,4BAAoC,EACpCC,4BAAoC,EACpC;IACA,IAAI,CAACC,WAAW,GAAGjB,WAAW;IAC9B,IAAI,CAACkB,GAAG,GAAGjB,GAAG;IACd,IAAI,CAACkB,cAAc,GAAGjB,cAAc;IACpC,IAAI,CAACkB,QAAQ,GAAGjB,QAAQ;IACxB,IAAI,CAACkB,OAAO,GAAGjB,OAAO;IACtB,IAAI,CAACkB,QAAQ,GAAGjB,QAAQ;IACxB,IAAI,CAACkB,OAAO,GAAGjB,OAAO;IACtB,IAAI,CAACkB,OAAO,GAAGjB,OAAO;IACtB,IAAI,CAACkB,MAAM,GAAGjB,MAAM;IACpB,IAAI,CAACkB,iBAAiB,GAAGjB,iBAAiB;IAC1C,IAAI,CAACkB,SAAS,GAAGjB,SAAS;IAC1B,IAAI,CAACkB,cAAc,GAAGjB,cAAc;IACpC,IAAI,CAACQ,cAAc,GAAGjB,cAAc;IACpC,IAAI,CAAC2B,UAAU,GAAGjB,UAAU;IAC5B,IAAI,CAACkB,4BAA4B,GAAGjB,4BAA4B;IAChE,IAAI,CAACkB,4BAA4B,GAAGjB,4BAA4B;IAChE,IAAI,CAACkB,4BAA4B,GAAGjB,4BAA4B;IAChE,IAAI,CAACkB,4BAA4B,GAAGjB,4BAA4B;EAClE;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOkB,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIrC,GAAG,CACZqC,IAAI,CAACnC,WAAW,EAChBmC,IAAI,CAAClC,GAAG,EACRkC,IAAI,CAACjC,cAAc,EACnBiC,IAAI,CAAChC,QAAQ,EACbgC,IAAI,CAAC/B,OAAO,EACZ+B,IAAI,CAAC9B,QAAQ,EACb8B,IAAI,CAAC7B,OAAO,EACZ6B,IAAI,CAAC5B,OAAO,EACZ4B,IAAI,CAAC3B,MAAM,EACX2B,IAAI,CAAC1B,iBAAiB,EACtB0B,IAAI,CAACzB,SAAS,EACdyB,IAAI,CAACxB,cAAc,EACnBwB,IAAI,CAACvB,UAAU,EACfuB,IAAI,CAACtB,4BAA4B,EACjCsB,IAAI,CAACrB,4BAA4B,EACjCqB,IAAI,CAACpB,4BAA4B,EACjCoB,IAAI,CAACnB,4BACP,CAAC;EACH;AACF;AACAoB,MAAM,CAACC,OAAO,GAAGvC,GAAG","ignoreList":[]}
@@ -0,0 +1,13 @@
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
+ let PluginGeofencing = _reactNative.NativeModules.PluginGeofencing;
9
+ if (!PluginGeofencing) {
10
+ throw new Error('NativeModules.PluginGeofencing is undefined');
11
+ }
12
+ var _default = exports.default = PluginGeofencing;
13
+ //# sourceMappingURL=nativeInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","PluginGeofencing","NativeModules","Error","_default","exports","default"],"sourceRoot":"../../../src","sources":["internal/nativeInterface.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAIC,gBAAgB,GAAGC,0BAAa,CAACD,gBAAgB;AAErD,IAAI,CAACA,gBAAgB,EAAE;EACrB,MAAM,IAAIE,KAAK,CAAC,6CAA6C,CAAC;AAChE;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcL,gBAAgB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["internal/types.tsx"],"mappings":"","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+
3
+ import { NativeEventEmitter, Platform } from 'react-native';
4
+ import uuid from 'react-native-uuid';
5
+ import PluginGeofencing from './internal/nativeInterface';
6
+ import Location from './internal/Location';
7
+ import Region from './internal/Region';
8
+ import Poi from './internal/Poi';
9
+ import IndoorBeacon from './internal/IndoorBeacon';
10
+ const eventEmitter = new NativeEventEmitter(PluginGeofencing);
11
+ let subscriptionsLocation = {};
12
+ let subscriptionsRegion = {};
13
+ /**
14
+ * Initializes the Woosmap object
15
+ * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
16
+ * @returns promise:success - A callback function that will be called on success.
17
+ error - A callback function that will be called on error.
18
+ */
19
+ function initialize(arg0) {
20
+ if (arg0 == null) {
21
+ arg0 = {};
22
+ }
23
+ return PluginGeofencing.initialize(arg0);
24
+ }
25
+
26
+ /**
27
+ * A method that sets Woosmap private API key
28
+ * @param apiKey new API key.
29
+ * @returns promise:success - A callback function that will be called on success.
30
+ error - A callback function that will be called on error.
31
+ */
32
+ function setWoosmapApiKey(apiKey) {
33
+ return PluginGeofencing.setWoosmapApiKey([apiKey]);
34
+ }
35
+
36
+ /**
37
+ * A method to start tracking the user's location.
38
+ * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.
39
+ * @returns promise:success - A callback function that will be called on success.
40
+ error - A callback function that will be called on error.
41
+ */
42
+ function startTracking(trackingProfile) {
43
+ return PluginGeofencing.startTracking([trackingProfile]);
44
+ }
45
+
46
+ /**
47
+ * Stops tracking the user's location.
48
+ * @returns promise:success - A callback function that will be called on success.
49
+ error - A callback function that will be called on error.
50
+ */
51
+ function stopTracking() {
52
+ return PluginGeofencing.stopTracking();
53
+ }
54
+
55
+ /**
56
+ * A method to request the required permissions to collect locations.
57
+ * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.
58
+ * @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'.
59
+ */
60
+ function requestPermissions(background) {
61
+ if (background == null) {
62
+ background = false;
63
+ }
64
+ return PluginGeofencing.requestPermissions([background]);
65
+ }
66
+
67
+ /**
68
+ * A method to request the required permissions to collect locations.
69
+ * @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission.
70
+ * The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED
71
+ */
72
+ function requestBLEPermissions() {
73
+ if (Platform.OS === 'android') {
74
+ return PluginGeofencing.requestBLEPermissions();
75
+ } else {
76
+ return new Promise(resolve => {
77
+ resolve('GRANTED');
78
+ });
79
+ }
80
+ }
81
+
82
+ /**
83
+ * A method to check if the app has granted required permissions to track location.
84
+ * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED
85
+ */
86
+ function getPermissionsStatus() {
87
+ return PluginGeofencing.getPermissionsStatus();
88
+ }
89
+
90
+ /**
91
+ * A method to check if the app has granted required permissions to track location.
92
+ * @returns A callback that will be called with the following status - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED
93
+ */
94
+ function getBLEPermissionsStatus() {
95
+ if (Platform.OS == 'android') {
96
+ return PluginGeofencing.getBLEPermissionsStatus();
97
+ } else {
98
+ return new Promise(resolve => {
99
+ resolve('GRANTED');
100
+ });
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Method will
106
+ invoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.
107
+ * @param success new location found callback
108
+ * @param error error status callback
109
+ * @returns watchid
110
+ */
111
+ function watchLocation(success, error) {
112
+ const watchID = uuid.v1().toString();
113
+ const successCallback = result => {
114
+ success(Location.jsonToObj(result));
115
+ };
116
+ subscriptionsLocation[watchID] = [eventEmitter.addListener('geolocationDidChange', successCallback), error ? eventEmitter.addListener('geolocationError', error) : null];
117
+ return PluginGeofencing.watchLocation(watchID);
118
+ }
119
+
120
+ /**
121
+ * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.
122
+ * @param watchID Reference ID.
123
+ * @returns return promise with same id back in case of success otherwise error info
124
+ */
125
+ function clearLocationWatch(watchID) {
126
+ if (watchID == null) {
127
+ eventEmitter.removeAllListeners('geolocationDidChange');
128
+ eventEmitter.removeAllListeners('geolocationError');
129
+ subscriptionsLocation = {};
130
+ return PluginGeofencing.clearAllLocationWatch();
131
+ } else {
132
+ const saved = subscriptionsLocation[watchID];
133
+ if (saved) {
134
+ const arg0 = saved[0];
135
+ arg0.remove();
136
+ //eventEmitter.removeListener('geolocationDidChange', arg0);
137
+ const arg1 = saved[1];
138
+ if (arg1) {
139
+ arg1.remove();
140
+ //eventEmitter.removeListener('geolocationError', arg1);
141
+ }
142
+ subscriptionsLocation[watchID] = undefined;
143
+ }
144
+ return PluginGeofencing.clearLocationWatch(watchID);
145
+ }
146
+ }
147
+
148
+ /**
149
+ * A method to to track Regions. Method will invoke a callback with Region object. Method will return
150
+ a watch id which can be used later to remove the callback.
151
+ * @param success new location found callback
152
+ * @param error error status callback
153
+ * @returns watchid
154
+ */
155
+ function watchRegions(success, error) {
156
+ const watchID = uuid.v1().toString();
157
+ const successCallback = result => {
158
+ success(Region.jsonToObj(result));
159
+ };
160
+ subscriptionsRegion[watchID] = [eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback), error ? eventEmitter.addListener('woosmapgeofenceRegionError', error) : null];
161
+ return PluginGeofencing.watchRegions(watchID);
162
+ }
163
+
164
+ /**
165
+ * 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.
166
+ * @param watchID Reference ID.
167
+ * @returns return promise with same id back in case of success otherwise error info
168
+ */
169
+ function clearRegionsWatch(watchID) {
170
+ if (watchID == null) {
171
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');
172
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionError');
173
+ subscriptionsRegion = {};
174
+ return PluginGeofencing.clearAllRegionsWatch();
175
+ } else {
176
+ const saved = subscriptionsRegion[watchID];
177
+ if (saved) {
178
+ const arg0 = saved[0];
179
+ arg0.remove();
180
+ //eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);
181
+ const arg1 = saved[1];
182
+ if (arg1) {
183
+ arg1.remove();
184
+ //eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);
185
+ }
186
+ subscriptionsRegion[watchID] = undefined;
187
+ }
188
+ return PluginGeofencing.clearRegionsWatch(watchID);
189
+ }
190
+ }
191
+ /**
192
+ * Sets Sales Force Marketing Cloud (SFMC) credentials
193
+ * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.
194
+ * @returns promise with A callback that will be called on success or error.
195
+ */
196
+ function setSFMCCredentials(arg0) {
197
+ return PluginGeofencing.setSFMCCredentials(arg0);
198
+ }
199
+
200
+ /**
201
+ * 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").
202
+ * @param radius can be integer or string.
203
+ * @returns promise with A callback that will be called on success or error.
204
+ */
205
+ function setPoiRadius(radius) {
206
+ return PluginGeofencing.setPoiRadius(radius);
207
+ }
208
+ /**
209
+ * Adds a custom region that you want to monitor.
210
+ * @param region A GeofenceRegion object with latitude, longitude, radius and type.
211
+ * @returns promise with A callback that will be called on success or error.
212
+ */
213
+
214
+ function addRegion(region) {
215
+ return PluginGeofencing.addRegion(region);
216
+ }
217
+ /**
218
+ * Retrieve saved region info
219
+ * @param regionID If it pass return info for given region or return all region info
220
+ * @returns promise with A callback that will be called on success or error.
221
+ */
222
+ function getRegions(regionID) {
223
+ if (regionID == null) {
224
+ return PluginGeofencing.getAllRegions().then(result => {
225
+ var formatted = [];
226
+ result.forEach(item => {
227
+ formatted.push(Region.jsonToObj(item));
228
+ });
229
+ return Promise.resolve(formatted);
230
+ }).catch(e => {
231
+ return Promise.reject(e);
232
+ });
233
+ } else {
234
+ return PluginGeofencing.getRegions(regionID).then(result => {
235
+ var formatted = [];
236
+ formatted.push(Region.jsonToObj(result));
237
+ return Promise.resolve(formatted);
238
+ }).catch(e => {
239
+ return Promise.reject(e);
240
+ });
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Retrieve saved location info
246
+ * @param locationID - Optional in case of location id pass it return only that location info
247
+ * @returns promise with A callback that will be called on success or error.
248
+ */
249
+ function getLocations(locationID) {
250
+ if (locationID == null) {
251
+ return PluginGeofencing.getAllLocations().then(result => {
252
+ var formatted = [];
253
+ result.forEach(item => {
254
+ formatted.push(Location.jsonToObj(item));
255
+ });
256
+ return Promise.resolve(formatted);
257
+ }).catch(e => {
258
+ return Promise.reject(e);
259
+ });
260
+ } else {
261
+ return PluginGeofencing.getLocation(locationID).then(result => {
262
+ var formatted = [];
263
+ formatted.push(Location.jsonToObj(result));
264
+ return Promise.resolve(formatted);
265
+ }).catch(e => {
266
+ return Promise.reject(e);
267
+ });
268
+ }
269
+ }
270
+
271
+ /**
272
+ * Retrieve saved POI info
273
+ * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
274
+ * @returns promise with A callback that will be called on success or error.
275
+ */
276
+ function getPois(poiID) {
277
+ if (poiID == null) {
278
+ return PluginGeofencing.getAllPois().then(result => {
279
+ var formatted = [];
280
+ result.forEach(item => {
281
+ formatted.push(Poi.jsonToObj(item));
282
+ });
283
+ return Promise.resolve(formatted);
284
+ }).catch(e => {
285
+ return Promise.reject(e);
286
+ });
287
+ } else {
288
+ return PluginGeofencing.getPoi(poiID).then(result => {
289
+ var formatted = [];
290
+ formatted.push(Poi.jsonToObj(result));
291
+ return Promise.resolve(formatted);
292
+ }).catch(e => {
293
+ return Promise.reject(e);
294
+ });
295
+ }
296
+ }
297
+
298
+ /**
299
+ * Remove saved region info
300
+ * @param regionID If it pass remove info for given region or removes all region info
301
+ * @returns promise with A callback that will be called on success or error.
302
+ */
303
+ function removeRegions(regionID) {
304
+ if (regionID == null) {
305
+ return PluginGeofencing.removeAllRegions();
306
+ } else {
307
+ return PluginGeofencing.removeRegion(regionID);
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Remove saved location info
313
+ * @returns promise with A callback that will be called on success or error.
314
+ */
315
+ function removeLocations() {
316
+ return PluginGeofencing.removeAllLocations();
317
+ }
318
+
319
+ /**
320
+ * Remove saved POI info
321
+ * @returns promise with A callback that will be called on success or error.
322
+ */
323
+ function removePois() {
324
+ return PluginGeofencing.removeAllPois();
325
+ }
326
+ /**
327
+ * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
328
+ * There are two way to host the json file:
329
+ * - included in the client application (local)
330
+ * - hosted externally in a file folder in your information system (external)
331
+ * @param sourceType local/external
332
+ * @param source location of profile to be fetch
333
+ * @returns promise with A callback that will be called on success or error.
334
+ */
335
+ function startCustomTracking(sourceType, source) {
336
+ return PluginGeofencing.startCustomTracking(sourceType, source);
337
+ }
338
+
339
+ /**
340
+ * Retrieve Beacon info for venue
341
+ * @param venueID - Optional venue id
342
+ * @param ref - Optional beacon id return by region event
343
+ * @returns promise with A callback that will be called on success or error.
344
+ */
345
+ function getIndoorBeacons(venueID, ref) {
346
+ if (venueID == null) {
347
+ return PluginGeofencing.getAllIndoorBeacons().then(result => {
348
+ var formatted = [];
349
+ result.forEach(item => {
350
+ if (ref !== undefined) {
351
+ if (item.identifier === ref) {
352
+ formatted.push(IndoorBeacon.jsonToObj(item));
353
+ }
354
+ } else {
355
+ formatted.push(IndoorBeacon.jsonToObj(item));
356
+ }
357
+ });
358
+ return Promise.resolve(formatted);
359
+ }).catch(e => {
360
+ return Promise.reject(e);
361
+ });
362
+ } else {
363
+ return PluginGeofencing.getIndoorBeacons(venueID).then(result => {
364
+ var formatted = [];
365
+ result.forEach(item => {
366
+ if (ref !== undefined) {
367
+ if (item.identifier === ref) {
368
+ formatted.push(IndoorBeacon.jsonToObj(item));
369
+ }
370
+ } else {
371
+ formatted.push(IndoorBeacon.jsonToObj(item));
372
+ }
373
+ });
374
+ return Promise.resolve(formatted);
375
+ }).catch(e => {
376
+ return Promise.reject(e);
377
+ });
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Remove saved POI info
383
+ * @returns promise with A callback that will be called on success or error.
384
+ */
385
+ function removeIndoorBeacons() {
386
+ return PluginGeofencing.removeIndoorBeacons();
387
+ }
388
+
389
+ /**
390
+ * Remove saved POI info
391
+ * @returns promise with A callback that will be called on success or error.
392
+ */
393
+ function refreshPois() {
394
+ return PluginGeofencing.refreshPois();
395
+ }
396
+ const WoosmapGeofencing = {
397
+ initialize,
398
+ setWoosmapApiKey,
399
+ startTracking,
400
+ requestPermissions,
401
+ requestBLEPermissions,
402
+ getPermissionsStatus,
403
+ getBLEPermissionsStatus,
404
+ stopTracking,
405
+ watchLocation,
406
+ clearLocationWatch,
407
+ watchRegions,
408
+ clearRegionsWatch,
409
+ setSFMCCredentials,
410
+ setPoiRadius,
411
+ addRegion,
412
+ getRegions,
413
+ removeRegions,
414
+ getLocations,
415
+ removeLocations,
416
+ getPois,
417
+ removePois,
418
+ startCustomTracking,
419
+ getIndoorBeacons,
420
+ removeIndoorBeacons,
421
+ refreshPois
422
+ };
423
+ export default WoosmapGeofencing;
424
+ //# sourceMappingURL=index.js.map