@woosmap/react-native-plugin-geofencing 0.1.25 → 0.1.27

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 (53) hide show
  1. package/lib/commonjs/index.js +333 -0
  2. package/lib/commonjs/index.js.map +1 -0
  3. package/lib/commonjs/internal/Airship.js +30 -0
  4. package/lib/commonjs/internal/Airship.js.map +1 -0
  5. package/lib/commonjs/internal/Location.js +45 -0
  6. package/lib/commonjs/internal/Location.js.map +1 -0
  7. package/lib/commonjs/internal/MarketingCloud.js +30 -0
  8. package/lib/commonjs/internal/MarketingCloud.js.map +1 -0
  9. package/lib/commonjs/internal/Poi.js +82 -0
  10. package/lib/commonjs/internal/Poi.js.map +1 -0
  11. package/lib/commonjs/internal/Region.js +57 -0
  12. package/lib/commonjs/internal/Region.js.map +1 -0
  13. package/lib/commonjs/internal/Visit.js +41 -0
  14. package/lib/commonjs/internal/Visit.js.map +1 -0
  15. package/lib/commonjs/internal/Zoi.js +77 -0
  16. package/lib/commonjs/internal/Zoi.js.map +1 -0
  17. package/lib/commonjs/internal/nativeInterface.js +14 -0
  18. package/lib/commonjs/internal/nativeInterface.js.map +1 -0
  19. package/lib/commonjs/internal/types.js +2 -0
  20. package/lib/commonjs/internal/types.js.map +1 -0
  21. package/lib/module/index.js +325 -0
  22. package/lib/module/index.js.map +1 -0
  23. package/lib/module/internal/Airship.js +28 -0
  24. package/lib/module/internal/Airship.js.map +1 -0
  25. package/lib/module/internal/Location.js +38 -0
  26. package/lib/module/internal/Location.js.map +1 -0
  27. package/lib/module/internal/MarketingCloud.js +28 -0
  28. package/lib/module/internal/MarketingCloud.js.map +1 -0
  29. package/lib/module/internal/Poi.js +75 -0
  30. package/lib/module/internal/Poi.js.map +1 -0
  31. package/lib/module/internal/Region.js +50 -0
  32. package/lib/module/internal/Region.js.map +1 -0
  33. package/lib/module/internal/Visit.js +39 -0
  34. package/lib/module/internal/Visit.js.map +1 -0
  35. package/lib/module/internal/Zoi.js +75 -0
  36. package/lib/module/internal/Zoi.js.map +1 -0
  37. package/lib/module/internal/nativeInterface.js +7 -0
  38. package/lib/module/internal/nativeInterface.js.map +1 -0
  39. package/lib/module/internal/types.js +2 -0
  40. package/lib/module/internal/types.js.map +1 -0
  41. package/lib/typescript/__tests__/index.test.d.ts +0 -0
  42. package/lib/typescript/index.d.ts +156 -0
  43. package/lib/typescript/internal/Airship.d.ts +18 -0
  44. package/lib/typescript/internal/Location.d.ts +26 -0
  45. package/lib/typescript/internal/MarketingCloud.d.ts +18 -0
  46. package/lib/typescript/internal/Poi.d.ts +50 -0
  47. package/lib/typescript/internal/Region.d.ts +34 -0
  48. package/lib/typescript/internal/Visit.d.ts +25 -0
  49. package/lib/typescript/internal/Zoi.d.ts +49 -0
  50. package/lib/typescript/internal/nativeInterface.d.ts +2 -0
  51. package/lib/typescript/internal/types.d.ts +18 -0
  52. package/package.json +147 -1
  53. package/src/__tests__/index.test.tsx +0 -1
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ /**
11
+ * A class that represents the Region object.
12
+ * @classdesc A class that represents the Region object.
13
+ * @constructs Region
14
+ * @param {number} date The datetime stamp.
15
+ * @param {boolean} didEnter A boolean value indicating whether the region was entered.
16
+ * @param {string} identifier An alphanumeric unique identifier for the region.
17
+ * @param {number} latitude The latitude of the region.
18
+ * @param {number} longitude The longitude of the region.
19
+ * @param {number} radius The radius of the region in meters.
20
+ * @param {boolean} frompositiondetection Determines whether the user's current position is inside the region.
21
+ * @param {string} eventName Describe cause of region event, Entry or Exit.
22
+ * @param {number} spenttime Number of seconds the user spent in region in case of event name Exit.
23
+ */
24
+ class Region {
25
+ constructor(date, didenter, identifier, latitude, longitude, radius, frompositiondetection, eventname, spenttime) {
26
+ _defineProperty(this, "Date", void 0);
27
+ _defineProperty(this, "Didenter", void 0);
28
+ _defineProperty(this, "Identifier", void 0);
29
+ _defineProperty(this, "Latitude", void 0);
30
+ _defineProperty(this, "Longitude", void 0);
31
+ _defineProperty(this, "Radius", void 0);
32
+ _defineProperty(this, "Frompositiondetection", void 0);
33
+ _defineProperty(this, "Eventname", void 0);
34
+ _defineProperty(this, "SpentTime", void 0);
35
+ this.Date = date;
36
+ this.Didenter = didenter;
37
+ this.Identifier = identifier;
38
+ this.Latitude = latitude;
39
+ this.Longitude = longitude;
40
+ this.Radius = radius;
41
+ this.Frompositiondetection = frompositiondetection;
42
+ this.Eventname = eventname;
43
+ this.SpentTime = spenttime;
44
+ }
45
+ /**
46
+ * Converts json object to an object of type Region.
47
+ * @param {Object} json The json representation of the region.
48
+ * @returns Object
49
+ * @memberof Region
50
+ */
51
+ static jsonToObj(json) {
52
+ return new Region(json.date, json.didenter, json.identifier, json.latitude, json.longitude, json.radius, json.frompositiondetection, json.eventname, json.spenttime);
53
+ }
54
+ }
55
+ var _default = Region;
56
+ exports.default = _default;
57
+ //# sourceMappingURL=Region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Region","constructor","date","didenter","identifier","latitude","longitude","radius","frompositiondetection","eventname","spenttime","_defineProperty","Date","Didenter","Identifier","Latitude","Longitude","Radius","Frompositiondetection","Eventname","SpentTime","jsonToObj","json","_default","exports","default"],"sources":["Region.tsx"],"sourcesContent":["/**\n * A class that represents the Region object.\n * @classdesc A class that represents the Region object.\n * @constructs Region\n * @param {number} date The datetime stamp.\n * @param {boolean} didEnter A boolean value indicating whether the region was entered.\n * @param {string} identifier An alphanumeric unique identifier for the region.\n * @param {number} latitude The latitude of the region.\n * @param {number} longitude The longitude of the region.\n * @param {number} radius The radius of the region in meters.\n * @param {boolean} frompositiondetection Determines whether the user's current position is inside the region.\n * @param {string} eventName Describe cause of region event, Entry or Exit.\n * @param {number} spenttime Number of seconds the user spent in region in case of event name Exit.\n */\nclass Region {\n Date: number;\n Didenter: boolean;\n Identifier: string;\n Latitude: number;\n Longitude: number;\n Radius: number;\n Frompositiondetection: boolean;\n Eventname: string;\n SpentTime: number;\n constructor(\n date: number,\n didenter: boolean,\n identifier: string,\n latitude: number,\n longitude: number,\n radius: number,\n frompositiondetection: boolean,\n eventname: string,\n spenttime: number\n ) {\n this.Date = date;\n this.Didenter = didenter;\n this.Identifier = identifier;\n this.Latitude = latitude;\n this.Longitude = longitude;\n this.Radius = radius;\n this.Frompositiondetection = frompositiondetection;\n this.Eventname = eventname;\n this.SpentTime = spenttime;\n }\n /**\n * Converts json object to an object of type Region.\n * @param {Object} json The json representation of the region.\n * @returns Object\n * @memberof Region\n */\n static jsonToObj(json: any) {\n return new Region(\n json.date,\n json.didenter,\n json.identifier,\n json.latitude,\n json.longitude,\n json.radius,\n json.frompositiondetection,\n json.eventname,\n json.spenttime\n );\n }\n}\nexport default Region;\n"],"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;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGV,IAAI;IAChB,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,UAAU,GAAGV,UAAU;IAC5B,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,MAAM,GAAGV,MAAM;IACpB,IAAI,CAACW,qBAAqB,GAAGV,qBAAqB;IAClD,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,SAAS,GAAGV,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOW,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAItB,MAAM,CACfsB,IAAI,CAACpB,IAAI,EACToB,IAAI,CAACnB,QAAQ,EACbmB,IAAI,CAAClB,UAAU,EACfkB,IAAI,CAACjB,QAAQ,EACbiB,IAAI,CAAChB,SAAS,EACdgB,IAAI,CAACf,MAAM,EACXe,IAAI,CAACd,qBAAqB,EAC1Bc,IAAI,CAACb,SAAS,EACda,IAAI,CAACZ,SAAS,CACf;EACH;AACF;AAAC,IAAAa,QAAA,GACcvB,MAAM;AAAAwB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ /**
7
+ * @classdesc A class that represents the visits object.
8
+ * @constructs Visit
9
+ * @param {number} accuracy The accuracy in meters.
10
+ * @param {number} arrivalDate The datetime stamp for the arrival at the place of visit.
11
+ * @param {number} date Current datetime stamp.
12
+ * @param {number} latitude The latitude of the place of visit.
13
+ * @param {number} longitude The longitude of the plaee of visit.
14
+ */
15
+ class Visit {
16
+ constructor(accuracy, arrivaldate, date, departuredate, latitude, longitude) {
17
+ _defineProperty(this, "Accuracy", void 0);
18
+ _defineProperty(this, "Arrivaldate", void 0);
19
+ _defineProperty(this, "Date", void 0);
20
+ _defineProperty(this, "Departuredate", void 0);
21
+ _defineProperty(this, "Latitude", void 0);
22
+ _defineProperty(this, "Longitude", void 0);
23
+ this.Accuracy = accuracy;
24
+ this.Arrivaldate = arrivaldate;
25
+ this.Date = date;
26
+ this.Departuredate = departuredate;
27
+ this.Latitude = latitude;
28
+ this.Longitude = longitude;
29
+ }
30
+ /**
31
+ * Converts json object to an object of type Visits.
32
+ * @param {Object} json The json representation of the Visits.
33
+ * @returns Visit
34
+ * @memberof Visit
35
+ */
36
+ static jsonToObj(json) {
37
+ return new Visit(json.accuracy, json.arrivaldate, json.date, json.departuredate, json.latitude, json.longitude);
38
+ }
39
+ }
40
+ module.exports = Visit;
41
+ //# sourceMappingURL=Visit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Visit","constructor","accuracy","arrivaldate","date","departuredate","latitude","longitude","_defineProperty","Accuracy","Arrivaldate","Date","Departuredate","Latitude","Longitude","jsonToObj","json","module","exports"],"sources":["Visit.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the visits object.\n * @constructs Visit\n * @param {number} accuracy The accuracy in meters.\n * @param {number} arrivalDate The datetime stamp for the arrival at the place of visit.\n * @param {number} date Current datetime stamp.\n * @param {number} latitude The latitude of the place of visit.\n * @param {number} longitude The longitude of the plaee of visit.\n */\nclass Visit {\n Accuracy: number;\n Arrivaldate: number;\n Date: number;\n Departuredate: number;\n Latitude: number;\n Longitude: number;\n constructor(\n accuracy: number,\n arrivaldate: number,\n date: number,\n departuredate: number,\n latitude: number,\n longitude: number\n ) {\n this.Accuracy = accuracy;\n this.Arrivaldate = arrivaldate;\n this.Date = date;\n this.Departuredate = departuredate;\n this.Latitude = latitude;\n this.Longitude = longitude;\n }\n /**\n * Converts json object to an object of type Visits.\n * @param {Object} json The json representation of the Visits.\n * @returns Visit\n * @memberof Visit\n */\n static jsonToObj(json: any): Visit {\n return new Visit(\n json.accuracy,\n json.arrivaldate,\n json.date,\n json.departuredate,\n json.latitude,\n json.longitude\n );\n }\n}\nmodule.exports = Visit;\n"],"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;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,QAAQ,GAAGP,QAAQ;IACxB,IAAI,CAACQ,WAAW,GAAGP,WAAW;IAC9B,IAAI,CAACQ,IAAI,GAAGP,IAAI;IAChB,IAAI,CAACQ,aAAa,GAAGP,aAAa;IAClC,IAAI,CAACQ,QAAQ,GAAGP,QAAQ;IACxB,IAAI,CAACQ,SAAS,GAAGP,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOQ,SAASA,CAACC,IAAS,EAAS;IACjC,OAAO,IAAIhB,KAAK,CACdgB,IAAI,CAACd,QAAQ,EACbc,IAAI,CAACb,WAAW,EAChBa,IAAI,CAACZ,IAAI,EACTY,IAAI,CAACX,aAAa,EAClBW,IAAI,CAACV,QAAQ,EACbU,IAAI,CAACT,SAAS,CACf;EACH;AACF;AACAU,MAAM,CAACC,OAAO,GAAGlB,KAAK"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ /**
7
+ * @classdesc A class that represents the Zones of Interest (ZOI) object.
8
+ * @constructs Zoi
9
+ * @param {number} accumulator Represents the number of visits used to build the ZOI (only for calculation of ZOI)
10
+ * @param {number} age Age is used to determine if a ZOI should be deleted by the algorithm (only for calculation of ZOI)
11
+ * @param {number} covariance_det The covariance determinant (only for calculation of ZOI)
12
+ * @param {number} duration The duration of all the accumulated visits of the ZOI
13
+ * @param {number} endtime The exit date of the last ZOI visit
14
+ * @param {string[]} idvisits The list of id visits included in this ZOI
15
+ * @param {number} latmean The latitude of the center of the ZOI
16
+ * @param {number} lngmean The longitude of the center of the ZOI
17
+ * @param {string} period The classification of the period (HOME, WORK, OTHER or NO QUALIFIER)
18
+ * @param {number} prior_probability Estimation of probability (only for calculation of ZOI)
19
+ * @param {number} starttime The entry date for the first ZOI visit
20
+ * @param {number} weekly_density The weekly density of the ZOI visit (only for classification of ZOI)
21
+ * @param {string} wktpolygon This is the Well-known text representation of geometry of the ZOI polygon.
22
+ * @param {number} x00covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
23
+ * @param {number} x01covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
24
+ * @param {number} x10covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
25
+ * @param {number} x11covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)
26
+
27
+ */
28
+ class Zoi {
29
+ 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) {
30
+ _defineProperty(this, "Accumulator", void 0);
31
+ _defineProperty(this, "Age", void 0);
32
+ _defineProperty(this, "Covariance_Det", void 0);
33
+ _defineProperty(this, "Duration", void 0);
34
+ _defineProperty(this, "Endtime", void 0);
35
+ _defineProperty(this, "Idvisits", void 0);
36
+ _defineProperty(this, "Latmean", void 0);
37
+ _defineProperty(this, "Lngmean", void 0);
38
+ _defineProperty(this, "Period", void 0);
39
+ _defineProperty(this, "Prior_Probability", void 0);
40
+ _defineProperty(this, "Starttime", void 0);
41
+ _defineProperty(this, "Weekly_Density", void 0);
42
+ _defineProperty(this, "X00Covariance_Matrix_Inverse", void 0);
43
+ _defineProperty(this, "X01Covariance_Matrix_Inverse", void 0);
44
+ _defineProperty(this, "X10Covariance_Matrix_Inverse", void 0);
45
+ _defineProperty(this, "X11Covariance_Matrix_Inverse", void 0);
46
+ _defineProperty(this, "Wktpolygon", void 0);
47
+ this.Accumulator = accumulator;
48
+ this.Age = age;
49
+ this.Covariance_Det = covariance_det;
50
+ this.Duration = duration;
51
+ this.Endtime = endtime;
52
+ this.Idvisits = idvisits;
53
+ this.Latmean = latmean;
54
+ this.Lngmean = lngmean;
55
+ this.Period = period;
56
+ this.Prior_Probability = prior_probability;
57
+ this.Starttime = starttime;
58
+ this.Weekly_Density = weekly_density;
59
+ this.Covariance_Det = covariance_det;
60
+ this.Wktpolygon = wktpolygon;
61
+ this.X00Covariance_Matrix_Inverse = x00covariance_matrix_inverse;
62
+ this.X01Covariance_Matrix_Inverse = x01covariance_matrix_inverse;
63
+ this.X10Covariance_Matrix_Inverse = x10covariance_matrix_inverse;
64
+ this.X11Covariance_Matrix_Inverse = x11covariance_matrix_inverse;
65
+ }
66
+ /**
67
+ * Converts json object to an object of type Zoi.
68
+ * @param {Object} json The json representation of the Zoi.
69
+ * @returns Object
70
+ * @memberof Zoi
71
+ */
72
+ static jsonToObj(json) {
73
+ 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);
74
+ }
75
+ }
76
+ module.exports = Zoi;
77
+ //# 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","_defineProperty","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"],"sources":["Zoi.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Zones of Interest (ZOI) object.\n * @constructs Zoi\n * @param {number} accumulator Represents the number of visits used to build the ZOI (only for calculation of ZOI)\n * @param {number} age Age is used to determine if a ZOI should be deleted by the algorithm (only for calculation of ZOI)\n * @param {number} covariance_det The covariance determinant (only for calculation of ZOI)\n * @param {number} duration The duration of all the accumulated visits of the ZOI\n * @param {number} endtime The exit date of the last ZOI visit\n * @param {string[]} idvisits The list of id visits included in this ZOI\n * @param {number} latmean The latitude of the center of the ZOI\n * @param {number} lngmean The longitude of the center of the ZOI\n * @param {string} period The classification of the period (HOME, WORK, OTHER or NO QUALIFIER)\n * @param {number} prior_probability Estimation of probability (only for calculation of ZOI)\n * @param {number} starttime The entry date for the first ZOI visit\n * @param {number} weekly_density The weekly density of the ZOI visit (only for classification of ZOI)\n * @param {string} wktpolygon This is the Well-known text representation of geometry of the ZOI polygon.\n * @param {number} x00covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x01covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x10covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x11covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n\n */\nclass Zoi {\n Accumulator: number;\n Age: number;\n Covariance_Det: number;\n Duration: number;\n Endtime: number;\n Idvisits: string[];\n Latmean: number;\n Lngmean: number;\n Period: string;\n Prior_Probability: number;\n Starttime: number;\n Weekly_Density: number;\n X00Covariance_Matrix_Inverse: number;\n X01Covariance_Matrix_Inverse: number;\n X10Covariance_Matrix_Inverse: number;\n X11Covariance_Matrix_Inverse: number;\n Wktpolygon: string;\n constructor(\n accumulator: number,\n age: number,\n covariance_det: number,\n duration: number,\n endtime: number,\n idvisits: string[],\n latmean: number,\n lngmean: number,\n period: string,\n prior_probability: number,\n starttime: number,\n weekly_density: number,\n wktpolygon: string,\n x00covariance_matrix_inverse: number,\n x01covariance_matrix_inverse: number,\n x10covariance_matrix_inverse: number,\n x11covariance_matrix_inverse: number\n ) {\n this.Accumulator = accumulator;\n this.Age = age;\n this.Covariance_Det = covariance_det;\n this.Duration = duration;\n this.Endtime = endtime;\n this.Idvisits = idvisits;\n this.Latmean = latmean;\n this.Lngmean = lngmean;\n this.Period = period;\n this.Prior_Probability = prior_probability;\n this.Starttime = starttime;\n this.Weekly_Density = weekly_density;\n this.Covariance_Det = covariance_det;\n this.Wktpolygon = wktpolygon;\n this.X00Covariance_Matrix_Inverse = x00covariance_matrix_inverse;\n this.X01Covariance_Matrix_Inverse = x01covariance_matrix_inverse;\n this.X10Covariance_Matrix_Inverse = x10covariance_matrix_inverse;\n this.X11Covariance_Matrix_Inverse = x11covariance_matrix_inverse;\n }\n /**\n * Converts json object to an object of type Zoi.\n * @param {Object} json The json representation of the Zoi.\n * @returns Object\n * @memberof Zoi\n */\n static jsonToObj(json: any) {\n return new Zoi(\n json.accumulator,\n json.age,\n json.covariance_det,\n json.duration,\n json.endtime,\n json.idvisits,\n json.latmean,\n json.lngmean,\n json.period,\n json.prior_probability,\n json.starttime,\n json.weekly_density,\n json.wktpolygon,\n json.x00covariance_matrix_inverse,\n json.x01covariance_matrix_inverse,\n json.x10covariance_matrix_inverse,\n json.x11covariance_matrix_inverse\n );\n }\n}\nmodule.exports = Zoi;\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,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;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,WAAW,GAAGlB,WAAW;IAC9B,IAAI,CAACmB,GAAG,GAAGlB,GAAG;IACd,IAAI,CAACmB,cAAc,GAAGlB,cAAc;IACpC,IAAI,CAACmB,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAACmB,QAAQ,GAAGlB,QAAQ;IACxB,IAAI,CAACmB,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAACmB,OAAO,GAAGlB,OAAO;IACtB,IAAI,CAACmB,MAAM,GAAGlB,MAAM;IACpB,IAAI,CAACmB,iBAAiB,GAAGlB,iBAAiB;IAC1C,IAAI,CAACmB,SAAS,GAAGlB,SAAS;IAC1B,IAAI,CAACmB,cAAc,GAAGlB,cAAc;IACpC,IAAI,CAACS,cAAc,GAAGlB,cAAc;IACpC,IAAI,CAAC4B,UAAU,GAAGlB,UAAU;IAC5B,IAAI,CAACmB,4BAA4B,GAAGlB,4BAA4B;IAChE,IAAI,CAACmB,4BAA4B,GAAGlB,4BAA4B;IAChE,IAAI,CAACmB,4BAA4B,GAAGlB,4BAA4B;IAChE,IAAI,CAACmB,4BAA4B,GAAGlB,4BAA4B;EAClE;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOmB,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAItC,GAAG,CACZsC,IAAI,CAACpC,WAAW,EAChBoC,IAAI,CAACnC,GAAG,EACRmC,IAAI,CAAClC,cAAc,EACnBkC,IAAI,CAACjC,QAAQ,EACbiC,IAAI,CAAChC,OAAO,EACZgC,IAAI,CAAC/B,QAAQ,EACb+B,IAAI,CAAC9B,OAAO,EACZ8B,IAAI,CAAC7B,OAAO,EACZ6B,IAAI,CAAC5B,MAAM,EACX4B,IAAI,CAAC3B,iBAAiB,EACtB2B,IAAI,CAAC1B,SAAS,EACd0B,IAAI,CAACzB,cAAc,EACnByB,IAAI,CAACxB,UAAU,EACfwB,IAAI,CAACvB,4BAA4B,EACjCuB,IAAI,CAACtB,4BAA4B,EACjCsB,IAAI,CAACrB,4BAA4B,EACjCqB,IAAI,CAACpB,4BAA4B,CAClC;EACH;AACF;AACAqB,MAAM,CAACC,OAAO,GAAGxC,GAAG"}
@@ -0,0 +1,14 @@
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 = PluginGeofencing;
13
+ exports.default = _default;
14
+ //# sourceMappingURL=nativeInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","PluginGeofencing","NativeModules","Error","_default","exports","default"],"sources":["nativeInterface.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nlet PluginGeofencing = NativeModules.PluginGeofencing;\n\nif (!PluginGeofencing) {\n throw new Error('NativeModules.PluginGeofencing is undefined');\n}\n\nexport default PluginGeofencing;\n"],"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,GAEcH,gBAAgB;AAAAI,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["/**\n * Geofence region types\n */\nexport type RegionType = 'circle' | 'isochrone';\n\n/**\n * Location of custom profile to fetch\n */\nexport type ProfileSource = 'local' | 'external';\n\n/**\n * GeofenceRegion structure\n */\nexport interface GeofenceRegion {\n regionId: string;\n lat: number;\n lng: number;\n radius: number;\n type: RegionType;\n}\n"],"mappings":""}
@@ -0,0 +1,325 @@
1
+ import { NativeEventEmitter } from 'react-native';
2
+ import uuid from 'react-native-uuid';
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
+ const eventEmitter = new NativeEventEmitter(PluginGeofencing);
8
+ let subscriptionsLocation = {};
9
+ let subscriptionsRegion = {};
10
+ /**
11
+ * Initializes the Woosmap object
12
+ * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
13
+ * @returns promise:success - A callback function that will be called on success.
14
+ error - A callback function that will be called on error.
15
+ */
16
+ function initialize(arg0) {
17
+ if (arg0 == null) {
18
+ arg0 = {};
19
+ }
20
+ return PluginGeofencing.initialize(arg0);
21
+ }
22
+
23
+ /**
24
+ * A method that sets Woosmap private API key
25
+ * @param apiKey new API key.
26
+ * @returns promise:success - A callback function that will be called on success.
27
+ error - A callback function that will be called on error.
28
+ */
29
+ function setWoosmapApiKey(apiKey) {
30
+ return PluginGeofencing.setWoosmapApiKey([apiKey]);
31
+ }
32
+
33
+ /**
34
+ * A method to start tracking the user's location.
35
+ * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.
36
+ * @returns promise:success - A callback function that will be called on success.
37
+ error - A callback function that will be called on error.
38
+ */
39
+ function startTracking(trackingProfile) {
40
+ return PluginGeofencing.startTracking([trackingProfile]);
41
+ }
42
+
43
+ /**
44
+ * Stops tracking the user's location.
45
+ * @returns promise:success - A callback function that will be called on success.
46
+ error - A callback function that will be called on error.
47
+ */
48
+ function stopTracking() {
49
+ return PluginGeofencing.stopTracking();
50
+ }
51
+
52
+ /**
53
+ * A method to request the required permissions to collect locations.
54
+ * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.
55
+ * @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'.
56
+ */
57
+ function requestPermissions(background) {
58
+ if (background == null) {
59
+ background = false;
60
+ }
61
+ return PluginGeofencing.requestPermissions([background]);
62
+ }
63
+
64
+ /**
65
+ * A method to check if the app has granted required permissions to track location.
66
+ * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED
67
+ */
68
+ function getPermissionsStatus() {
69
+ return PluginGeofencing.getPermissionsStatus();
70
+ }
71
+
72
+ /**
73
+ * Method will
74
+ invoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.
75
+ * @param success new location found callback
76
+ * @param error error status callback
77
+ * @returns watchid
78
+ */
79
+ function watchLocation(success, error) {
80
+ const watchID = uuid.v1().toString();
81
+ const successCallback = result => {
82
+ success(Location.jsonToObj(result));
83
+ };
84
+ subscriptionsLocation[watchID] = [eventEmitter.addListener('geolocationDidChange', successCallback), error ? eventEmitter.addListener('geolocationError', error) : null];
85
+ return PluginGeofencing.watchLocation(watchID);
86
+ }
87
+
88
+ /**
89
+ * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.
90
+ * @param watchID Reference ID.
91
+ * @returns return promise with same id back in case of success otherwise error info
92
+ */
93
+ function clearLocationWatch(watchID) {
94
+ if (watchID == null) {
95
+ eventEmitter.removeAllListeners('geolocationDidChange');
96
+ eventEmitter.removeAllListeners('geolocationError');
97
+ subscriptionsLocation = {};
98
+ return PluginGeofencing.clearAllLocationWatch();
99
+ } else {
100
+ const saved = subscriptionsLocation[watchID];
101
+ if (saved) {
102
+ const arg0 = saved[0];
103
+ eventEmitter.removeListener('geolocationDidChange', arg0);
104
+ const arg1 = saved[1];
105
+ if (arg1) {
106
+ eventEmitter.removeListener('geolocationError', arg1);
107
+ }
108
+ subscriptionsLocation[watchID] = undefined;
109
+ }
110
+ return PluginGeofencing.clearLocationWatch(watchID);
111
+ }
112
+ }
113
+
114
+ /**
115
+ * A method to to track Regions. Method will invoke a callback with Region object. Method will return
116
+ a watch id which can be used later to remove the callback.
117
+ * @param success new location found callback
118
+ * @param error error status callback
119
+ * @returns watchid
120
+ */
121
+ function watchRegions(success, error) {
122
+ const watchID = uuid.v1().toString();
123
+ const successCallback = result => {
124
+ success(Region.jsonToObj(result));
125
+ };
126
+ subscriptionsRegion[watchID] = [eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback), error ? eventEmitter.addListener('woosmapgeofenceRegionError', error) : null];
127
+ return PluginGeofencing.watchRegions(watchID);
128
+ }
129
+
130
+ /**
131
+ * 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.
132
+ * @param watchID Reference ID.
133
+ * @returns return promise with same id back in case of success otherwise error info
134
+ */
135
+ function clearRegionsWatch(watchID) {
136
+ if (watchID == null) {
137
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');
138
+ eventEmitter.removeAllListeners('woosmapgeofenceRegionError');
139
+ subscriptionsRegion = {};
140
+ return PluginGeofencing.clearAllRegionsWatch();
141
+ } else {
142
+ const saved = subscriptionsRegion[watchID];
143
+ if (saved) {
144
+ const arg0 = saved[0];
145
+ eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);
146
+ const arg1 = saved[1];
147
+ if (arg1) {
148
+ eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);
149
+ }
150
+ subscriptionsRegion[watchID] = undefined;
151
+ }
152
+ return PluginGeofencing.clearRegionsWatch(watchID);
153
+ }
154
+ }
155
+ /**
156
+ * Sets Sales Force Marketing Cloud (SFMC) credentials
157
+ * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.
158
+ * @returns promise with A callback that will be called on success or error.
159
+ */
160
+ function setSFMCCredentials(arg0) {
161
+ return PluginGeofencing.setSFMCCredentials(arg0);
162
+ }
163
+
164
+ /**
165
+ * 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").
166
+ * @param radius can be integer or string.
167
+ * @returns promise with A callback that will be called on success or error.
168
+ */
169
+ function setPoiRadius(radius) {
170
+ return PluginGeofencing.setPoiRadius(radius);
171
+ }
172
+ /**
173
+ * Adds a custom region that you want to monitor.
174
+ * @param region A GeofenceRegion object with latitude, longitude, radius and type.
175
+ * @returns promise with A callback that will be called on success or error.
176
+ */
177
+
178
+ function addRegion(region) {
179
+ return PluginGeofencing.addRegion(region);
180
+ }
181
+ /**
182
+ * Retrieve saved region info
183
+ * @param regionID If it pass return info for given region or return all region info
184
+ * @returns promise with A callback that will be called on success or error.
185
+ */
186
+ function getRegions(regionID) {
187
+ if (regionID == null) {
188
+ return PluginGeofencing.getAllRegions().then(result => {
189
+ var formatted = [];
190
+ result.forEach(item => {
191
+ formatted.push(Region.jsonToObj(item));
192
+ });
193
+ return Promise.resolve(formatted);
194
+ }).catch(e => {
195
+ return Promise.reject(e);
196
+ });
197
+ } else {
198
+ return PluginGeofencing.getRegions(regionID).then(result => {
199
+ var formatted = [];
200
+ formatted.push(Region.jsonToObj(result));
201
+ return Promise.resolve(formatted);
202
+ }).catch(e => {
203
+ return Promise.reject(e);
204
+ });
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Retrieve saved location info
210
+ * @param locationID - Optional in case of location id pass it return only that location info
211
+ * @returns promise with A callback that will be called on success or error.
212
+ */
213
+ function getLocations(locationID) {
214
+ if (locationID == null) {
215
+ return PluginGeofencing.getAllLocations().then(result => {
216
+ var formatted = [];
217
+ result.forEach(item => {
218
+ formatted.push(Location.jsonToObj(item));
219
+ });
220
+ return Promise.resolve(formatted);
221
+ }).catch(e => {
222
+ return Promise.reject(e);
223
+ });
224
+ } else {
225
+ return PluginGeofencing.getLocation(locationID).then(result => {
226
+ var formatted = [];
227
+ formatted.push(Location.jsonToObj(result));
228
+ return Promise.resolve(formatted);
229
+ }).catch(e => {
230
+ return Promise.reject(e);
231
+ });
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Retrieve saved POI info
237
+ * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
238
+ * @returns promise with A callback that will be called on success or error.
239
+ */
240
+ function getPois(poiID) {
241
+ if (poiID == null) {
242
+ return PluginGeofencing.getAllPois().then(result => {
243
+ var formatted = [];
244
+ result.forEach(item => {
245
+ formatted.push(Poi.jsonToObj(item));
246
+ });
247
+ return Promise.resolve(formatted);
248
+ }).catch(e => {
249
+ return Promise.reject(e);
250
+ });
251
+ } else {
252
+ return PluginGeofencing.getPoi(poiID).then(result => {
253
+ var formatted = [];
254
+ formatted.push(Poi.jsonToObj(result));
255
+ return Promise.resolve(formatted);
256
+ }).catch(e => {
257
+ return Promise.reject(e);
258
+ });
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Remove saved region info
264
+ * @param regionID If it pass remove info for given region or removes all region info
265
+ * @returns promise with A callback that will be called on success or error.
266
+ */
267
+ function removeRegions(regionID) {
268
+ if (regionID == null) {
269
+ return PluginGeofencing.removeAllRegions();
270
+ } else {
271
+ return PluginGeofencing.removeRegion(regionID);
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Remove saved location info
277
+ * @returns promise with A callback that will be called on success or error.
278
+ */
279
+ function removeLocations() {
280
+ return PluginGeofencing.removeAllLocations();
281
+ }
282
+
283
+ /**
284
+ * Remove saved POI info
285
+ * @returns promise with A callback that will be called on success or error.
286
+ */
287
+ function removePois() {
288
+ return PluginGeofencing.removeAllPois();
289
+ }
290
+ /**
291
+ * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
292
+ * There are two way to host the json file:
293
+ * - included in the client application (local)
294
+ * - hosted externally in a file folder in your information system (external)
295
+ * @param sourceType local/external
296
+ * @param source location of profile to be fetch
297
+ * @returns promise with A callback that will be called on success or error.
298
+ */
299
+ function startCustomTracking(sourceType, source) {
300
+ return PluginGeofencing.startCustomTracking(sourceType, source);
301
+ }
302
+ const WoosmapGeofencing = {
303
+ initialize,
304
+ setWoosmapApiKey,
305
+ startTracking,
306
+ requestPermissions,
307
+ getPermissionsStatus,
308
+ stopTracking,
309
+ watchLocation,
310
+ clearLocationWatch,
311
+ watchRegions,
312
+ clearRegionsWatch,
313
+ setSFMCCredentials,
314
+ setPoiRadius,
315
+ addRegion,
316
+ getRegions,
317
+ removeRegions,
318
+ getLocations,
319
+ removeLocations,
320
+ getPois,
321
+ removePois,
322
+ startCustomTracking
323
+ };
324
+ export default WoosmapGeofencing;
325
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","uuid","PluginGeofencing","Location","Region","Poi","eventEmitter","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","v1","toString","successCallback","result","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","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","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,SAASA,kBAAkB,QAAQ,cAAc;AACjD,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,GAAG,MAAM,gBAAgB;AAOhC,MAAMC,YAAY,GAAG,IAAIN,kBAAkB,CAACE,gBAAgB,CAAC;AAE7D,IAAIK,qBAA0B,GAAG,CAAC,CAAC;AACnC,IAAIC,mBAAwB,GAAG,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACC,IAAU,EAAmB;EAC/C,IAAIA,IAAI,IAAI,IAAI,EAAE;IAChBA,IAAI,GAAG,CAAC,CAAC;EACX;EACA,OAAOR,gBAAgB,CAACO,UAAU,CAACC,IAAI,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAACC,MAAc,EAAmB;EACzD,OAAOV,gBAAgB,CAACS,gBAAgB,CAAC,CAACC,MAAM,CAAC,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAACC,eAAuB,EAAmB;EAC/D,OAAOZ,gBAAgB,CAACW,aAAa,CAAC,CAACC,eAAe,CAAC,CAAC;AAC1D;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAA,EAAoB;EACvC,OAAOb,gBAAgB,CAACa,YAAY,EAAE;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,UAAoB,EAAmB;EACjE,IAAIA,UAAU,IAAI,IAAI,EAAE;IACtBA,UAAU,GAAG,KAA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A;AACA;AACA,SAASuB,eAAeA,CAAA,EAAoB;EAC1C,OAAOlE,gBAAgB,CAACmE,kBAAkB,EAAE;AAC9C;;AAEA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAA,EAAoB;EACrC,OAAOpE,gBAAgB,CAACqE,aAAa,EAAE;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,UAAyB,EACzBC,MAAc,EACG;EACjB,OAAOxE,gBAAgB,CAACsE,mBAAmB,CAACC,UAAU,EAAEC,MAAM,CAAC;AACjE;AAWA,MAAMC,iBAAiB,GAAG;EACxBlE,UAAU;EACVE,gBAAgB;EAChBE,aAAa;EACbG,kBAAkB;EAClBE,oBAAoB;EACpBH,YAAY;EACZI,aAAa;EACbU,kBAAkB;EAClBO,YAAY;EACZC,iBAAiB;EACjBE,kBAAkB;EAClBC,YAAY;EACZE,SAAS;EACTE,UAAU;EACVqB,aAAa;EACbR,YAAY;EACZW,eAAe;EACfP,OAAO;EACPS,UAAU;EACVE;AACF,CAAC;AAED,eAAeG,iBAAiB"}
@@ -0,0 +1,28 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
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","_defineProperty","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,WAAWA,CAACC,IAAY,EAAEC,UAAkB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAC5C,IAAI,CAACC,IAAI,GAAGH,IAAI;IAChB,IAAI,CAACI,UAAU,GAAGH,UAAU;EAC9B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOI,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIR,OAAO,CAACQ,IAAI,CAACN,IAAI,EAAEM,IAAI,CAACL,UAAU,CAAC;EAChD;AACF;AACAM,MAAM,CAACC,OAAO,GAAGV,OAAO"}