cordova-plugin-insider 2.3.0 → 2.4.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/User.js CHANGED
@@ -1,375 +1,461 @@
1
1
  "use strict";
2
2
 
3
- const Utils = require("./Utils");
4
- const InsiderConstants = require("./Constants");
5
-
6
- class User {
7
- constructor() {}
8
-
9
- setGender(gender) {
10
- if (Utils.checkParameters([{ type: 'number', value: gender }])) {
11
- Utils.showParameterWarningLog(this.constructor.name + '-setGender');
12
- return this;
13
- }
14
-
15
- try {
16
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_GENDER, [gender]);
17
- } catch (error) {
18
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
19
- }
20
-
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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ 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); }
9
+ var Utils = require("./Utils");
10
+ var InsiderConstants = require("./Constants");
11
+ var User = /*#__PURE__*/function () {
12
+ function User() {
13
+ _classCallCheck(this, User);
14
+ }
15
+ return _createClass(User, [{
16
+ key: "setGender",
17
+ value: function setGender(gender) {
18
+ if (Utils.checkParameters([{
19
+ type: 'number',
20
+ value: gender
21
+ }])) {
22
+ Utils.showParameterWarningLog(this.constructor.name + '-setGender');
21
23
  return this;
24
+ }
25
+ try {
26
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_GENDER, [gender]);
27
+ } catch (error) {
28
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
29
+ }
30
+ return this;
22
31
  }
23
-
24
- setBirthday(birthday) {
25
- if (Utils.checkParameters([{ type: 'string', value: birthday }])) {
26
- Utils.showParameterWarningLog(this.constructor.name + '-setBirthday');
27
- return this;
28
- }
29
-
30
- try {
31
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_BIRTDAY, [birthday.toISOString()]);
32
- } catch (error) {
33
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
34
- }
32
+ }, {
33
+ key: "setBirthday",
34
+ value: function setBirthday(birthday) {
35
+ if (Utils.checkParameters([{
36
+ type: 'string',
37
+ value: birthday
38
+ }])) {
39
+ Utils.showParameterWarningLog(this.constructor.name + '-setBirthday');
35
40
  return this;
41
+ }
42
+ try {
43
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_BIRTDAY, [birthday.toISOString()]);
44
+ } catch (error) {
45
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
46
+ }
47
+ return this;
36
48
  }
37
-
38
- setName(name) {
39
- if (Utils.checkParameters([{ type: 'string', value: name }])) {
40
- Utils.showParameterWarningLog(this.constructor.name + '-setName');
41
- return this;
42
- }
43
-
44
- try {
45
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_NAME, [name]);
46
- } catch (error) {
47
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
48
- }
49
+ }, {
50
+ key: "setName",
51
+ value: function setName(name) {
52
+ if (Utils.checkParameters([{
53
+ type: 'string',
54
+ value: name
55
+ }])) {
56
+ Utils.showParameterWarningLog(this.constructor.name + '-setName');
49
57
  return this;
58
+ }
59
+ try {
60
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_NAME, [name]);
61
+ } catch (error) {
62
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
63
+ }
64
+ return this;
50
65
  }
51
-
52
- setSurname(surname) {
53
- if (Utils.checkParameters([{ type: 'string', value: surname }])) {
54
- Utils.showParameterWarningLog(this.constructor.name + '-setSurname');
55
- return this;
56
- }
57
-
58
- try {
59
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SURNAME, [surname]);
60
- } catch (error) {
61
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
62
- }
63
-
66
+ }, {
67
+ key: "setSurname",
68
+ value: function setSurname(surname) {
69
+ if (Utils.checkParameters([{
70
+ type: 'string',
71
+ value: surname
72
+ }])) {
73
+ Utils.showParameterWarningLog(this.constructor.name + '-setSurname');
64
74
  return this;
75
+ }
76
+ try {
77
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SURNAME, [surname]);
78
+ } catch (error) {
79
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
80
+ }
81
+ return this;
65
82
  }
66
-
67
- setAge(age) {
68
- if (Utils.checkParameters([{ type: 'string', value: age }])) {
69
- Utils.showParameterWarningLog(this.constructor.name + '-setAge');
70
- return this;
71
- }
72
-
73
- try {
74
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_AGE, [age]);
75
- } catch (error) {
76
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
77
- }
78
-
83
+ }, {
84
+ key: "setAge",
85
+ value: function setAge(age) {
86
+ if (Utils.checkParameters([{
87
+ type: 'string',
88
+ value: age
89
+ }])) {
90
+ Utils.showParameterWarningLog(this.constructor.name + '-setAge');
79
91
  return this;
92
+ }
93
+ try {
94
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_AGE, [age]);
95
+ } catch (error) {
96
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
97
+ }
98
+ return this;
80
99
  }
