cordova-plugin-insider 3.0.2 → 3.1.0

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.
package/www/Event.js DELETED
@@ -1,190 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- var Utils = require("./Utils");
11
- var InsiderConstants = require("./Constants");
12
- var Event = /*#__PURE__*/function () {
13
- function Event(name) {
14
- _classCallCheck(this, Event);
15
- _defineProperty(this, "name", '');
16
- _defineProperty(this, "parameters", {});
17
- this.name = name;
18
- }
19
- return _createClass(Event, [{
20
- key: "addParameterWithString",
21
- value: function addParameterWithString(key, value) {
22
- if (Utils.checkParameters([{
23
- type: 'string',
24
- value: key
25
- }, {
26
- type: 'string',
27
- value: value
28
- }])) {
29
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithString');
30
- return this;
31
- }
32
- try {
33
- this.parameters[key] = value;
34
- return this;
35
- } catch (error) {
36
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
37
- }
38
- }
39
- }, {
40
- key: "addParameterWithInt",
41
- value: function addParameterWithInt(key, value) {
42
- if (Utils.checkParameters([{
43
- type: 'string',
44
- value: key
45
- }, {
46
- type: 'number',
47
- value: value
48
- }])) {
49
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithInt');
50
- return this;
51
- }
52
- try {
53
- this.parameters[key] = value;
54
- return this;
55
- } catch (error) {
56
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
57
- }
58
- }
59
- }, {
60
- key: "addParameterWithDouble",
61
- value: function addParameterWithDouble(key, value) {
62
- if (Utils.checkParameters([{
63
- type: 'string',
64
- value: key
65
- }, {
66
- type: 'number',
67
- value: value
68
- }])) {
69
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithDouble');
70
- return this;
71
- }
72
- try {
73
- this.parameters[key] = value;
74
- return this;
75
- } catch (error) {
76
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
77
- }
78
- }
79
- }, {
80
- key: "addParameterWithBoolean",
81
- value: function addParameterWithBoolean(key, value) {
82
- if (Utils.checkParameters([{
83
- type: 'string',
84
- value: key
85
- }, {
86
- type: 'boolean',
87
- value: value
88
- }])) {
89
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithBoolean');
90
- return this;
91
- }
92
- try {
93
- this.parameters[key] = value;
94
- return this;
95
- } catch (error) {
96
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
97
- }
98
- }
99
- }, {
100
- key: "addParameterWithDate",
101
- value: function addParameterWithDate(key, value) {
102
- if (Utils.checkParameters([{
103
- type: 'string',
104
- value: key
105
- }, {
106
- type: 'object',
107
- value: value
108
- }])) {
109
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithDate');
110
- return this;
111
- }
112
- try {
113
- this.parameters[key] = value.toISOString();
114
- return this;
115
- } catch (error) {
116
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
117
- }
118
- }
119
- }, {
120
- key: "addParameterWithArray",
121
- value: function addParameterWithArray(key, value) {
122
- if (Utils.checkParameters([{
123
- type: 'string',
124
- value: key
125
- }, {
126
- type: 'object',
127
- value: value
128
- }])) {
129
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithArray');
130
- return this;
131
- }
132
- try {
133
- this.parameters[key] = value;
134
- return this;
135
- } catch (error) {
136
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
137
- }
138
- }
139
- }, {
140
- key: "addParameterWithStringArray",
141
- value: function addParameterWithStringArray(key, value) {
142
- if (Utils.checkParameters([{
143
- type: 'string',
144
- value: key
145
- }, {
146
- type: 'string_array',
147
- value: value
148
- }])) {
149
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithStringArray');
150
- return this;
151
- }
152
- try {
153
- this.parameters[key] = value;
154
- return this;
155
- } catch (error) {
156
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
157
- }
158
- }
159
- }, {
160
- key: "addParameterWithNumericArray",
161
- value: function addParameterWithNumericArray(key, value) {
162
- if (Utils.checkParameters([{
163
- type: 'string',
164
- value: key
165
- }, {
166
- type: 'numeric_array',
167
- value: value
168
- }])) {
169
- Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithNumericArray');
170
- return this;
171
- }
172
- try {
173
- this.parameters[key] = value;
174
- return this;
175
- } catch (error) {
176
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
177
- }
178
- }
179
- }, {
180
- key: "build",
181
- value: function build() {
182
- try {
183
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.TAG_EVENT, [this.name, this.parameters]);
184
- } catch (error) {
185
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
186
- }
187
- }
188
- }]);
189
- }();
190
- module.exports = Event;
package/www/Gender.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- MALE: 0,
5
- FEMALE: 1,
6
- OTHER: 2
7
- };
package/www/Identifier.js DELETED
@@ -1,96 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- var Utils = require("./Utils");
11
- var InsiderConstants = require("./Constants");
12
- var Identifier = /*#__PURE__*/function () {
13
- function Identifier() {
14
- _classCallCheck(this, Identifier);
15
- _defineProperty(this, "identifiers", {});
16
- this.identifiers = {};
17
- }
18
- return _createClass(Identifier, [{
19
- key: "addEmail",
20
- value: function addEmail(email) {
21
- if (Utils.checkParameters([{
22
- type: 'string',
23
- value: email
24
- }])) {
25
- Utils.showParameterWarningLog(this.constructor.name + '-addEmail');
26
- return this;
27
- }
28
- try {
29
- this.identifiers[InsiderConstants.ADD_EMAIL] = email;
30
- } catch (error) {
31
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
32
- }
33
- return this;
34
- }
35
- }, {
36
- key: "addPhoneNumber",
37
- value: function addPhoneNumber(phoneNumber) {
38
- if (Utils.checkParameters([{
39
- type: 'string',
40
- value: phoneNumber
41
- }])) {
42
- Utils.showParameterWarningLog(this.constructor.name + '-addPhoneNumber');
43
- return this;
44
- }
45
- try {
46
- this.identifiers[InsiderConstants.ADD_PHONE_NUMBER] = phoneNumber;
47
- } catch (error) {
48
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
49
- }
50
- return this;
51
- }
52
- }, {
53
- key: "addUserID",
54
- value: function addUserID(userID) {
55
- if (Utils.checkParameters([{
56
- type: 'string',
57
- value: userID
58
- }])) {
59
- Utils.showParameterWarningLog(this.constructor.name + '-addUserID');
60
- return this;
61
- }
62
- try {
63
- this.identifiers[InsiderConstants.ADD_USER_ID] = userID;
64
- } catch (error) {
65
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
66
- }
67
- return this;
68
- }
69
- }, {
70
- key: "addCustomIdentifier",
71
- value: function addCustomIdentifier(key, value) {
72
- if (Utils.checkParameters([{
73
- type: 'string',
74
- value: key
75
- }, {
76
- type: 'string',
77
- value: value
78
- }])) {
79
- Utils.showParameterWarningLog(this.constructor.name + '-addCustomIdentifier');
80
- return this;
81
- }
82
- try {
83
- this.identifiers[key] = value;
84
- } catch (error) {
85
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
86
- }
87
- return this;
88
- }
89
- }, {
90
- key: "getIdentifiers",
91
- value: function getIdentifiers() {
92
- return this.identifiers;
93
- }
94
- }]);
95
- }();
96
- module.exports = Identifier;