@como/como-client 0.7.86 → 0.7.88

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/lib/como.js CHANGED
@@ -268,12 +268,12 @@ var Como = function () {
268
268
  break;
269
269
 
270
270
  case 49:
271
- _context2.next = 73;
271
+ _context2.next = 74;
272
272
  break;
273
273
 
274
274
  case 51:
275
275
  if (isExpired) {
276
- _context2.next = 73;
276
+ _context2.next = 74;
277
277
  break;
278
278
  }
279
279
 
@@ -281,7 +281,7 @@ var Como = function () {
281
281
 
282
282
  case 53:
283
283
  if (!(!signOnSuccessfully && interval < 3000)) {
284
- _context2.next = 73;
284
+ _context2.next = 74;
285
285
  break;
286
286
  }
287
287
 
@@ -299,38 +299,41 @@ var Como = function () {
299
299
  console.log('signOn- updating credentials');
300
300
  updateCredentials(_data2, true);
301
301
  }
302
+ if (_data2 && _data2.config && _data2.config.recaptchaSiteKey) {
303
+ this.comoData.reCaptchaSiteKey = _data2.config.recaptchaSiteKey;
304
+ }
302
305
  signOnSuccessfully = true;
303
- _context2.next = 71;
306
+ _context2.next = 72;
304
307
  break;
305
308
 
306
- case 64:
307
- _context2.prev = 64;
309
+ case 65:
310
+ _context2.prev = 65;
308
311
  _context2.t2 = _context2['catch'](54);
309
312
 
310
313
  console.error('Failed signOn with accessToken, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',accessToken:' + accessToken + ', error:' + _context2.t2.message);
311
314
  interval += 1000;
312
315
  initService.logError({ method: 'signOn with credentials', accessToken: accessToken, isExpired: isExpired, refreshFailed: refreshFailed, credExist: credExist, installationId: installationId, locationId: locationId, source: source, refreshToken: refreshToken, interval: interval, error: _context2.t2.message });
313
- _context2.next = 71;
316
+ _context2.next = 72;
314
317
  return new _promise2.default(function (r) {
315
318
  return setTimeout(r, interval);
316
319
  });
317
320
 
318
- case 71:
321
+ case 72:
319
322
  _context2.next = 53;
320
323
  break;
321
324
 
322
- case 73:
325
+ case 74:
323
326
  if (!this.comoData.token) {
324
327
  this.comoData.token = this.comoData.accessToken;
325
328
  }
326
329
  return _context2.abrupt('return', this.getCredentials());
327
330
 
328
- case 75:
331
+ case 76:
329
332
  case 'end':
330
333
  return _context2.stop();
331
334
  }
332
335
  }
333
- }, _callee2, this, [[17, 24], [32, 40], [54, 64]]);
336
+ }, _callee2, this, [[17, 24], [32, 40], [54, 65]]);
334
337
  }));
335
338
 
336
339
  function init(_x, _x2, _x3) {
@@ -573,13 +576,14 @@ var Como = function () {
573
576
  *
574
577
  * @param {Object} form update form values
575
578
  * @param {string} reCaptchaToken
579
+ * @param {string} verification
576
580
  * @param {string} source request source
577
581
  */
578
582
 
579
583
  }, {
580
584
  key: 'updateProfile',
581
585
  value: function () {
582
- var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(form, reCaptchaToken, source) {
586
+ var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(form, reCaptchaToken, verification, source) {
583
587
  var api, data, _error$response$data3, code, message;
584
588
 
585
589
  return _regenerator2.default.wrap(function _callee7$(_context7) {
@@ -589,7 +593,7 @@ var Como = function () {
589
593
  api = this.comoData.api;
590
594
  _context7.prev = 1;
591
595
  _context7.next = 4;
592
- return api.updateProfile(form, reCaptchaToken, source);
596
+ return api.updateProfile(form, reCaptchaToken, verification, source);
593
597
 
594
598
  case 4:
595
599
  data = _context7.sent;
@@ -618,7 +622,7 @@ var Como = function () {
618
622
  }, _callee7, this, [[1, 8]]);
619
623
  }));
620
624
 
621
- function updateProfile(_x19, _x20, _x21) {
625
+ function updateProfile(_x19, _x20, _x21, _x22) {
622
626
  return _ref7.apply(this, arguments);
623
627
  }
624
628
 
@@ -676,7 +680,7 @@ var Como = function () {
676
680
  }, _callee8, this, [[1, 8]]);
677
681
  }));
678
682
 
679
- function updateProfileVerify(_x22, _x23, _x24, _x25, _x26) {
683
+ function updateProfileVerify(_x23, _x24, _x25, _x26, _x27) {
680
684
  return _ref8.apply(this, arguments);
681
685
  }
682
686
 
@@ -732,7 +736,7 @@ var Como = function () {
732
736
  }, _callee9, this, [[1, 9]]);
733
737
  }));