81
-
82
-
83
- setEmail(email) {
84
- if (Utils.checkParameters([{ type: 'string', value: email }])) {
85
- Utils.showParameterWarningLog(this.constructor.name + '-setEmail');
86
- return this;
87
- }
88
-
89
- try {
90
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL, [email]);
91
- } catch (error) {
92
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
93
- }
94
-
100
+ }, {
101
+ key: "setEmail",
102
+ value: function setEmail(email) {
103
+ if (Utils.checkParameters([{
104
+ type: 'string',
105
+ value: email
106
+ }])) {
107
+ Utils.showParameterWarningLog(this.constructor.name + '-setEmail');
95
108
  return this;
109
+ }
110
+ try {
111
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL, [email]);
112
+ } catch (error) {
113
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
114
+ }
115
+ return this;
96
116
  }
97
-
98
- setPhoneNumber(phone) {
99
- if (Utils.checkParameters([{ type: 'string', value: phone }])) {
100
- Utils.showParameterWarningLog(this.constructor.name + '-setPhoneNumber');
101
- return this;
102
- }
103
-
104
- try {
105
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PHONE_NUMBER, [phone]);
106
- } catch (error) {
107
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
108
- }
109
-
117
+ }, {
118
+ key: "setPhoneNumber",
119
+ value: function setPhoneNumber(phone) {
120
+ if (Utils.checkParameters([{
121
+ type: 'string',
122
+ value: phone
123
+ }])) {
124
+ Utils.showParameterWarningLog(this.constructor.name + '-setPhoneNumber');
110
125
  return this;
126
+ }
127
+ try {
128
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PHONE_NUMBER, [phone]);
129
+ } catch (error) {
130
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
131
+ }
132
+ return this;
111
133
  }
112
-
113
- setLanguage(language) {
114
- if (Utils.checkParameters([{ type: 'string', value: language }])) {
115
- Utils.showParameterWarningLog(this.constructor.name + '-setLanguage');
116
- return this;
117
- }
118
-
119
- try {
120
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LANGUAGE, [language]);
121
- } catch (error) {
122
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
123
- }
124
-
134
+ }, {
135
+ key: "setLanguage",
136
+ value: function setLanguage(language) {
137
+ if (Utils.checkParameters([{
138
+ type: 'string',
139
+ value: language
140
+ }])) {
141
+ Utils.showParameterWarningLog(this.constructor.name + '-setLanguage');
125
142
  return this;
143
+ }
144
+ try {
145
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LANGUAGE, [language]);
146
+ } catch (error) {
147
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
148
+ }
149
+ return this;
126
150
  }
127
-
128
- setLocale(locale) {
129
- if (Utils.checkParameters([{ type: 'string', value: locale }])) {
130
- Utils.showParameterWarningLog(this.constructor.name + '-setLocale');
131
- return this;
132
- }
133
-
134
- try {
135
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCALE, [locale]);
136
- } catch (error) {
137
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
138
- }
139
-
151
+ }, {
152
+ key: "setLocale",
153
+ value: function setLocale(locale) {
154
+ if (Utils.checkParameters([{
155
+ type: 'string',
156
+ value: locale
157
+ }])) {
158
+ Utils.showParameterWarningLog(this.constructor.name + '-setLocale');
140
159
  return this;
160
+ }
161
+ try {
162
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCALE, [locale]);
163
+ } catch (error) {
164
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
165
+ }
166
+ return this;
141
167
  }
142
-
143
- setFacebookID(facebookID) {
144
- if (Utils.checkParameters([{ type: 'string', value: facebookID }])) {
145
- Utils.showParameterWarningLog(this.constructor.name + '-setFacebookID');
146
- return this;
147
- }
148
-
149
- try {
150
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_FACEBOOK_ID, [facebookID]);
151
- } catch (error) {
152
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
153
- }
154
-
168
+ }, {
169
+ key: "setFacebookID",
170
+ value: function setFacebookID(facebookID) {
171
+ if (Utils.checkParameters([{
172
+ type: 'string',
173
+ value: facebookID
174
+ }])) {
175
+ Utils.showParameterWarningLog(this.constructor.name + '-setFacebookID');
155
176
  return this;
177
+ }
178
+ try {
179
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_FACEBOOK_ID, [facebookID]);
180
+ } catch (error) {
181
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
182
+ }
183
+ return this;
156
184
  }
