@como/como-client 0.8.8 → 0.8.9

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
@@ -870,12 +870,13 @@ var Como = function () {
870
870
  * @param {reCaptchaToken} reCaptcha token for login chalenge
871
871
  * @param {recaptchaTokenType} recaptcha token type - score/human
872
872
  * @param {devicePlatform} device platform i.e. ios/android
873
+ * @param {boolean} isWhatsapp optional flag for whatsapp login flow
873
874
  */
874
875
 
875
876
  }, {
876
877
  key: 'login',
877
878
  value: function () {
878
- var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform) {
879
+ var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp) {
879
880
  var api, data, _error$response$data8, code, message;
880
881
 
881
882
  return _regenerator2.default.wrap(function _callee12$(_context12) {
@@ -885,7 +886,7 @@ var Como = function () {
885
886
  api = this.comoData.api;
886
887
  _context12.prev = 1;
887
888
  _context12.next = 4;
888
- return api.logIn(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform);
889
+ return api.logIn(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp);
889
890
 
890
891
  case 4:
891
892
  data = _context12.sent;
@@ -914,7 +915,7 @@ var Como = function () {
914
915
  }, _callee12, this, [[1, 8]]);
915
916
  }));
916
917
 
917
- function login(_x32, _x33, _x34, _x35, _x36) {
918
+ function login(_x32, _x33, _x34, _x35, _x36, _x37) {
918
919
  return _ref12.apply(this, arguments);
919
920
  }
920
921
 
@@ -989,7 +990,7 @@ var Como = function () {
989
990
  }, _callee13, this, [[1, 9]]);
990
991
  }));
991
992
 
992
- function loginVerify(_x37, _x38, _x39, _x40, _x41, _x42) {
993
+ function loginVerify(_x38, _x39, _x40, _x41, _x42, _x43) {
993
994
  return _ref13.apply(this, arguments);
994
995
  }
995
996
 
@@ -1064,7 +1065,7 @@ var Como = function () {
1064
1065
  }, _callee15, this);
1065
1066
  }));
1066
1067
 
1067
- function openApp(_x44) {
1068
+ function openApp(_x45) {
1068
1069
  return _ref16.apply(this, arguments);
1069
1070
  }
1070
1071
 
@@ -1105,7 +1106,7 @@ var Como = function () {
1105
1106
  }, _callee16, this, [[1, 5]]);
1106
1107
  }));
1107
1108
 
1108
- function clientUpdateMembership(_x45, _x46) {
1109
+ function clientUpdateMembership(_x46, _x47) {
1109
1110
  return _ref17.apply(this, arguments);
1110
1111
  }
1111
1112
 
@@ -1166,7 +1167,7 @@ var Como = function () {
1166
1167
  }, _callee17, this, [[0, 12]]);
1167
1168
  }));
1168
1169
 
1169
- function downloadMainResource(_x47) {
1170
+ function downloadMainResource(_x48) {
1170
1171
  return _ref18.apply(this, arguments);
1171
1172
  }
1172
1173
 
@@ -1384,7 +1385,7 @@ var Como = function () {
1384
1385
  }, _callee22, this);
1385
1386
  }));
1386
1387
 
1387
- function redeemAsset(_x48) {
1388
+ function redeemAsset(_x49) {
1388
1389
  return _ref23.apply(this, arguments);
1389
1390
  }
1390
1391
 
@@ -1422,7 +1423,7 @@ var Como = function () {
1422
1423
  }, _callee23, this);
1423
1424
  }));
1424
1425
 
1425
- function purchaseAsset(_x49) {
1426
+ function purchaseAsset(_x50) {
1426
1427
  return _ref24.apply(this, arguments);
1427
1428
  }
1428
1429
 
@@ -1486,7 +1487,7 @@ var Como = function () {
1486
1487
  }, _callee25, this);
1487
1488
  }));
1488
1489
 
1489
- function purchaseAssetAPI2(_x50) {
1490
+ function purchaseAssetAPI2(_x51) {
1490
1491
  return _ref26.apply(this, arguments);
1491
1492
  }
1492
1493
 
@@ -1831,7 +1832,7 @@ var Como = function () {
1831
1832
  }, _callee29, this);