734
738
 
735
- function unsubscribeSms(_x27) {
739
+ function unsubscribeSms(_x28) {
736
740
  return _ref9.apply(this, arguments);
737
741
  }
738
742
 
@@ -788,7 +792,7 @@ var Como = function () {
788
792
  }, _callee10, this, [[1, 8]]);
789
793
  }));
790
794
 
791
- function login(_x28, _x29, _x30) {
795
+ function login(_x29, _x30, _x31) {
792
796
  return _ref10.apply(this, arguments);
793
797
  }
794
798
 
@@ -861,7 +865,7 @@ var Como = function () {
861
865
  }, _callee11, this, [[1, 9]]);
862
866
  }));
863
867
 
864
- function loginVerify(_x31, _x32, _x33, _x34) {
868
+ function loginVerify(_x32, _x33, _x34, _x35) {
865
869
  return _ref11.apply(this, arguments);
866
870
  }
867
871
 
@@ -936,7 +940,7 @@ var Como = function () {
936
940
  }, _callee13, this);
937
941
  }));
938
942
 
939
- function openApp(_x36) {
943
+ function openApp(_x37) {
940
944
  return _ref14.apply(this, arguments);
941
945
  }
942
946
 
@@ -977,7 +981,7 @@ var Como = function () {
977
981
  }, _callee14, this, [[1, 5]]);
978
982
  }));
979
983
 
980
- function clientUpdateMembership(_x37, _x38) {
984
+ function clientUpdateMembership(_x38, _x39) {
981
985
  return _ref15.apply(this, arguments);
982
986
  }
983
987
 
@@ -1038,7 +1042,7 @@ var Como = function () {
1038
1042
  }, _callee15, this, [[0, 12]]);
1039
1043
  }));
1040
1044
 
1041
- function downloadMainResource(_x39) {
1045
+ function downloadMainResource(_x40) {
1042
1046
  return _ref16.apply(this, arguments);
1043
1047
  }
1044
1048
 
@@ -1256,7 +1260,7 @@ var Como = function () {
1256
1260
  }, _callee20, this);
1257
1261
  }));
1258
1262
 
1259
- function redeemAsset(_x40) {
1263
+ function redeemAsset(_x41) {
1260
1264
  return _ref21.apply(this, arguments);
1261
1265
  }
1262
1266
 
@@ -1294,7 +1298,7 @@ var Como = function () {
1294
1298
  }, _callee21, this);
1295
1299
  }));
1296
1300
 
1297
- function purchaseAsset(_x41) {
1301
+ function purchaseAsset(_x42) {
1298
1302
  return _ref22.apply(this, arguments);
1299
1303
  }
1300
1304
 
@@ -1358,7 +1362,7 @@ var Como = function () {
1358
1362
  }, _callee23, this);
1359
1363
  }));
1360
1364
 
1361
- function purchaseAssetAPI2(_x42) {
1365
+ function purchaseAssetAPI2(_x43) {
1362
1366
  return _ref24.apply(this, arguments);
1363
1367
  }
1364
1368
 
@@ -1682,7 +1686,7 @@ var Como = function () {
1682
1686
  }, _callee26, this);
1683
1687
  }));
1684
1688
 
1685
- function getRegistrationUrl(_x43) {
1689
+ function getRegistrationUrl(_x44) {
1686
1690
  return _ref27.apply(this, arguments);
1687
1691
  }
1688
1692
 
@@ -1721,7 +1725,7 @@ var Como = function () {
1721
1725
  }, _callee27, this);
1722
1726
  }));
1723
1727
 
1724
- function getProfileUrl(_x44) {
1728
+ function getProfileUrl(_x45) {
1725
1729
  return _ref28.apply(this, arguments);
1726
1730
  }
1727
1731
 
@@ -1794,7 +1798,7 @@ var Como = function () {
1794
1798
  }, _callee29, this);