157
-
158
- setTwitterID(twitterID) {
159
- if (Utils.checkParameters([{ type: 'string', value: twitterID }])) {
160
- Utils.showParameterWarningLog(this.constructor.name + '-setTwitterID');
161
- return this;
162
- }
163
-
164
- try {
165
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_TWITTER_ID, [twitterID]);
166
- } catch (error) {
167
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
168
- }
169
-
185
+ }, {
186
+ key: "setTwitterID",
187
+ value: function setTwitterID(twitterID) {
188
+ if (Utils.checkParameters([{
189
+ type: 'string',
190
+ value: twitterID
191
+ }])) {
192
+ Utils.showParameterWarningLog(this.constructor.name + '-setTwitterID');
170
193
  return this;
194
+ }
195
+ try {
196
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_TWITTER_ID, [twitterID]);
197
+ } catch (error) {
198
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
199
+ }
200
+ return this;
171
201
  }
172
-
173
- setEmailOptin(emailOptIn) {
174
- if (Utils.checkParameters([{ type: 'boolean', value: emailOptIn }])) {
175
- Utils.showParameterWarningLog(this.constructor.name + '-setEmailOptin');
176
- return this;
177
- }
178
-
179
- try {
180
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL_OPTIN, [emailOptIn]);
181
- } catch (error) {
182
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
183
- }
184
-
202
+ }, {
203
+ key: "setEmailOptin",
204
+ value: function setEmailOptin(emailOptIn) {
205
+ if (Utils.checkParameters([{
206
+ type: 'boolean',
207
+ value: emailOptIn
208
+ }])) {
209
+ Utils.showParameterWarningLog(this.constructor.name + '-setEmailOptin');
185
210
  return this;
211
+ }
212
+ try {
213
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL_OPTIN, [emailOptIn]);
214
+ } catch (error) {
215
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
216
+ }
217
+ return this;
186
218
  }
187
-
188
- setSMSOptin(smsOptIn) {
189
- if (Utils.checkParameters([{ type: 'boolean', value: emailOptIn }])) {
190
- Utils.showParameterWarningLog(this.constructor.name + '-setSMSOptin');
191
- return this;
192
- }
193
-
194
- try {
195
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SMS_OPTIN, [smsOptIn]);
196
- } catch (error) {
197
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
198
- }
219
+ }, {
220
+ key: "setSMSOptin",
221
+ value: function setSMSOptin(smsOptIn) {
222
+ if (Utils.checkParameters([{
223
+ type: 'boolean',
224
+ value: smsOptIn
225
+ }])) {
226
+ Utils.showParameterWarningLog(this.constructor.name + '-setSMSOptin');
199
227
  return this;
228
+ }
229
+ try {
230
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SMS_OPTIN, [smsOptIn]);
231
+ } catch (error) {
232
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
233
+ }
234
+ return this;
200
235
  }
201
-
202
- setPushOptin(pushOptIn) {
203
- if (Utils.checkParameters([{ type: 'boolean', value: pushOptIn }])) {
204
- Utils.showParameterWarningLog(this.constructor.name + '-setPushOptin');
205
- return this;
206
- }
207
-
208
- try {
209
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PUSH_OPTIN, [pushOptIn]);
210
- } catch (error) {
211
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
212
- }
213
-
236
+ }, {
237
+ key: "setPushOptin",
238
+ value: function setPushOptin(pushOptIn) {
239
+ if (Utils.checkParameters([{
240
+ type: 'boolean',
241
+ value: pushOptIn
242
+ }])) {
243
+ Utils.showParameterWarningLog(this.constructor.name + '-setPushOptin');
214
244
  return this;
245
+ }
246
+ try {
247
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PUSH_OPTIN, [pushOptIn]);
248
+ } catch (error) {
249
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
250
+ }
251
+ return this;
215
252
  }
216
-
217
- setLocationOptin(locationOptIn) {
218
- if (Utils.checkParameters([{ type: 'boolean', value: locationOptIn }])) {
219
- Utils.showParameterWarningLog(this.constructor.name + '-setLocationOptin');
220
- return this;
221
- }
222
-
223
- try {
224
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCATION_OPTIN, [locationOptIn]);
225
- } catch (error) {
226
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
227
- }
228
-
253
+ }, {
254
+ key: "setLocationOptin",
255
+ value: function setLocationOptin(locationOptIn) {
256
+ if (Utils.checkParameters([{
257
+ type: 'boolean',
258
+ value: locationOptIn
259
+ }])) {
260
+ Utils.showParameterWarningLog(this.constructor.name + '-setLocationOptin');
229
261
  return this;
262
+ }
263
+ try {
264
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCATION_OPTIN, [locationOptIn]);
265
+ } catch (error) {
266
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
267
+ }
268
+ return this;
230
269
  }