1832
1833
  }));
1833
1834
 
1834
- function getRegistrationUrl(_x51) {
1835
+ function getRegistrationUrl(_x52) {
1835
1836
  return _ref30.apply(this, arguments);
1836
1837
  }
1837
1838
 
@@ -1870,7 +1871,7 @@ var Como = function () {
1870
1871
  }, _callee30, this);
1871
1872
  }));
1872
1873
 
1873
- function getProfileUrl(_x52) {
1874
+ function getProfileUrl(_x53) {
1874
1875
  return _ref31.apply(this, arguments);
1875
1876
  }
1876
1877
 
@@ -1943,7 +1944,7 @@ var Como = function () {
1943
1944
  }, _callee32, this);
1944
1945
  }));
1945
1946
 
1946
- function getDataPortabilityUrl(_x53, _x54) {
1947
+ function getDataPortabilityUrl(_x54, _x55) {
1947
1948
  return _ref33.apply(this, arguments);
1948
1949
  }
1949
1950
 
@@ -2136,7 +2137,7 @@ var Como = function () {
2136
2137
  }, _callee35, this);
2137
2138
  }));
2138
2139
 
2139
- function addPaymentMethod(_x56) {
2140
+ function addPaymentMethod(_x57) {
2140
2141
  return _ref36.apply(this, arguments);
2141
2142
  }
2142
2143
 
@@ -2163,7 +2164,7 @@ var Como = function () {
2163
2164
  }, _callee36, this);
2164
2165
  }));
2165
2166
 
2166
- function knowYourData(_x57) {
2167
+ function knowYourData(_x58) {
2167
2168
  return _ref37.apply(this, arguments);
2168
2169
  }
2169
2170
 
@@ -2190,7 +2191,7 @@ var Como = function () {
2190
2191
  }, _callee37, this);
2191
2192
  }));
2192
2193
 
2193
- function consentWithdraw(_x58) {
2194
+ function consentWithdraw(_x59) {
2194
2195
  return _ref38.apply(this, arguments);
2195
2196
  }
2196
2197
 
@@ -2263,7 +2264,7 @@ var Como = function () {
2263
2264
  }, _callee39, this);
2264
2265
  }));
2265
2266
 
2266
- function payInApp(_x59, _x60, _x61, _x62, _x63) {
2267
+ function payInApp(_x60, _x61, _x62, _x63, _x64) {
2267
2268
  return _ref40.apply(this, arguments);
2268
2269
  }
2269
2270
 
@@ -2300,7 +2301,7 @@ var Como = function () {
2300
2301
  }, _callee40, this);
2301
2302
  }));
2302
2303
 
2303
- function deletePayment(_x64) {
2304
+ function deletePayment(_x65) {
2304
2305
  return _ref41.apply(this, arguments);
2305
2306
  }
2306
2307
 
@@ -2337,7 +2338,7 @@ var Como = function () {
2337
2338
  }, _callee41, this);
2338
2339
  }));
2339
2340
 
2340
- function getMemberMessages(_x65, _x66, _x67) {
2341
+ function getMemberMessages(_x66, _x67, _x68) {
2341
2342
  return _ref42.apply(this, arguments);
2342
2343
  }
2343
2344
 
@@ -2387,7 +2388,7 @@ var Como = function () {
2387
2388
  }, _callee42, this);
2388
2389
  }));
2389
2390
 
2390
- function budgetTransfer(_x69, _x70, _x71, _x72) {
2391
+ function budgetTransfer(_x70, _x71, _x72, _x73) {
2391
2392
  return _ref43.apply(this, arguments);
2392
2393
  }
2393
2394
 
@@ -2433,7 +2434,7 @@ var Como = function () {
2433
2434
  }, _callee43, this);
2434
2435
  }));
2435
2436
 
2436
- function budgetTransferClaim(_x73) {
2437
+ function budgetTransferClaim(_x74) {
2437
2438
  return _ref44.apply(this, arguments);
2438
2439
  }
2439
2440
 
@@ -2485,7 +2486,7 @@ var Como = function () {
2485
2486
  }, _callee44, this);