1795
1799
  }));
1796
1800
 
1797
- function getDataPortabilityUrl(_x45, _x46) {
1801
+ function getDataPortabilityUrl(_x46, _x47) {
1798
1802
  return _ref30.apply(this, arguments);
1799
1803
  }
1800
1804
 
@@ -1982,7 +1986,7 @@ var Como = function () {
1982
1986
  }, _callee32, this);
1983
1987
  }));
1984
1988
 
1985
- function addPaymentMethod(_x48) {
1989
+ function addPaymentMethod(_x49) {
1986
1990
  return _ref33.apply(this, arguments);
1987
1991
  }
1988
1992
 
@@ -2009,7 +2013,7 @@ var Como = function () {
2009
2013
  }, _callee33, this);
2010
2014
  }));
2011
2015
 
2012
- function knowYourData(_x49) {
2016
+ function knowYourData(_x50) {
2013
2017
  return _ref34.apply(this, arguments);
2014
2018
  }
2015
2019
 
@@ -2036,7 +2040,7 @@ var Como = function () {
2036
2040
  }, _callee34, this);
2037
2041
  }));
2038
2042
 
2039
- function consentWithdraw(_x50) {
2043
+ function consentWithdraw(_x51) {
2040
2044
  return _ref35.apply(this, arguments);
2041
2045
  }
2042
2046
 
@@ -2109,7 +2113,7 @@ var Como = function () {
2109
2113
  }, _callee36, this);
2110
2114
  }));
2111
2115
 
2112
- function payInApp(_x51, _x52, _x53, _x54, _x55) {
2116
+ function payInApp(_x52, _x53, _x54, _x55, _x56) {
2113
2117
  return _ref37.apply(this, arguments);
2114
2118
  }
2115
2119
 
@@ -2146,7 +2150,7 @@ var Como = function () {
2146
2150
  }, _callee37, this);
2147
2151
  }));
2148
2152
 
2149
- function deletePayment(_x56) {
2153
+ function deletePayment(_x57) {
2150
2154
  return _ref38.apply(this, arguments);
2151
2155
  }
2152
2156
 
@@ -2181,7 +2185,7 @@ var Como = function () {
2181
2185
  }, _callee38, this);
2182
2186
  }));
2183
2187
 
2184
- function getMemberMessages(_x57, _x58, _x59) {
2188
+ function getMemberMessages(_x58, _x59, _x60) {
2185
2189
  return _ref39.apply(this, arguments);
2186
2190
  }
2187
2191
 
@@ -2231,7 +2235,7 @@ var Como = function () {
2231
2235
  }, _callee39, this);
2232
2236
  }));
2233
2237
 
2234
- function budgetTransfer(_x60, _x61, _x62, _x63) {
2238
+ function budgetTransfer(_x61, _x62, _x63, _x64) {
2235
2239
  return _ref40.apply(this, arguments);
2236
2240
  }
2237
2241
 
@@ -2277,7 +2281,7 @@ var Como = function () {
2277
2281
  }, _callee40, this);
2278
2282
  }));
2279
2283
 
2280
- function budgetTransferClaim(_x64) {
2284
+ function budgetTransferClaim(_x65) {
2281
2285
  return _ref41.apply(this, arguments);
2282
2286
  }
2283
2287
 
@@ -2330,7 +2334,7 @@ var Como = function () {
2330
2334
  }, _callee41, this);
2331
2335
  }));
2332
2336
 
2333
- function logUserAction(_x65, _x66) {
2337
+ function logUserAction(_x66, _x67) {
2334
2338
  return _ref42.apply(this, arguments);
2335
2339
  }
2336
2340
 
@@ -2364,7 +2368,7 @@ var Como = function () {
2364
2368
  }, _callee42, this);
2365
2369
  }));
2366
2370
 