231
-
232
- setWhatsappOptin(whatsappOptin) {
233
- if (Utils.checkParameters([{ type: 'boolean', value: whatsappOptin }])) {
234
- Utils.showParameterWarningLog(this.constructor.name + '-setWhatsappOptin');
235
- return this;
236
- }
237
-
238
- try {
239
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_WHATSAPP_OPTIN, [whatsappOptin]);
240
- } catch (error) {
241
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
242
- }
243
-
270
+ }, {
271
+ key: "setWhatsappOptin",
272
+ value: function setWhatsappOptin(whatsappOptin) {
273
+ if (Utils.checkParameters([{
274
+ type: 'boolean',
275
+ value: whatsappOptin
276
+ }])) {
277
+ Utils.showParameterWarningLog(this.constructor.name + '-setWhatsappOptin');
244
278
  return this;
279
+ }
280
+ try {
281
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_WHATSAPP_OPTIN, [whatsappOptin]);
282
+ } catch (error) {
283
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
284
+ }
285
+ return this;
245
286
  }
246
-
247
- login(identifiers, insiderIDResult) {
248
- try {
249
- if (!Utils.checkParameters([{ type: 'function', value: insiderIDResult }, { type: 'object', value: identifiers }])) {
250
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers, insiderIDResult]).then(id => insiderIDResult(id));
251
- } else if (!Utils.checkParameters([{ type: 'object', value: identifiers }])) {
252
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers]);
253
- } else {
254
- Utils.showParameterWarningLog(this.constructor.name + '-login');
255
- }
256
- } catch (error) {
257
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
258
- }
287
+ }, {
288
+ key: "login",
289
+ value: function login(identifiers, insiderIDResult) {
290
+ try {
291
+ if (!Utils.checkParameters([{
292
+ type: 'function',
293
+ value: insiderIDResult
294
+ }, {
295
+ type: 'object',
296
+ value: identifiers
297
+ }])) {
298
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers, insiderIDResult]).then(function (id) {
299
+ return insiderIDResult(id);
300
+ });
301
+ } else if (!Utils.checkParameters([{
302
+ type: 'object',
303
+ value: identifiers
304
+ }])) {
305
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers]);
306
+ } else {
307
+ Utils.showParameterWarningLog(this.constructor.name + '-login');
308
+ }
309
+ } catch (error) {
310
+ Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
311
+ }
259
312
  }
260
-
261
- logout() {
262
- try {
263
- return Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGOUT, []);
264
- } catch (error) {
265
- Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
266
- }
313
+ }, {
314
+ key: "logout",
315
+ value: function logout() {
316
+ try {
317
+ return Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGOUT, []);
318
+ } catch (error) {
319
+ Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
320
+ }
267
321
  }
268
-
269
- setCustomAttributeWithString(key, value) {
270
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'string', value: value }])) {
271
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithString');
272
- return this;
273
- }
274
-
275
- try {
276
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_STRING, [key, value]);
277
- } catch (error) {
278
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
279
- }
280
-
322
+ }, {
323
+ key: "setCustomAttributeWithString",
324
+ value: function setCustomAttributeWithString(key, value) {
325
+ if (Utils.checkParameters([{
326
+ type: 'string',
327
+ value: key
328
+ }, {
329
+ type: 'string',
330
+ value: value
331
+ }])) {
332
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithString');
281
333
  return this;
334
+ }
335
+ try {
336
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_STRING, [key, value]);
337
+ } catch (error) {
338
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
339
+ }
340
+ return this;
282
341
  }
283
-
284
- setCustomAttributeWithInt(key, value) {
285
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
286
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithInt');
287
- return this;
288
- }
289
-
290
- try {
291
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_INT, [key, value]);
292
- } catch (error) {
293
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
294
- }
295
-
342
+ }, {
343
+ key: "setCustomAttributeWithInt",
344
+ value: function setCustomAttributeWithInt(key, value) {
345
+ if (Utils.checkParameters([{
346
+ type: 'string',
347
+ value: key
348
+ }, {
349
+ type: 'number',
350
+ value: value
351
+ }])) {
352
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithInt');
296
353
  return this;
354
+ }
355
+ try {
356
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_INT, [key, value]);
357
+ } catch (error) {
358
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
359
+ }
360
+ return this;
297
361
  }
