@como/como-client 0.1.8 → 0.1.9-1.1
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/README.md +14 -0
- package/index.js +3 -0
- package/lib/como.js +2119 -492
- package/lib/config/env.js +19 -5
- package/lib/constants/resourceNames.js +3 -0
- package/lib/interceptors/refresh.js +92 -36
- package/lib/interceptors/response.js +46 -0
- package/lib/services/auth.service.js +212 -46
- package/lib/services/form.service.js +96 -0
- package/lib/services/index.js +25 -12
- package/lib/services/log.service.js +332 -0
- package/lib/services/loyalty.service.js +769 -14
- package/lib/services/ssr.service.js +75 -0
- package/lib/utils/comoExternalUrlTranslator.js +242 -0
- package/lib/utils/urls.js +27 -0
- package/package.json +16 -7
- package/src/como.js +930 -0
- package/.babelrc +0 -15
- package/.eslintignore +0 -1
- package/.eslintrc +0 -46
- package/.vscode/launch.json +0 -14
- package/como.js +0 -413
- package/webpack.config.js +0 -13
- package/yarn.lock +0 -5026
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _stringify = require('babel-runtime/core-js/json/stringify');
|
|
4
|
+
|
|
5
|
+
var _stringify2 = _interopRequireDefault(_stringify);
|
|
6
|
+
|
|
3
7
|
var _regenerator = require('babel-runtime/regenerator');
|
|
4
8
|
|
|
5
9
|
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
@@ -10,6 +14,14 @@ var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
|
|
10
14
|
|
|
11
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
16
|
|
|
17
|
+
var moment = require('moment-timezone');
|
|
18
|
+
var axios = require('axios');
|
|
19
|
+
var urlsUtils = require('../utils/urls');
|
|
20
|
+
|
|
21
|
+
var buildResourceUrl = function buildResourceUrl(baseUrl, resourceId, namespace, version) {
|
|
22
|
+
return baseUrl + '/GetResource?namespace=' + namespace + '&resourceId=' + resourceId + '&version=' + version;
|
|
23
|
+
};
|
|
24
|
+
|
|
13
25
|
exports.legacySignOn = function (service) {
|
|
14
26
|
return function () {
|
|
15
27
|
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(baseUrl, deviceId) {
|
|
@@ -76,13 +88,15 @@ exports.getLocationState = function (service) {
|
|
|
76
88
|
exports.getUserAtLocation = function (service) {
|
|
77
89
|
return function () {
|
|
78
90
|
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(baseUrl, locationId) {
|
|
91
|
+
var onlyAssetKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
92
|
+
|
|
79
93
|
var url, _ref4, data;
|
|
80
94
|
|
|
81
95
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
82
96
|
while (1) {
|
|
83
97
|
switch (_context3.prev = _context3.next) {
|
|
84
98
|
case 0:
|
|
85
|
-
url = baseUrl + '/alpha/api/GetUserAtLocation?MimeType=application/json&InputType=json';
|
|
99
|
+
url = baseUrl + '/alpha/api/GetUserAtLocation?MimeType=application/json&InputType=json&OnlyAssetKeys=' + onlyAssetKeys;
|
|
86
100
|
_context3.next = 3;
|
|
87
101
|
return service.post(url, {
|
|
88
102
|
LocationID: locationId
|
|
@@ -128,7 +142,7 @@ exports.memberAssets = function (service) {
|
|
|
128
142
|
switch (_context4.prev = _context4.next) {
|
|
129
143
|
case 0:
|
|
130
144
|
archivedText = archived ? 'OnlyArchived' : 'OnlyUnarchived';
|
|
131
|
-
url = baseUrl + '/memberAssets?requestKind=' + archivedText + '&locationId=' + locationId;
|
|
145
|
+
url = baseUrl + '/memberAssets?requestKind=' + archivedText + '&locationId=' + locationId + '&limit=500';
|
|
132
146
|
_context4.next = 4;
|
|
133
147
|
return service.get(url);
|
|
134
148
|
|
|
@@ -145,7 +159,7 @@ exports.memberAssets = function (service) {
|
|
|
145
159
|
}, _callee4, undefined);
|
|
146
160
|
}));
|
|
147
161
|
|
|
148
|
-
return function (
|
|
162
|
+
return function (_x8, _x9) {
|
|
149
163
|
return _ref5.apply(this, arguments);
|
|
150
164
|
};
|
|
151
165
|
}();
|
|
@@ -180,7 +194,7 @@ exports.redeemAsset = function (service) {
|
|
|
180
194
|
}, _callee5, undefined);
|
|
181
195
|
}));
|
|
182
196
|
|
|
183
|
-
return function (
|
|
197
|
+
return function (_x11, _x12, _x13) {
|
|
184
198
|
return _ref7.apply(this, arguments);
|
|
185
199
|
};
|
|
186
200
|
}();
|
|
@@ -214,7 +228,7 @@ exports.getShortUserId = function (service) {
|
|
|
214
228
|
}, _callee6, undefined);
|
|
215
229
|
}));
|
|
216
230
|
|
|
217
|
-
return function (
|
|
231
|
+
return function (_x14, _x15) {
|
|
218
232
|
return _ref9.apply(this, arguments);
|
|
219
233
|
};
|
|
220
234
|
}();
|
|
@@ -248,7 +262,7 @@ exports.getPaymentCode = function (service) {
|
|
|
248
262
|
}, _callee7, undefined);
|
|
249
263
|
}));
|
|
250
264
|
|
|
251
|
-
return function (
|
|
265
|
+
return function (_x16, _x17) {
|
|
252
266
|
return _ref11.apply(this, arguments);
|
|
253
267
|
};
|
|
254
268
|
}();
|
|
@@ -256,14 +270,14 @@ exports.getPaymentCode = function (service) {
|
|
|
256
270
|
|
|
257
271
|
exports.purchaseAsset = function (service) {
|
|
258
272
|
return function () {
|
|
259
|
-
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(baseUrl, locationId, itemId) {
|
|
273
|
+
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(baseUrl, locationId, token, itemId) {
|
|
260
274
|
var url, _ref14, data;
|
|
261
275
|
|
|
262
276
|
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
|
263
277
|
while (1) {
|
|
264
278
|
switch (_context8.prev = _context8.next) {
|
|
265
279
|
case 0:
|
|
266
|
-
url = baseUrl + '/alpha/api/PurchaseAsset?InputType=json&MimeType=application/json';
|
|
280
|
+
url = baseUrl + '/alpha/api/PurchaseAsset?InputType=json&MimeType=application/json&Token=' + token;
|
|
267
281
|
_context8.next = 3;
|
|
268
282
|
return service.post(url, {
|
|
269
283
|
LocationID: locationId,
|
|
@@ -283,13 +297,19 @@ exports.purchaseAsset = function (service) {
|
|
|
283
297
|
}, _callee8, undefined);
|
|
284
298
|
}));
|
|
285
299
|
|
|
286
|
-
return function (
|
|
300
|
+
return function (_x18, _x19, _x20, _x21) {
|
|
287
301
|
return _ref13.apply(this, arguments);
|
|
288
302
|
};
|
|
289
303
|
}();
|
|
290
304
|
};
|
|
291
305
|
|
|
292
|
-
exports.
|
|
306
|
+
exports.getResourceUrl = function (service) {
|
|
307
|
+
return function (baseUrl, resourceId, namespace, version) {
|
|
308
|
+
return '' + buildResourceUrl(baseUrl, resourceId, namespace, version);
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
exports.getLoyaltyResource = function (service) {
|
|
293
313
|
return function () {
|
|
294
314
|
var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(baseUrl, resourceId, namespace, version) {
|
|
295
315
|
var url, _ref16, data;
|
|
@@ -298,9 +318,9 @@ exports.getResource = function (service) {
|
|
|
298
318
|
while (1) {
|
|
299
319
|
switch (_context9.prev = _context9.next) {
|
|
300
320
|
case 0:
|
|
301
|
-
url = baseUrl
|
|
321
|
+
url = buildResourceUrl(baseUrl, resourceId, namespace, version);
|
|
302
322
|
_context9.next = 3;
|
|
303
|
-
return
|
|
323
|
+
return axios.get(url);
|
|
304
324
|
|
|
305
325
|
case 3:
|
|
306
326
|
_ref16 = _context9.sent;
|
|
@@ -315,7 +335,7 @@ exports.getResource = function (service) {
|
|
|
315
335
|
}, _callee9, undefined);
|
|
316
336
|
}));
|
|
317
337
|
|
|
318
|
-
return function (
|
|
338
|
+
return function (_x22, _x23, _x24, _x25) {
|
|
319
339
|
return _ref15.apply(this, arguments);
|
|
320
340
|
};
|
|
321
341
|
}();
|
|
@@ -347,8 +367,743 @@ exports.generateReferralCode = function (service) {
|
|
|
347
367
|
}, _callee10, undefined);
|
|
348
368
|
}));
|
|
349
369
|
|
|
350
|
-
return function (
|
|
370
|
+
return function (_x26, _x27, _x28) {
|
|
351
371
|
return _ref17.apply(this, arguments);
|
|
352
372
|
};
|
|
353
373
|
}();
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
exports.verifyReferralCode = function (service) {
|
|
377
|
+
return function () {
|
|
378
|
+
var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(baseUrl, token, locationId, code) {
|
|
379
|
+
var url, _ref20, data;
|
|
380
|
+
|
|
381
|
+
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
|
382
|
+
while (1) {
|
|
383
|
+
switch (_context11.prev = _context11.next) {
|
|
384
|
+
case 0:
|
|
385
|
+
url = baseUrl + '/referralCode/validate?locationId=' + locationId + '&token=' + token + '&code=' + code;
|
|
386
|
+
_context11.next = 3;
|
|
387
|
+
return service.get(url);
|
|
388
|
+
|
|
389
|
+
case 3:
|
|
390
|
+
_ref20 = _context11.sent;
|
|
391
|
+
data = _ref20.data;
|
|
392
|
+
return _context11.abrupt('return', data);
|
|
393
|
+
|
|
394
|
+
case 6:
|
|
395
|
+
case 'end':
|
|
396
|
+
return _context11.stop();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}, _callee11, undefined);
|
|
400
|
+
}));
|
|
401
|
+
|
|
402
|
+
return function (_x29, _x30, _x31, _x32) {
|
|
403
|
+
return _ref19.apply(this, arguments);
|
|
404
|
+
};
|
|
405
|
+
}();
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
exports.openApp = function (service) {
|
|
409
|
+
return function () {
|
|
410
|
+
var _ref21 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(baseUrl, token, locationId, data) {
|
|
411
|
+
var dateNow, url, response;
|
|
412
|
+
return _regenerator2.default.wrap(function _callee12$(_context12) {
|
|
413
|
+
while (1) {
|
|
414
|
+
switch (_context12.prev = _context12.next) {
|
|
415
|
+
case 0:
|
|
416
|
+
dateNow = moment();
|
|
417
|
+
url = baseUrl + '/alpha/api/OpenApp?InputType=json&locationId=' + locationId + '&token=' + token + '&Action=openedclub&TimeStamp=' + dateNow;
|
|
418
|
+
_context12.next = 4;
|
|
419
|
+
return service.post(url, { LocationID: locationId, Data: data });
|
|
420
|
+
|
|
421
|
+
case 4:
|
|
422
|
+
response = _context12.sent;
|
|
423
|
+
return _context12.abrupt('return', response);
|
|
424
|
+
|
|
425
|
+
case 6:
|
|
426
|
+
case 'end':
|
|
427
|
+
return _context12.stop();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, _callee12, undefined);
|
|
431
|
+
}));
|
|
432
|
+
|
|
433
|
+
return function (_x33, _x34, _x35, _x36) {
|
|
434
|
+
return _ref21.apply(this, arguments);
|
|
435
|
+
};
|
|
436
|
+
}();
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
exports.clientUpdateMembership = function (service) {
|
|
440
|
+
return function () {
|
|
441
|
+
var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(baseUrl, token, locationId, pushEnable, locationEnable) {
|
|
442
|
+
var url, response;
|
|
443
|
+
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
|
444
|
+
while (1) {
|
|
445
|
+
switch (_context13.prev = _context13.next) {
|
|
446
|
+
case 0:
|
|
447
|
+
url = baseUrl + '/memberships/clientUpdateMembership?locationId=' + locationId + '&token=' + token;
|
|
448
|
+
_context13.next = 3;
|
|
449
|
+
return service.put(url, { PushNotificationEnabled: pushEnable, LocationEnabled: locationEnable });
|
|
450
|
+
|
|
451
|
+
case 3:
|
|
452
|
+
response = _context13.sent;
|
|
453
|
+
return _context13.abrupt('return', response);
|
|
454
|
+
|
|
455
|
+
case 5:
|
|
456
|
+
case 'end':
|
|
457
|
+
return _context13.stop();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}, _callee13, undefined);
|
|
461
|
+
}));
|
|
462
|
+
|
|
463
|
+
return function (_x37, _x38, _x39, _x40, _x41) {
|
|
464
|
+
return _ref22.apply(this, arguments);
|
|
465
|
+
};
|
|
466
|
+
}();
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
exports.generateTemporaryToken = function (service) {
|
|
470
|
+
return function () {
|
|
471
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(baseUrl, locationId, token, timeToLive) {
|
|
472
|
+
var url, _ref24, data;
|
|
473
|
+
|
|
474
|
+
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
|
475
|
+
while (1) {
|
|
476
|
+
switch (_context14.prev = _context14.next) {
|
|
477
|
+
case 0:
|
|
478
|
+
url = baseUrl + '/memberships/generateToken?locationId=' + locationId + '&token=' + token;
|
|
479
|
+
_context14.next = 3;
|
|
480
|
+
return service.post(url, {
|
|
481
|
+
timeToLive: timeToLive
|
|
482
|
+
}, {
|
|
483
|
+
headers: { 'Content-Type': 'application/json' }
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
case 3:
|
|
487
|
+
_ref24 = _context14.sent;
|
|
488
|
+
data = _ref24.data;
|
|
489
|
+
return _context14.abrupt('return', data);
|
|
490
|
+
|
|
491
|
+
case 6:
|
|
492
|
+
case 'end':
|
|
493
|
+
return _context14.stop();
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}, _callee14, undefined);
|
|
497
|
+
}));
|
|
498
|
+
|
|
499
|
+
return function (_x42, _x43, _x44, _x45) {
|
|
500
|
+
return _ref23.apply(this, arguments);
|
|
501
|
+
};
|
|
502
|
+
}();
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
exports.getFeedbackFormData = function (service) {
|
|
506
|
+
return function () {
|
|
507
|
+
var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(baseUrl, locationId, token) {
|
|
508
|
+
var url, _ref26, data;
|
|
509
|
+
|
|
510
|
+
return _regenerator2.default.wrap(function _callee15$(_context15) {
|
|
511
|
+
while (1) {
|
|
512
|
+
switch (_context15.prev = _context15.next) {
|
|
513
|
+
case 0:
|
|
514
|
+
url = baseUrl + '/alpha/api/SendFeedback?LocationID=' + locationId + '&Token=' + token + '&MimeType=application/json';
|
|
515
|
+
_context15.next = 3;
|
|
516
|
+
return service.get(url);
|
|
517
|
+
|
|
518
|
+
case 3:
|
|
519
|
+
_ref26 = _context15.sent;
|
|
520
|
+
data = _ref26.data;
|
|
521
|
+
return _context15.abrupt('return', data);
|
|
522
|
+
|
|
523
|
+
case 6:
|
|
524
|
+
case 'end':
|
|
525
|
+
return _context15.stop();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}, _callee15, undefined);
|
|
529
|
+
}));
|
|
530
|
+
|
|
531
|
+
return function (_x46, _x47, _x48) {
|
|
532
|
+
return _ref25.apply(this, arguments);
|
|
533
|
+
};
|
|
534
|
+
}();
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
exports.sendPushChannel = function (service) {
|
|
538
|
+
return function () {
|
|
539
|
+
var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(baseUrl, locationId, token, identifier) {
|
|
540
|
+
var firebaseProjectMigrated = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
541
|
+
var url, response;
|
|
542
|
+
return _regenerator2.default.wrap(function _callee16$(_context16) {
|
|
543
|
+
while (1) {
|
|
544
|
+
switch (_context16.prev = _context16.next) {
|
|
545
|
+
case 0:
|
|
546
|
+
url = baseUrl + '/push_channels?locationId=' + locationId + '&token=' + token;
|
|
547
|
+
_context16.next = 3;
|
|
548
|
+
return service.post(url, {
|
|
549
|
+
type: 'fcm',
|
|
550
|
+
identifier: identifier,
|
|
551
|
+
firebaseProjectMigrated: firebaseProjectMigrated
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
case 3:
|
|
555
|
+
response = _context16.sent;
|
|
556
|
+
return _context16.abrupt('return', response);
|
|
557
|
+
|
|
558
|
+
case 5:
|
|
559
|
+
case 'end':
|
|
560
|
+
return _context16.stop();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}, _callee16, undefined);
|
|
564
|
+
}));
|
|
565
|
+
|
|
566
|
+
return function (_x49, _x50, _x51, _x52) {
|
|
567
|
+
return _ref27.apply(this, arguments);
|
|
568
|
+
};
|
|
569
|
+
}();
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
exports.getClientBusinessBackend = function (service) {
|
|
573
|
+
return function () {
|
|
574
|
+
var _ref28 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(baseUrl, token, locationId) {
|
|
575
|
+
var url, _ref29, data;
|
|
576
|
+
|
|
577
|
+
return _regenerator2.default.wrap(function _callee17$(_context17) {
|
|
578
|
+
while (1) {
|
|
579
|
+
switch (_context17.prev = _context17.next) {
|
|
580
|
+
case 0:
|
|
581
|
+
url = baseUrl + '/alpha/api/ClientGetBusinessBackend?LocationID=' + locationId + '&Token=' + token + '&MimeType=application/json';
|
|
582
|
+
_context17.next = 3;
|
|
583
|
+
return service.post(url);
|
|
584
|
+
|
|
585
|
+
case 3:
|
|
586
|
+
_ref29 = _context17.sent;
|
|
587
|
+
data = _ref29.data;
|
|
588
|
+
return _context17.abrupt('return', data);
|
|
589
|
+
|
|
590
|
+
case 6:
|
|
591
|
+
case 'end':
|
|
592
|
+
return _context17.stop();
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}, _callee17, undefined);
|
|
596
|
+
}));
|
|
597
|
+
|
|
598
|
+
return function (_x54, _x55, _x56) {
|
|
599
|
+
return _ref28.apply(this, arguments);
|
|
600
|
+
};
|
|
601
|
+
}();
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
exports.sendCouponCode = function (service) {
|
|
605
|
+
return function () {
|
|
606
|
+
var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18(baseUrl, locationId, token, code) {
|
|
607
|
+
var url, response;
|
|
608
|
+
return _regenerator2.default.wrap(function _callee18$(_context18) {
|
|
609
|
+
while (1) {
|
|
610
|
+
switch (_context18.prev = _context18.next) {
|
|
611
|
+
case 0:
|
|
612
|
+
url = baseUrl + '/alpha/api/DoCodeBasedAction?LocationID=' + locationId + '&Token=' + token + '&Code=' + code + '&InputType=json&MimeType=application/json';
|
|
613
|
+
_context18.next = 3;
|
|
614
|
+
return service.post(url);
|
|
615
|
+
|
|
616
|
+
case 3:
|
|
617
|
+
response = _context18.sent;
|
|
618
|
+
return _context18.abrupt('return', response);
|
|
619
|
+
|
|
620
|
+
case 5:
|
|
621
|
+
case 'end':
|
|
622
|
+
return _context18.stop();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}, _callee18, undefined);
|
|
626
|
+
}));
|
|
627
|
+
|
|
628
|
+
return function (_x57, _x58, _x59, _x60) {
|
|
629
|
+
return _ref30.apply(this, arguments);
|
|
630
|
+
};
|
|
631
|
+
}();
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
exports.consentWithdraw = function (service) {
|
|
635
|
+
return function () {
|
|
636
|
+
var _ref31 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee19(baseUrl, locationId, token, consentData) {
|
|
637
|
+
var url, _ref32, data;
|
|
638
|
+
|
|
639
|
+
return _regenerator2.default.wrap(function _callee19$(_context19) {
|
|
640
|
+
while (1) {
|
|
641
|
+
switch (_context19.prev = _context19.next) {
|
|
642
|
+
case 0:
|
|
643
|
+
url = baseUrl + '/memberships/forgetMember?locationId=' + locationId + '&token=' + token;
|
|
644
|
+
_context19.next = 3;
|
|
645
|
+
return service.post(url, {
|
|
646
|
+
consentData: (0, _stringify2.default)(consentData)
|
|
647
|
+
}, {
|
|
648
|
+
headers: { 'Content-Type': 'application/json' }
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
case 3:
|
|
652
|
+
_ref32 = _context19.sent;
|
|
653
|
+
data = _ref32.data;
|
|
654
|
+
return _context19.abrupt('return', data);
|
|
655
|
+
|
|
656
|
+
case 6:
|
|
657
|
+
case 'end':
|
|
658
|
+
return _context19.stop();
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}, _callee19, undefined);
|
|
662
|
+
}));
|
|
663
|
+
|
|
664
|
+
return function (_x61, _x62, _x63, _x64) {
|
|
665
|
+
return _ref31.apply(this, arguments);
|
|
666
|
+
};
|
|
667
|
+
}();
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
exports.knowYourData = function (service) {
|
|
671
|
+
return function () {
|
|
672
|
+
var _ref33 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee20(baseUrl, locationId, token, email) {
|
|
673
|
+
var url, _ref34, data;
|
|
674
|
+
|
|
675
|
+
return _regenerator2.default.wrap(function _callee20$(_context20) {
|
|
676
|
+
while (1) {
|
|
677
|
+
switch (_context20.prev = _context20.next) {
|
|
678
|
+
case 0:
|
|
679
|
+
url = baseUrl + '/memberships/requestData?locationId=' + locationId + '&token=' + token;
|
|
680
|
+
_context20.next = 3;
|
|
681
|
+
return service.post(url, {
|
|
682
|
+
email: email
|
|
683
|
+
}, {
|
|
684
|
+
headers: { 'Content-Type': 'application/json' }
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
case 3:
|
|
688
|
+
_ref34 = _context20.sent;
|
|
689
|
+
data = _ref34.data;
|
|
690
|
+
return _context20.abrupt('return', data);
|
|
691
|
+
|
|
692
|
+
case 6:
|
|
693
|
+
case 'end':
|
|
694
|
+
return _context20.stop();
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}, _callee20, undefined);
|
|
698
|
+
}));
|
|
699
|
+
|
|
700
|
+
return function (_x65, _x66, _x67, _x68) {
|
|
701
|
+
return _ref33.apply(this, arguments);
|
|
702
|
+
};
|
|
703
|
+
}();
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
exports.addPaymentMethod = function (service) {
|
|
707
|
+
return function () {
|
|
708
|
+
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee21(baseUrl, locationId, token, cardToken) {
|
|
709
|
+
return _regenerator2.default.wrap(function _callee21$(_context21) {
|
|
710
|
+
while (1) {
|
|
711
|
+
switch (_context21.prev = _context21.next) {
|
|
712
|
+
case 0:
|
|
713
|
+
return _context21.abrupt('return', service({
|
|
714
|
+
method: 'post',
|
|
715
|
+
url: baseUrl + '/payments/v2/methods/' + cardToken + '?locationId=' + locationId,
|
|
716
|
+
timeout: 5000 // Wait for 5 seconds
|
|
717
|
+
}));
|
|
718
|
+
|
|
719
|
+
case 1:
|
|
720
|
+
case 'end':
|
|
721
|
+
return _context21.stop();
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}, _callee21, undefined);
|
|
725
|
+
}));
|
|
726
|
+
|
|
727
|
+
return function (_x69, _x70, _x71, _x72) {
|
|
728
|
+
return _ref35.apply(this, arguments);
|
|
729
|
+
};
|
|
730
|
+
}();
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
exports.getPaymentMethods = function (service) {
|
|
734
|
+
return function () {
|
|
735
|
+
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee22(baseUrl, locationId) {
|
|
736
|
+
return _regenerator2.default.wrap(function _callee22$(_context22) {
|
|
737
|
+
while (1) {
|
|
738
|
+
switch (_context22.prev = _context22.next) {
|
|
739
|
+
case 0:
|
|
740
|
+
return _context22.abrupt('return', service({
|
|
741
|
+
method: 'get',
|
|
742
|
+
url: baseUrl + '/payments/v2/methods?locationId=' + locationId + '&InputType=json&MimeType=application/json',
|
|
743
|
+
timeout: 5000 // Wait for 5 seconds
|
|
744
|
+
}));
|
|
745
|
+
|
|
746
|
+
case 1:
|
|
747
|
+
case 'end':
|
|
748
|
+
return _context22.stop();
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}, _callee22, undefined);
|
|
752
|
+
}));
|
|
753
|
+
|
|
754
|
+
return function (_x73, _x74) {
|
|
755
|
+
return _ref36.apply(this, arguments);
|
|
756
|
+
};
|
|
757
|
+
}();
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
exports.payInApp = function (service) {
|
|
761
|
+
return function () {
|
|
762
|
+
var _ref37 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee23(baseUrl, locationId, token, amount, creditCardToken, itemName, itemNumber, membershipKey) {
|
|
763
|
+
return _regenerator2.default.wrap(function _callee23$(_context23) {
|
|
764
|
+
while (1) {
|
|
765
|
+
switch (_context23.prev = _context23.next) {
|
|
766
|
+
case 0:
|
|
767
|
+
return _context23.abrupt('return', service({
|
|
768
|
+
method: 'post',
|
|
769
|
+
url: baseUrl + '/payments/v2/payments/charge?locationId=' + locationId,
|
|
770
|
+
timeout: 5000, // Wait for 5 seconds
|
|
771
|
+
data: {
|
|
772
|
+
amount: amount,
|
|
773
|
+
payment_method: {
|
|
774
|
+
type: 'tokenized',
|
|
775
|
+
token: creditCardToken
|
|
776
|
+
},
|
|
777
|
+
additional_details: {
|
|
778
|
+
paymentFlow: 'PayInApp',
|
|
779
|
+
quantity: '1',
|
|
780
|
+
itemNumber: itemNumber,
|
|
781
|
+
itemName: itemName,
|
|
782
|
+
membershipKey: membershipKey
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}));
|
|
786
|
+
|
|
787
|
+
case 1:
|
|
788
|
+
case 'end':
|
|
789
|
+
return _context23.stop();
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}, _callee23, undefined);
|
|
793
|
+
}));
|
|
794
|
+
|
|
795
|
+
return function (_x75, _x76, _x77, _x78, _x79, _x80, _x81, _x82) {
|
|
796
|
+
return _ref37.apply(this, arguments);
|
|
797
|
+
};
|
|
798
|
+
}();
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
exports.deletePayment = function (service) {
|
|
802
|
+
return function () {
|
|
803
|
+
var _ref38 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee24(baseUrl, locationId, token, creditCardToken) {
|
|
804
|
+
var url, response;
|
|
805
|
+
return _regenerator2.default.wrap(function _callee24$(_context24) {
|
|
806
|
+
while (1) {
|
|
807
|
+
switch (_context24.prev = _context24.next) {
|
|
808
|
+
case 0:
|
|
809
|
+
url = baseUrl + '/payments/v2/methods/' + creditCardToken + '?locationId=' + locationId;
|
|
810
|
+
_context24.next = 3;
|
|
811
|
+
return service.delete(url);
|
|
812
|
+
|
|
813
|
+
case 3:
|
|
814
|
+
response = _context24.sent;
|
|
815
|
+
return _context24.abrupt('return', response);
|
|
816
|
+
|
|
817
|
+
case 5:
|
|
818
|
+
case 'end':
|
|
819
|
+
return _context24.stop();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}, _callee24, undefined);
|
|
823
|
+
}));
|
|
824
|
+
|
|
825
|
+
return function (_x83, _x84, _x85, _x86) {
|
|
826
|
+
return _ref38.apply(this, arguments);
|
|
827
|
+
};
|
|
828
|
+
}();
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
exports.getMemberMessages = function (service) {
|
|
832
|
+
return function () {
|
|
833
|
+
var _ref39 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee25(baseUrl, locationId, tag, limit, offset) {
|
|
834
|
+
var query, url;
|
|
835
|
+
return _regenerator2.default.wrap(function _callee25$(_context25) {
|
|
836
|
+
while (1) {
|
|
837
|
+
switch (_context25.prev = _context25.next) {
|
|
838
|
+
case 0:
|
|
839
|
+
query = {
|
|
840
|
+
locationId: locationId,
|
|
841
|
+
MimeType: 'application/json',
|
|
842
|
+
tag: tag,
|
|
843
|
+
limit: limit,
|
|
844
|
+
offset: offset
|
|
845
|
+
};
|
|
846
|
+
url = urlsUtils.appendQuery(baseUrl + '/memberMessages', query);
|
|
847
|
+
return _context25.abrupt('return', service.get(url));
|
|
848
|
+
|
|
849
|
+
case 3:
|
|
850
|
+
case 'end':
|
|
851
|
+
return _context25.stop();
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}, _callee25, undefined);
|
|
855
|
+
}));
|
|
856
|
+
|
|
857
|
+
return function (_x87, _x88, _x89, _x90, _x91) {
|
|
858
|
+
return _ref39.apply(this, arguments);
|
|
859
|
+
};
|
|
860
|
+
}();
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
exports.markAsReadMemberMessages = function (service) {
|
|
864
|
+
return function () {
|
|
865
|
+
var _ref40 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee26(baseUrl, locationId, keysList) {
|
|
866
|
+
var url, response;
|
|
867
|
+
return _regenerator2.default.wrap(function _callee26$(_context26) {
|
|
868
|
+
while (1) {
|
|
869
|
+
switch (_context26.prev = _context26.next) {
|
|
870
|
+
case 0:
|
|
871
|
+
url = baseUrl + '/memberMessages/markAsRead/v2?locationId=' + locationId;
|
|
872
|
+
_context26.next = 3;
|
|
873
|
+
return service.put(url, {
|
|
874
|
+
keys: keysList
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
case 3:
|
|
878
|
+
response = _context26.sent;
|
|
879
|
+
return _context26.abrupt('return', response);
|
|
880
|
+
|
|
881
|
+
case 5:
|
|
882
|
+
case 'end':
|
|
883
|
+
return _context26.stop();
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}, _callee26, undefined);
|
|
887
|
+
}));
|
|
888
|
+
|
|
889
|
+
return function (_x92, _x93, _x94) {
|
|
890
|
+
return _ref40.apply(this, arguments);
|
|
891
|
+
};
|
|
892
|
+
}();
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
exports.budgetTransfer = function (service) {
|
|
896
|
+
return function () {
|
|
897
|
+
var _ref41 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee27(baseUrl, locationId, receiver, sender, amount, wallet) {
|
|
898
|
+
return _regenerator2.default.wrap(function _callee27$(_context27) {
|
|
899
|
+
while (1) {
|
|
900
|
+
switch (_context27.prev = _context27.next) {
|
|
901
|
+
case 0:
|
|
902
|
+
return _context27.abrupt('return', service({
|
|
903
|
+
method: 'post',
|
|
904
|
+
url: baseUrl + '/budgetTransfer?locationId=' + locationId,
|
|
905
|
+
timeout: 5000, // Wait for 5 seconds
|
|
906
|
+
data: {
|
|
907
|
+
receiver: receiver,
|
|
908
|
+
sender: sender,
|
|
909
|
+
amount: amount,
|
|
910
|
+
wallet: wallet
|
|
911
|
+
}
|
|
912
|
+
}));
|
|
913
|
+
|
|
914
|
+
case 1:
|
|
915
|
+
case 'end':
|
|
916
|
+
return _context27.stop();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}, _callee27, undefined);
|
|
920
|
+
}));
|
|
921
|
+
|
|
922
|
+
return function (_x95, _x96, _x97, _x98, _x99, _x100) {
|
|
923
|
+
return _ref41.apply(this, arguments);
|
|
924
|
+
};
|
|
925
|
+
}();
|
|
926
|
+
};
|
|
927
|
+
exports.budgetTransferClaim = function (service) {
|
|
928
|
+
return function () {
|
|
929
|
+
var _ref42 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee28(baseUrl, locationId, claimCode) {
|
|
930
|
+
return _regenerator2.default.wrap(function _callee28$(_context28) {
|
|
931
|
+
while (1) {
|
|
932
|
+
switch (_context28.prev = _context28.next) {
|
|
933
|
+
case 0:
|
|
934
|
+
return _context28.abrupt('return', service({
|
|
935
|
+
method: 'post',
|
|
936
|
+
url: baseUrl + '/budgetTransfer/' + claimCode + '/claim?locationId=' + locationId,
|
|
937
|
+
timeout: 5000 // Wait for 5 seconds
|
|
938
|
+
}));
|
|
939
|
+
|
|
940
|
+
case 1:
|
|
941
|
+
case 'end':
|
|
942
|
+
return _context28.stop();
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}, _callee28, undefined);
|
|
946
|
+
}));
|
|
947
|
+
|
|
948
|
+
return function (_x101, _x102, _x103) {
|
|
949
|
+
return _ref42.apply(this, arguments);
|
|
950
|
+
};
|
|
951
|
+
}();
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
exports.getCreditClaimData = function (service) {
|
|
955
|
+
return function () {
|
|
956
|
+
var _ref43 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee29(baseUrl, claimId) {
|
|
957
|
+
var url, response;
|
|
958
|
+
return _regenerator2.default.wrap(function _callee29$(_context29) {
|
|
959
|
+
while (1) {
|
|
960
|
+
switch (_context29.prev = _context29.next) {
|
|
961
|
+
case 0:
|
|
962
|
+
url = baseUrl + '/budgetTransfer/' + claimId;
|
|
963
|
+
_context29.next = 3;
|
|
964
|
+
return service.get(url);
|
|
965
|
+
|
|
966
|
+
case 3:
|
|
967
|
+
response = _context29.sent;
|
|
968
|
+
return _context29.abrupt('return', response);
|
|
969
|
+
|
|
970
|
+
case 5:
|
|
971
|
+
case 'end':
|
|
972
|
+
return _context29.stop();
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}, _callee29, undefined);
|
|
976
|
+
}));
|
|
977
|
+
|
|
978
|
+
return function (_x104, _x105) {
|
|
979
|
+
return _ref43.apply(this, arguments);
|
|
980
|
+
};
|
|
981
|
+
}();
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
exports.claim = function (service) {
|
|
985
|
+
return function () {
|
|
986
|
+
var _ref44 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee30(baseUrl, locationId, token, AssetKey, ItemID, Tag) {
|
|
987
|
+
var url;
|
|
988
|
+
return _regenerator2.default.wrap(function _callee30$(_context30) {
|
|
989
|
+
while (1) {
|
|
990
|
+
switch (_context30.prev = _context30.next) {
|
|
991
|
+
case 0:
|
|
992
|
+
url = baseUrl + '/alpha/api/Claim?Token=' + token + '&LocationID=' + locationId + '&InputType=JSON&MimeType=application/json';
|
|
993
|
+
return _context30.abrupt('return', service.post(url, {
|
|
994
|
+
Data: {
|
|
995
|
+
AssetKey: AssetKey,
|
|
996
|
+
ItemID: ItemID,
|
|
997
|
+
Tag: Tag
|
|
998
|
+
}
|
|
999
|
+
}));
|
|
1000
|
+
|
|
1001
|
+
case 2:
|
|
1002
|
+
case 'end':
|
|
1003
|
+
return _context30.stop();
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}, _callee30, undefined);
|
|
1007
|
+
}));
|
|
1008
|
+
|
|
1009
|
+
return function (_x106, _x107, _x108, _x109, _x110, _x111) {
|
|
1010
|
+
return _ref44.apply(this, arguments);
|
|
1011
|
+
};
|
|
1012
|
+
}();
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
exports.getUserPointShopDataAPI2 = function (service) {
|
|
1016
|
+
return function () {
|
|
1017
|
+
var _ref45 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee31(baseUrl, locationId) {
|
|
1018
|
+
var url, response;
|
|
1019
|
+
return _regenerator2.default.wrap(function _callee31$(_context31) {
|
|
1020
|
+
while (1) {
|
|
1021
|
+
switch (_context31.prev = _context31.next) {
|
|
1022
|
+
case 0:
|
|
1023
|
+
url = baseUrl + '/api/pointShop/member?locationId=' + locationId;
|
|
1024
|
+
_context31.next = 3;
|
|
1025
|
+
return service.get(url);
|
|
1026
|
+
|
|
1027
|
+
case 3:
|
|
1028
|
+
response = _context31.sent;
|
|
1029
|
+
return _context31.abrupt('return', response);
|
|
1030
|
+
|
|
1031
|
+
case 5:
|
|
1032
|
+
case 'end':
|
|
1033
|
+
return _context31.stop();
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}, _callee31, undefined);
|
|
1037
|
+
}));
|
|
1038
|
+
|
|
1039
|
+
return function (_x112, _x113) {
|
|
1040
|
+
return _ref45.apply(this, arguments);
|
|
1041
|
+
};
|
|
1042
|
+
}();
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
exports.purchaseAssetAPI2 = function (service) {
|
|
1046
|
+
return function () {
|
|
1047
|
+
var _ref46 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(baseUrl, locationId, assetID) {
|
|
1048
|
+
var url, response;
|
|
1049
|
+
return _regenerator2.default.wrap(function _callee32$(_context32) {
|
|
1050
|
+
while (1) {
|
|
1051
|
+
switch (_context32.prev = _context32.next) {
|
|
1052
|
+
case 0:
|
|
1053
|
+
url = baseUrl + '/api/pointShop/purchase/' + assetID + '?locationId=' + locationId;
|
|
1054
|
+
_context32.next = 3;
|
|
1055
|
+
return service.post(url);
|
|
1056
|
+
|
|
1057
|
+
case 3:
|
|
1058
|
+
response = _context32.sent;
|
|
1059
|
+
return _context32.abrupt('return', response);
|
|
1060
|
+
|
|
1061
|
+
case 5:
|
|
1062
|
+
case 'end':
|
|
1063
|
+
return _context32.stop();
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}, _callee32, undefined);
|
|
1067
|
+
}));
|
|
1068
|
+
|
|
1069
|
+
return function (_x114, _x115, _x116) {
|
|
1070
|
+
return _ref46.apply(this, arguments);
|
|
1071
|
+
};
|
|
1072
|
+
}();
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
exports.logUserAction = function (service) {
|
|
1076
|
+
return function () {
|
|
1077
|
+
var _ref47 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee33(baseUrl, locationId, token, action, logData) {
|
|
1078
|
+
var url, _ref48, data;
|
|
1079
|
+
|
|
1080
|
+
return _regenerator2.default.wrap(function _callee33$(_context33) {
|
|
1081
|
+
while (1) {
|
|
1082
|
+
switch (_context33.prev = _context33.next) {
|
|
1083
|
+
case 0:
|
|
1084
|
+
url = baseUrl + '/alpha/api/AsyncLogUserAction?InputType=Json&MimeType=application&Token=' + token;
|
|
1085
|
+
_context33.next = 3;
|
|
1086
|
+
return service.post(url, {
|
|
1087
|
+
Data: logData,
|
|
1088
|
+
BusinessID: locationId,
|
|
1089
|
+
Action: action
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
case 3:
|
|
1093
|
+
_ref48 = _context33.sent;
|
|
1094
|
+
data = _ref48.data;
|
|
1095
|
+
return _context33.abrupt('return', data);
|
|
1096
|
+
|
|
1097
|
+
case 6:
|
|
1098
|
+
case 'end':
|
|
1099
|
+
return _context33.stop();
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}, _callee33, undefined);
|
|
1103
|
+
}));
|
|
1104
|
+
|
|
1105
|
+
return function (_x117, _x118, _x119, _x120, _x121) {
|
|
1106
|
+
return _ref47.apply(this, arguments);
|
|
1107
|
+
};
|
|
1108
|
+
}();
|
|
354
1109
|
};
|