2486
2487
  }));
2487
2488
 
2488
- function logUserAction(_x74, _x75) {
2489
+ function logUserAction(_x75, _x76) {
2489
2490
  return _ref45.apply(this, arguments);
2490
2491
  }
2491
2492
 
@@ -2519,7 +2520,7 @@ var Como = function () {
2519
2520
  }, _callee45, this);
2520
2521
  }));
2521
2522
 
2522
- function getPurchaseHistory(_x76, _x77) {
2523
+ function getPurchaseHistory(_x77, _x78) {
2523
2524
  return _ref46.apply(this, arguments);
2524
2525
  }
2525
2526
 
@@ -299,7 +299,7 @@ exports.unsubscribeWhatsapp = function (service) {
299
299
 
300
300
  exports.logIn = function (service) {
301
301
  return function () {
302
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform) {
302
+ var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp) {
303
303
  var params, headers, _ref18, data;
304
304
 
305
305
  return _regenerator2.default.wrap(function _callee9$(_context9) {
@@ -309,16 +309,20 @@ exports.logIn = function (service) {
309
309
  params = {
310
310
  type: type, identifier: identifier, reCaptchaToken: reCaptchaToken, recaptchaTokenType: recaptchaTokenType, devicePlatform: devicePlatform
311
311
  };
312
+
313
+ if (typeof isWhatsapp === 'boolean') {
314
+ params.isWhatsapp = isWhatsapp;
315
+ }
312
316
  headers = getHashHeader(params);
313
- _context9.next = 4;
317
+ _context9.next = 5;
314
318
  return service.post('/auth/v4/auth/logIn', params, { headers: headers });
315
319
 
316
- case 4:
320
+ case 5:
317
321
  _ref18 = _context9.sent;
318
322
  data = _ref18.data;
319
323
  return _context9.abrupt("return", data);
320
324
 
321
- case 7:
325
+ case 8:
322
326
  case "end":
323
327
  return _context9.stop();
324
328
  }
@@ -326,7 +330,7 @@ exports.logIn = function (service) {
326
330
  }, _callee9, undefined);
327
331
  }));
328
332
 
329
- return function (_x27, _x28, _x29, _x30, _x31) {
333
+ return function (_x27, _x28, _x29, _x30, _x31, _x32) {
330
334
  return _ref17.apply(this, arguments);
331
335
  };
332
336
  }();
@@ -366,7 +370,7 @@ exports.logInVerify = function (service) {
366
370
  }, _callee10, undefined);
367
371
  }));
368
372
 
369
- return function (_x32, _x33, _x34, _x35, _x36, _x37) {
373
+ return function (_x33, _x34, _x35, _x36, _x37, _x38) {
370
374
  return _ref19.apply(this, arguments);
371
375
  };
372
376
  }();
@@ -424,7 +428,7 @@ exports.refreshToken = function (service) {
424
428
  }, _callee12, undefined);
425
429
  }));
426
430
 
427
- return function (_x38, _x39, _x40, _x41) {
431
+ return function (_x39, _x40, _x41, _x42) {
428
432
  return _ref23.apply(this, arguments);
429
433
  };
430
434
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@como/como-client",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "Client module for Como's loaylty API",
5
5
  "main": "src/como.js",
6
6
  "scripts": {
package/src/como.js CHANGED
@@ -376,11 +376,12 @@ class Como {
376
376
  * @param {reCaptchaToken} reCaptcha token for login chalenge
377
377
  * @param {recaptchaTokenType} recaptcha token type - score/human
378
378
  * @param {devicePlatform} device platform i.e. ios/android
379
+ * @param {boolean} isWhatsapp optional flag for whatsapp login flow
379
380
  */
380
- async login(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform) {
381
+ async login(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp) {
381
382
  const { api } = this.comoData;
382
383
  try {
383
- const data = await api.logIn(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform);
384
+ const data = await api.logIn(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp);
384
385
  return data;
385
386
  } catch (error) {
386
387
  if (error.response && error.response.data) {