298
-
299
- setCustomAttributeWithDouble(key, value) {
300
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
301
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDouble');
302
- return this;
303
- }
304
-
305
- try {
306
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE, [key, value]);
307
- } catch (error) {
308
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
309
- }
310
-
362
+ }, {
363
+ key: "setCustomAttributeWithDouble",
364
+ value: function setCustomAttributeWithDouble(key, value) {
365
+ if (Utils.checkParameters([{
366
+ type: 'string',
367
+ value: key
368
+ }, {
369
+ type: 'number',
370
+ value: value
371
+ }])) {
372
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDouble');
311
373
  return this;
374
+ }
375
+ try {
376
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE, [key, value]);
377
+ } catch (error) {
378
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
379
+ }
380
+ return this;
312
381
  }
313
-
314
- setCustomAttributeWithBoolean(key, value) {
315
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'boolean', value: value }])) {
316
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithBoolean');
317
- return this;
318
- }
319
-
320
- try {
321
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN, [key, value]);
322
- } catch (error) {
323
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
324
- }
325
-
382
+ }, {
383
+ key: "setCustomAttributeWithBoolean",
384
+ value: function setCustomAttributeWithBoolean(key, value) {
385
+ if (Utils.checkParameters([{
386
+ type: 'string',
387
+ value: key
388
+ }, {
389
+ type: 'boolean',
390
+ value: value
391
+ }])) {
392
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithBoolean');
326
393
  return this;
394
+ }
395
+ try {
396
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN, [key, value]);
397
+ } catch (error) {
398
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
399
+ }
400
+ return this;
327
401
  }
328
-
329
- setCustomAttributeWithDate(key, value) {
330
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
331
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDate');
332
- return this;
333
- }
334
-
335
- try {
336
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DATE, [key, value.toISOString()]);
337
- } catch (error) {
338
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
339
- }
340
-
402
+ }, {
403
+ key: "setCustomAttributeWithDate",
404
+ value: function setCustomAttributeWithDate(key, value) {
405
+ if (Utils.checkParameters([{
406
+ type: 'string',
407
+ value: key
408
+ }, {
409
+ type: 'object',
410
+ value: value
411
+ }])) {
412
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDate');
341
413
  return this;
414
+ }
415
+ try {
416
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DATE, [key, value.toISOString()]);
417
+ } catch (error) {
418
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
419
+ }
420
+ return this;
342
421
  }
343
-
344
- setCustomAttributeWithArray(key, value) {
345
- if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
346
- Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithArray');
347
- return this;
348
- }
349
-
350
- try {
351
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_ARRAY, [key, value]);
352
- } catch (error) {
353
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
354
- }
355
-
422
+ }, {
423
+ key: "setCustomAttributeWithArray",
424
+ value: function setCustomAttributeWithArray(key, value) {
425
+ if (Utils.checkParameters([{
426
+ type: 'string',
427
+ value: key
428
+ }, {
429
+ type: 'object',
430
+ value: value
431
+ }])) {
432
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithArray');
356
433
  return this;
434
+ }
435
+ try {
436
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_ARRAY, [key, value]);
437
+ } catch (error) {
438
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
439
+ }
440
+ return this;
357
441
  }
358
-
359
- unsetCustomAttribute(key) {
360
- if (Utils.checkParameters([{ type: 'string', value: key }])) {
361
- Utils.showParameterWarningLog(this.constructor.name + '-unsetCustomAttribute');
362
- return this;
363
- }
364
-
365
- try {
366
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.UNSET_CUSTOM_ATTRIBUTE, [key]);
367
- } catch (error) {
368
- Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
369
- }
370
-
442
+ }, {
443
+ key: "unsetCustomAttribute",
444
+ value: function unsetCustomAttribute(key) {
445
+ if (Utils.checkParameters([{
446
+ type: 'string',
447
+ value: key
448
+ }])) {
449
+ Utils.showParameterWarningLog(this.constructor.name + '-unsetCustomAttribute');
371
450
  return this;
451
+ }
452
+ try {
453
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.UNSET_CUSTOM_ATTRIBUTE, [key]);
454
+ } catch (error) {
455
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
456
+ }
457
+ return this;
372
458
  }
373
- }
374
-
459
+ }]);
460
+ }();
375
461
  module.exports = User;