2367
- function getPurchaseHistory(_x67, _x68) {
2371
+ function getPurchaseHistory(_x68, _x69) {
2368
2372
  return _ref43.apply(this, arguments);
2369
2373
  }
2370
2374
 
@@ -132,8 +132,8 @@ exports.registerVerify = function (service) {
132
132
 
133
133
  exports.updateProfile = function (service) {
134
134
  return function () {
135
- var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(form, reCaptchaToken) {
136
- var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'App';
135
+ var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(form, reCaptchaToken, verification) {
136
+ var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'App';
137
137
 
138
138
  var body, headers, _ref8, data;
139
139
 
@@ -141,7 +141,7 @@ exports.updateProfile = function (service) {
141
141
  while (1) {
142
142
  switch (_context4.prev = _context4.next) {
143
143
  case 0:
144
- body = { form: form, source: source, reCaptchaToken: reCaptchaToken };
144
+ body = { form: form, source: source, reCaptchaToken: reCaptchaToken, verification: verification };
145
145
  headers = getHashHeader(body);
146
146
  _context4.next = 4;
147
147
  return service.post('/auth/v1/update-profile', body, { headers: headers });
@@ -159,7 +159,7 @@ exports.updateProfile = function (service) {
159
159
  }, _callee4, undefined);
160
160
  }));
161
161
 
162
- return function (_x13, _x14) {
162
+ return function (_x13, _x14, _x15) {
163
163
  return _ref7.apply(this, arguments);
164
164
  };
165
165
  }();
@@ -194,7 +194,7 @@ exports.updateProfileVerify = function (service) {
194
194
  }, _callee5, undefined);
195
195
  }));
196
196
 
197
- return function (_x16, _x17, _x18, _x19) {
197
+ return function (_x17, _x18, _x19, _x20) {
198
198
  return _ref9.apply(this, arguments);
199
199
  };
200
200
  }();
@@ -226,7 +226,7 @@ exports.unsubscribeSms = function (service) {
226
226
  }, _callee6, undefined);
227
227
  }));
228
228
 
229
- return function (_x21, _x22) {
229
+ return function (_x22, _x23) {
230
230
  return _ref11.apply(this, arguments);
231
231
  };
232
232
  }();
@@ -259,7 +259,7 @@ exports.logIn = function (service) {
259
259
  }, _callee7, undefined);
260
260
  }));
261
261
 
262
- return function (_x23, _x24, _x25) {
262
+ return function (_x24, _x25, _x26) {
263
263
  return _ref13.apply(this, arguments);
264
264
  };
265
265
  }();
@@ -297,7 +297,7 @@ exports.logInVerify = function (service) {
297
297
  }, _callee8, undefined);
298
298
  }));
299
299
 
300
- return function (_x26, _x27, _x28, _x29) {
300
+ return function (_x27, _x28, _x29, _x30) {
301
301
  return _ref15.apply(this, arguments);
302
302
  };
303
303
  }();
@@ -355,7 +355,7 @@ exports.refreshToken = function (service) {
355
355
  }, _callee10, undefined);
356
356
  }));
357
357
 
358
- return function (_x30, _x31, _x32, _x33) {
358
+ return function (_x31, _x32, _x33, _x34) {
359
359
  return _ref19.apply(this, arguments);
360
360
  };
361
361
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@como/como-client",
3
- "version": "0.7.86",
3
+ "version": "0.7.88",
4
4
  "description": "Client module for Como's loaylty API",
5
5
  "main": "src/como.js",
6
6
  "scripts": {
package/src/como.js CHANGED
@@ -143,6 +143,9 @@ class Como {
143
143
  console.log(`signOn- updating credentials`);
144
144
  updateCredentials(data, true);
145
145
  }
146
+ if(data && data.config && data.config.recaptchaSiteKey){
147
+ this.comoData.reCaptchaSiteKey = data.config.recaptchaSiteKey;
148
+ }
146
149
  signOnSuccessfully = true;
147
150
  }catch(e){
148
151
  console.error(`Failed signOn with accessToken, installationId:${installationId}, locationId:${locationId}, source:${source},accessToken:${accessToken}, error:${e.message}`);
@@ -261,12 +264,13 @@ class Como {
261
264
  *
262
265
  * @param {Object} form update form values
263
266
  * @param {string} reCaptchaToken
267
+ * @param {string} verification
264
268
  * @param {string} source request source
265
269
  */
266
- async updateProfile(form, reCaptchaToken, source) {
270
+ async updateProfile(form, reCaptchaToken, verification, source) {
267
271
  const { api } = this.comoData;
268
272
  try {
269
- const data = await api.updateProfile(form, reCaptchaToken, source);
273
+ const data = await api.updateProfile(form, reCaptchaToken, verification, source);
270
274
  return data;
271
275
  } catch (error) {
272
276
  if (error.response && error.response.data) {