@como/como-client 0.9.2 → 0.9.4
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 +355 -431
- package/lib/services/auth.service.js +5 -38
- package/package.json +1 -1
- package/src/como.js +37 -51
package/lib/como.js
CHANGED
|
@@ -208,7 +208,7 @@ var Como = function () {
|
|
|
208
208
|
|
|
209
209
|
_context2.prev = 17;
|
|
210
210
|
_context2.next = 20;
|
|
211
|
-
return this.comoData.initApi.refreshToken(installationId, refreshToken
|
|
211
|
+
return this.comoData.initApi.refreshToken(installationId, refreshToken || 'none', locationId, source);
|
|
212
212
|
|
|
213
213
|
case 20:
|
|
214
214
|
data = _context2.sent;
|
|
@@ -224,8 +224,10 @@ var Como = function () {
|
|
|
224
224
|
_context2.t0 = _context2['catch'](17);
|
|
225
225
|
|
|
226
226
|
console.error('Failed to refresh token, installationId:' + installationId + ', refreshToken:' + this.comoData.refreshToken + ', locationId:' + locationId + ', source:' + source);
|
|
227
|
-
//refresh failed - need to revoke and signOn again
|
|
228
|
-
initService.logError({
|
|
227
|
+
// refresh failed - need to revoke and signOn again
|
|
228
|
+
initService.logError({
|
|
229
|
+
method: 'refreshToken', installationId: installationId, locationId: locationId, source: source, refreshToken: refreshToken, error: _context2.t0.message
|
|
230
|
+
});
|
|
229
231
|
refreshFailed = true;
|
|
230
232
|
|
|
231
233
|
case 31:
|
|
@@ -262,7 +264,9 @@ var Como = function () {
|
|
|
262
264
|
|
|
263
265
|
console.error('Failed to signOn, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',interval:' + interval + ', error:' + _context2.t1);
|
|
264
266
|
interval += 1000;
|
|
265
|
-
initService.logError({
|
|
267
|
+
initService.logError({
|
|
268
|
+
method: 'signOn no accessToken', accessToken: accessToken, isExpired: isExpired, refreshFailed: refreshFailed, credExist: credExist, installationId: installationId, locationId: locationId, source: source, refreshToken: refreshToken, interval: interval, error: _context2.t1.message
|
|
269
|
+
});
|
|
266
270
|
_context2.next = 51;
|
|
267
271
|
return new _promise2.default(function (r) {
|
|
268
272
|
return setTimeout(r, interval);
|
|
@@ -318,7 +322,9 @@ var Como = function () {
|
|
|
318
322
|
|
|
319
323
|
console.error('Failed signOn with accessToken, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',accessToken:' + accessToken + ', error:' + _context2.t2.message);
|
|
320
324
|
interval += 1000;
|
|
321
|
-
initService.logError({
|
|
325
|
+
initService.logError({
|
|
326
|
+
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
|
|
327
|
+
});
|
|
322
328
|
_context2.next = 77;
|
|
323
329
|
return new _promise2.default(function (r) {
|
|
324
330
|
return setTimeout(r, interval);
|
|
@@ -877,7 +883,7 @@ var Como = function () {
|
|
|
877
883
|
key: 'login',
|
|
878
884
|
value: function () {
|
|
879
885
|
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform, isWhatsapp) {
|
|
880
|
-
var api, data, _error$response$data8, code, message;
|
|
886
|
+
var api, data, _error$response$data8, code, message, retryAfter, loginError;
|
|
881
887
|
|
|
882
888
|
return _regenerator2.default.wrap(function _callee12$(_context12) {
|
|
883
889
|
while (1) {
|
|
@@ -897,17 +903,25 @@ var Como = function () {
|
|
|
897
903
|
_context12.t0 = _context12['catch'](1);
|
|
898
904
|
|
|
899
905
|
if (!(_context12.t0.response && _context12.t0.response.data)) {
|
|
900
|
-
_context12.next =
|
|
906
|
+
_context12.next = 15;
|
|
901
907
|
break;
|
|
902
908
|
}
|
|
903
909
|
|
|
904
|
-
_error$response$data8 = _context12.t0.response.data, code = _error$response$data8.code, message = _error$response$data8.message;
|
|
905
|
-
|
|
910
|
+
_error$response$data8 = _context12.t0.response.data, code = _error$response$data8.code, message = _error$response$data8.message, retryAfter = _error$response$data8.retryAfter;
|
|
911
|
+
loginError = new Error(code || message);
|
|
912
|
+
// When a request lands inside its OTP backoff the server states how long
|
|
913
|
+
// to wait. Only code and message used to survive this rethrow, which left
|
|
914
|
+
// the app inventing a countdown of its own.
|
|
906
915
|
|
|
907
|
-
|
|
916
|
+
if (typeof retryAfter === 'number') {
|
|
917
|
+
loginError.retryAfter = retryAfter;
|
|
918
|
+
}
|
|
919
|
+
throw loginError;
|
|
920
|
+
|
|
921
|
+
case 15:
|
|
908
922
|
throw _context12.t0;
|
|
909
923
|
|
|
910
|
-
case
|
|
924
|
+
case 16:
|
|
911
925
|
case 'end':
|
|
912
926
|
return _context12.stop();
|
|
913
927
|
}
|
|
@@ -922,95 +936,6 @@ var Como = function () {
|
|
|
922
936
|
return login;
|
|
923
937
|
}()
|
|
924
938
|
|
|
925
|
-
/**
|
|
926
|
-
* Social login via Firebase SSO (Google/Facebook/Apple).
|
|
927
|
-
* @param {Object} params
|
|
928
|
-
* @param {string} params.socialId - Firebase user UID
|
|
929
|
-
* @param {string} params.provider - Social provider (google/facebook/apple)
|
|
930
|
-
* @param {string} params.idToken - Firebase ID token
|
|
931
|
-
* @returns {Promise<Object>} { success, accessToken, refreshToken, consent } or { success: false, userExists: false }
|
|
932
|
-
*/
|
|
933
|
-
|
|
934
|
-
}, {
|
|
935
|
-
key: 'socialLogin',
|
|
936
|
-
value: function () {
|
|
937
|
-
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(_ref14) {
|
|
938
|
-
var socialId = _ref14.socialId,
|
|
939
|
-
provider = _ref14.provider,
|
|
940
|
-
idToken = _ref14.idToken;
|
|
941
|
-
|
|
942
|
-
var api, data, _error$response$data9, code, message;
|
|
943
|
-
|
|
944
|
-
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
|
945
|
-
while (1) {
|
|
946
|
-
switch (_context13.prev = _context13.next) {
|
|
947
|
-
case 0:
|
|
948
|
-
api = this.comoData.api;
|
|
949
|
-
_context13.prev = 1;
|
|
950
|
-
_context13.next = 4;
|
|
951
|
-
return api.socialLogin(socialId, provider, idToken);
|
|
952
|
-
|
|
953
|
-
case 4:
|
|
954
|
-
data = _context13.sent;
|
|
955
|
-
return _context13.abrupt('return', data);
|
|
956
|
-
|
|
957
|
-
case 8:
|
|
958
|
-
_context13.prev = 8;
|
|
959
|
-
_context13.t0 = _context13['catch'](1);
|
|
960
|
-
|
|
961
|
-
if (!(_context13.t0.response && _context13.t0.response.data)) {
|
|
962
|
-
_context13.next = 13;
|
|
963
|
-
break;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
_error$response$data9 = _context13.t0.response.data, code = _error$response$data9.code, message = _error$response$data9.message;
|
|
967
|
-
throw new Error(code || message);
|
|
968
|
-
|
|
969
|
-
case 13:
|
|
970
|
-
throw _context13.t0;
|
|
971
|
-
|
|
972
|
-
case 14:
|
|
973
|
-
case 'end':
|
|
974
|
-
return _context13.stop();
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}, _callee13, this, [[1, 8]]);
|
|
978
|
-
}));
|
|
979
|
-
|
|
980
|
-
function socialLogin(_x38) {
|
|
981
|
-
return _ref13.apply(this, arguments);
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
return socialLogin;
|
|
985
|
-
}()
|
|
986
|
-
}, {
|
|
987
|
-
key: 'socialLoginCheck',
|
|
988
|
-
value: function () {
|
|
989
|
-
var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(_ref16) {
|
|
990
|
-
var socialId = _ref16.socialId,
|
|
991
|
-
provider = _ref16.provider,
|
|
992
|
-
idToken = _ref16.idToken;
|
|
993
|
-
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
|
994
|
-
while (1) {
|
|
995
|
-
switch (_context14.prev = _context14.next) {
|
|
996
|
-
case 0:
|
|
997
|
-
return _context14.abrupt('return', this.socialLogin({ socialId: socialId, provider: provider, idToken: idToken }));
|
|
998
|
-
|
|
999
|
-
case 1:
|
|
1000
|
-
case 'end':
|
|
1001
|
-
return _context14.stop();
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
}, _callee14, this);
|
|
1005
|
-
}));
|
|
1006
|
-
|
|
1007
|
-
function socialLoginCheck(_x39) {
|
|
1008
|
-
return _ref15.apply(this, arguments);
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
return socialLoginCheck;
|
|
1012
|
-
}()
|
|
1013
|
-
|
|
1014
939
|
/**
|
|
1015
940
|
*
|
|
1016
941
|
* @param {Object} identifier key-value identifiers
|
|
@@ -1024,63 +949,62 @@ var Como = function () {
|
|
|
1024
949
|
}, {
|
|
1025
950
|
key: 'loginVerify',
|
|
1026
951
|
value: function () {
|
|
1027
|
-
var
|
|
1028
|
-
var api,
|
|
952
|
+
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(identifier, type, code, reCaptchaToken, recaptchaTokenType, devicePlatform) {
|
|
953
|
+
var api, _ref14, consent, _error$response$data9, errCode, message, retryAfter, verifyError;
|
|
1029
954
|
|
|
1030
|
-
return _regenerator2.default.wrap(function
|
|
955
|
+
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
|
1031
956
|
while (1) {
|
|
1032
|
-
switch (
|
|
957
|
+
switch (_context13.prev = _context13.next) {
|
|
1033
958
|
case 0:
|
|
1034
959
|
api = this.comoData.api;
|
|
1035
|
-
|
|
1036
|
-
|
|
960
|
+
_context13.prev = 1;
|
|
961
|
+
_context13.next = 4;
|
|
1037
962
|
return api.logInVerify(code, type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform);
|
|
1038
963
|
|
|
1039
964
|
case 4:
|
|
1040
|
-
|
|
1041
|
-
consent =
|
|
965
|
+
_ref14 = _context13.sent;
|
|
966
|
+
consent = _ref14.consent;
|
|
1042
967
|
|
|
1043
968
|
this.comoData.consent = consent;
|
|
1044
|
-
|
|
969
|
+
_context13.next = 17;
|
|
1045
970
|
break;
|
|
1046
971
|
|
|
1047
972
|
case 9:
|
|
1048
|
-
|
|
1049
|
-
|
|
973
|
+
_context13.prev = 9;
|
|
974
|
+
_context13.t0 = _context13['catch'](1);
|
|
1050
975
|
|
|
1051
|
-
if (!(
|
|
1052
|
-
|
|
976
|
+
if (!(_context13.t0.response && _context13.t0.response.data)) {
|
|
977
|
+
_context13.next = 16;
|
|
1053
978
|
break;
|
|
1054
979
|
}
|
|
1055
980
|
|
|
1056
|
-
_error$response$
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
_context15.next = 15;
|
|
1060
|
-
break;
|
|
1061
|
-
}
|
|
981
|
+
_error$response$data9 = _context13.t0.response.data, errCode = _error$response$data9.code, message = _error$response$data9.message, retryAfter = _error$response$data9.retryAfter;
|
|
982
|
+
// The wrong-code case keeps reporting the message rather than the code,
|
|
983
|
+
// since callers match on that string.
|
|
1062
984
|
|
|
1063
|
-
|
|
985
|
+
verifyError = message && message === 'Invalid verification Code' ? new Error(message) : new Error(errCode || message);
|
|
1064
986
|
|
|
1065
|
-
|
|
1066
|
-
|
|
987
|
+
if (typeof retryAfter === 'number') {
|
|
988
|
+
verifyError.retryAfter = retryAfter;
|
|
989
|
+
}
|
|
990
|
+
throw verifyError;
|
|
1067
991
|
|
|
1068
992
|
case 16:
|
|
1069
|
-
throw
|
|
993
|
+
throw _context13.t0;
|
|
1070
994
|
|
|
1071
995
|
case 17:
|
|
1072
|
-
return
|
|
996
|
+
return _context13.abrupt('return', this.getCredentials());
|
|
1073
997
|
|
|
1074
998
|
case 18:
|
|
1075
999
|
case 'end':
|
|
1076
|
-
return
|
|
1000
|
+
return _context13.stop();
|
|
1077
1001
|
}
|
|
1078
1002
|
}
|
|
1079
|
-
},
|
|
1003
|
+
}, _callee13, this, [[1, 9]]);
|
|
1080
1004
|
}));
|
|
1081
1005
|
|
|
1082
|
-
function loginVerify(_x40, _x41, _x42, _x43
|
|
1083
|
-
return
|
|
1006
|
+
function loginVerify(_x38, _x39, _x40, _x41, _x42, _x43) {
|
|
1007
|
+
return _ref13.apply(this, arguments);
|
|
1084
1008
|
}
|
|
1085
1009
|
|
|
1086
1010
|
return loginVerify;
|
|
@@ -1096,34 +1020,34 @@ var Como = function () {
|
|
|
1096
1020
|
}, {
|
|
1097
1021
|
key: 'reloadMembership',
|
|
1098
1022
|
value: function () {
|
|
1099
|
-
var
|
|
1023
|
+
var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
|
|
1100
1024
|
var onlyAssetKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1101
1025
|
|
|
1102
1026
|
var _comoData6, env, locationId, api, membership;
|
|
1103
1027
|
|
|
1104
|
-
return _regenerator2.default.wrap(function
|
|
1028
|
+
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
|
1105
1029
|
while (1) {
|
|
1106
|
-
switch (
|
|
1030
|
+
switch (_context14.prev = _context14.next) {
|
|
1107
1031
|
case 0:
|
|
1108
1032
|
_comoData6 = this.comoData, env = _comoData6.env_params, locationId = _comoData6.locationId, api = _comoData6.api;
|
|
1109
|
-
|
|
1033
|
+
_context14.next = 3;
|
|
1110
1034
|
return api.getUserAtLocation(env.zapp_root, locationId, onlyAssetKeys);
|
|
1111
1035
|
|
|
1112
1036
|
case 3:
|
|
1113
|
-
membership =
|
|
1037
|
+
membership = _context14.sent;
|
|
1114
1038
|
|
|
1115
1039
|
this.comoData.membership = membership;
|
|
1116
1040
|
|
|
1117
1041
|
case 5:
|
|
1118
1042
|
case 'end':
|
|
1119
|
-
return
|
|
1043
|
+
return _context14.stop();
|
|
1120
1044
|
}
|
|
1121
1045
|
}
|
|
1122
|
-
},
|
|
1046
|
+
}, _callee14, this);
|
|
1123
1047
|
}));
|
|
1124
1048
|
|
|
1125
1049
|
function reloadMembership() {
|
|
1126
|
-
return
|
|
1050
|
+
return _ref15.apply(this, arguments);
|
|
1127
1051
|
}
|
|
1128
1052
|
|
|
1129
1053
|
return reloadMembership;
|
|
@@ -1136,26 +1060,26 @@ var Como = function () {
|
|
|
1136
1060
|
}, {
|
|
1137
1061
|
key: 'openApp',
|
|
1138
1062
|
value: function () {
|
|
1139
|
-
var
|
|
1063
|
+
var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(data) {
|
|
1140
1064
|
var _comoData7, api, locationId, env;
|
|
1141
1065
|
|
|
1142
|
-
return _regenerator2.default.wrap(function
|
|
1066
|
+
return _regenerator2.default.wrap(function _callee15$(_context15) {
|
|
1143
1067
|
while (1) {
|
|
1144
|
-
switch (
|
|
1068
|
+
switch (_context15.prev = _context15.next) {
|
|
1145
1069
|
case 0:
|
|
1146
1070
|
_comoData7 = this.comoData, api = _comoData7.api, locationId = _comoData7.locationId, env = _comoData7.env_params;
|
|
1147
|
-
return
|
|
1071
|
+
return _context15.abrupt('return', api.openApp(env.zapp_root, locationId, data));
|
|
1148
1072
|
|
|
1149
1073
|
case 2:
|
|
1150
1074
|
case 'end':
|
|
1151
|
-
return
|
|
1075
|
+
return _context15.stop();
|
|
1152
1076
|
}
|
|
1153
1077
|
}
|
|
1154
|
-
},
|
|
1078
|
+
}, _callee15, this);
|
|
1155
1079
|
}));
|
|
1156
1080
|
|
|
1157
|
-
function openApp(
|
|
1158
|
-
return
|
|
1081
|
+
function openApp(_x45) {
|
|
1082
|
+
return _ref16.apply(this, arguments);
|
|
1159
1083
|
}
|
|
1160
1084
|
|
|
1161
1085
|
return openApp;
|
|
@@ -1170,33 +1094,33 @@ var Como = function () {
|
|
|
1170
1094
|
}, {
|
|
1171
1095
|
key: 'clientUpdateMembership',
|
|
1172
1096
|
value: function () {
|
|
1173
|
-
var
|
|
1097
|
+
var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(pushEnable, locationEnable) {
|
|
1174
1098
|
var _comoData8, api, locationId, token, env;
|
|
1175
1099
|
|
|
1176
|
-
return _regenerator2.default.wrap(function
|
|
1100
|
+
return _regenerator2.default.wrap(function _callee16$(_context16) {
|
|
1177
1101
|
while (1) {
|
|
1178
|
-
switch (
|
|
1102
|
+
switch (_context16.prev = _context16.next) {
|
|
1179
1103
|
case 0:
|
|
1180
1104
|
_comoData8 = this.comoData, api = _comoData8.api, locationId = _comoData8.locationId, token = _comoData8.token, env = _comoData8.env_params;
|
|
1181
|
-
|
|
1182
|
-
return
|
|
1105
|
+
_context16.prev = 1;
|
|
1106
|
+
return _context16.abrupt('return', api.clientUpdateMembership(env.services_root, locationId, pushEnable, locationEnable));
|
|
1183
1107
|
|
|
1184
1108
|
case 5:
|
|
1185
|
-
|
|
1186
|
-
|
|
1109
|
+
_context16.prev = 5;
|
|
1110
|
+
_context16.t0 = _context16['catch'](1);
|
|
1187
1111
|
|
|
1188
|
-
console.log('clientUpdateMembership failed, token:' + token + ', locationId:' + locationId + ', error: ' +
|
|
1112
|
+
console.log('clientUpdateMembership failed, token:' + token + ', locationId:' + locationId + ', error: ' + _context16.t0);
|
|
1189
1113
|
|
|
1190
1114
|
case 8:
|
|
1191
1115
|
case 'end':
|
|
1192
|
-
return
|
|
1116
|
+
return _context16.stop();
|
|
1193
1117
|
}
|
|
1194
1118
|
}
|
|
1195
|
-
},
|
|
1119
|
+
}, _callee16, this, [[1, 5]]);
|
|
1196
1120
|
}));
|
|
1197
1121
|
|
|
1198
|
-
function clientUpdateMembership(
|
|
1199
|
-
return
|
|
1122
|
+
function clientUpdateMembership(_x46, _x47) {
|
|
1123
|
+
return _ref17.apply(this, arguments);
|
|
1200
1124
|
}
|
|
1201
1125
|
|
|
1202
1126
|
return clientUpdateMembership;
|
|
@@ -1210,18 +1134,18 @@ var Como = function () {
|
|
|
1210
1134
|
}, {
|
|
1211
1135
|
key: 'downloadMainResource',
|
|
1212
1136
|
value: function () {
|
|
1213
|
-
var
|
|
1137
|
+
var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(resourceId) {
|
|
1214
1138
|
var resource, err, _comoData9, env, api, responseJson;
|
|
1215
1139
|
|
|
1216
|
-
return _regenerator2.default.wrap(function
|
|
1140
|
+
return _regenerator2.default.wrap(function _callee17$(_context17) {
|
|
1217
1141
|
while (1) {
|
|
1218
|
-
switch (
|
|
1142
|
+
switch (_context17.prev = _context17.next) {
|
|
1219
1143
|
case 0:
|
|
1220
|
-
|
|
1144
|
+
_context17.prev = 0;
|
|
1221
1145
|
resource = this.comoData.mainResourcesMap[resourceId];
|
|
1222
1146
|
|
|
1223
1147
|
if (resource) {
|
|
1224
|
-
|
|
1148
|
+
_context17.next = 5;
|
|
1225
1149
|
break;
|
|
1226
1150
|
}
|
|
1227
1151
|
|
|
@@ -1230,34 +1154,34 @@ var Como = function () {
|
|
|
1230
1154
|
|
|
1231
1155
|
case 5:
|
|
1232
1156
|
_comoData9 = this.comoData, env = _comoData9.env_params, api = _comoData9.api;
|
|
1233
|
-
|
|
1157
|
+
_context17.next = 8;
|
|
1234
1158
|
return api.getLoyaltyResource(env.services_root_cdn, resource.id, 'Namespace' in resource ? resource.Namespace : 'location_' + this.comoData.locationId, resource.Version, this.comoData.locationId);
|
|
1235
1159
|
|
|
1236
1160
|
case 8:
|
|
1237
|
-
responseJson =
|
|
1161
|
+
responseJson = _context17.sent;
|
|
1238
1162
|
|
|
1239
1163
|
|
|
1240
1164
|
this.comoData.mainResources[resourceId] = responseJson;
|
|
1241
|
-
|
|
1165
|
+
_context17.next = 16;
|
|
1242
1166
|
break;
|
|
1243
1167
|
|
|
1244
1168
|
case 12:
|
|
1245
|
-
|
|
1246
|
-
|
|
1169
|
+
_context17.prev = 12;
|
|
1170
|
+
_context17.t0 = _context17['catch'](0);
|
|
1247
1171
|
|
|
1248
|
-
console.log('downloadMainResource failed, resourceId:' + resourceId + ', locationId:' + this.comoData.locationId + ', this.comoData.mainResourcesMap: ' + this.comoData.mainResourcesMap + ', error: ' +
|
|
1249
|
-
throw new Error(
|
|
1172
|
+
console.log('downloadMainResource failed, resourceId:' + resourceId + ', locationId:' + this.comoData.locationId + ', this.comoData.mainResourcesMap: ' + this.comoData.mainResourcesMap + ', error: ' + _context17.t0);
|
|
1173
|
+
throw new Error(_context17.t0);
|
|
1250
1174
|
|
|
1251
1175
|
case 16:
|
|
1252
1176
|
case 'end':
|
|
1253
|
-
return
|
|
1177
|
+
return _context17.stop();
|
|
1254
1178
|
}
|
|
1255
1179
|
}
|
|
1256
|
-
},
|
|
1180
|
+
}, _callee17, this, [[0, 12]]);
|
|
1257
1181
|
}));
|
|
1258
1182
|
|
|
1259
|
-
function downloadMainResource(
|
|
1260
|
-
return
|
|
1183
|
+
function downloadMainResource(_x48) {
|
|
1184
|
+
return _ref18.apply(this, arguments);
|
|
1261
1185
|
}
|
|
1262
1186
|
|
|
1263
1187
|
return downloadMainResource;
|
|
@@ -1271,18 +1195,18 @@ var Como = function () {
|
|
|
1271
1195
|
}, {
|
|
1272
1196
|
key: 'reloadLocationState',
|
|
1273
1197
|
value: function () {
|
|
1274
|
-
var
|
|
1198
|
+
var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18() {
|
|
1275
1199
|
var api, state, mainResources;
|
|
1276
|
-
return _regenerator2.default.wrap(function
|
|
1200
|
+
return _regenerator2.default.wrap(function _callee18$(_context18) {
|
|
1277
1201
|
while (1) {
|
|
1278
|
-
switch (
|
|
1202
|
+
switch (_context18.prev = _context18.next) {
|
|
1279
1203
|
case 0:
|
|
1280
1204
|
api = this.comoData.api;
|
|
1281
|
-
|
|
1205
|
+
_context18.next = 3;
|
|
1282
1206
|
return api.getLocationState(this.comoData.env_params.zapp_root, this.comoData.locationId);
|
|
1283
1207
|
|
|
1284
1208
|
case 3:
|
|
1285
|
-
state =
|
|
1209
|
+
state = _context18.sent;
|
|
1286
1210
|
|
|
1287
1211
|
this.comoData.locationState = state;
|
|
1288
1212
|
mainResources = state.MainResources.Resource;
|
|
@@ -1295,14 +1219,14 @@ var Como = function () {
|
|
|
1295
1219
|
|
|
1296
1220
|
case 7:
|
|
1297
1221
|
case 'end':
|
|
1298
|
-
return
|
|
1222
|
+
return _context18.stop();
|
|
1299
1223
|
}
|
|
1300
1224
|
}
|
|
1301
|
-
},
|
|
1225
|
+
}, _callee18, this);
|
|
1302
1226
|
}));
|
|
1303
1227
|
|
|
1304
1228
|
function reloadLocationState() {
|
|
1305
|
-
return
|
|
1229
|
+
return _ref19.apply(this, arguments);
|
|
1306
1230
|
}
|
|
1307
1231
|
|
|
1308
1232
|
return reloadLocationState;
|
|
@@ -1315,35 +1239,35 @@ var Como = function () {
|
|
|
1315
1239
|
}, {
|
|
1316
1240
|
key: 'getAppClientID',
|
|
1317
1241
|
value: function () {
|
|
1318
|
-
var
|
|
1242
|
+
var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee19() {
|
|
1319
1243
|
var _comoData10, env, locationId, api, responseJson;
|
|
1320
1244
|
|
|
1321
|
-
return _regenerator2.default.wrap(function
|
|
1245
|
+
return _regenerator2.default.wrap(function _callee19$(_context19) {
|
|
1322
1246
|
while (1) {
|
|
1323
|
-
switch (
|
|
1247
|
+
switch (_context19.prev = _context19.next) {
|
|
1324
1248
|
case 0:
|
|
1325
1249
|
_comoData10 = this.comoData, env = _comoData10.env_params, locationId = _comoData10.locationId, api = _comoData10.api;
|
|
1326
|
-
|
|
1250
|
+
_context19.next = 3;
|
|
1327
1251
|
return this.refreshTokenIfNeeded();
|
|
1328
1252
|
|
|
1329
1253
|
case 3:
|
|
1330
|
-
|
|
1254
|
+
_context19.next = 5;
|
|
1331
1255
|
return api.getShortUserId(env.zapp_root, locationId);
|
|
1332
1256
|
|
|
1333
1257
|
case 5:
|
|
1334
|
-
responseJson =
|
|
1335
|
-
return
|
|
1258
|
+
responseJson = _context19.sent;
|
|
1259
|
+
return _context19.abrupt('return', responseJson.ID);
|
|
1336
1260
|
|
|
1337
1261
|
case 7:
|
|
1338
1262
|
case 'end':
|
|
1339
|
-
return
|
|
1263
|
+
return _context19.stop();
|
|
1340
1264
|
}
|
|
1341
1265
|
}
|
|
1342
|
-
},
|
|
1266
|
+
}, _callee19, this);
|
|
1343
1267
|
}));
|
|
1344
1268
|
|
|
1345
1269
|
function getAppClientID() {
|
|
1346
|
-
return
|
|
1270
|
+
return _ref20.apply(this, arguments);
|
|
1347
1271
|
}
|
|
1348
1272
|
|
|
1349
1273
|
return getAppClientID;
|
|
@@ -1356,31 +1280,31 @@ var Como = function () {
|
|
|
1356
1280
|
}, {
|
|
1357
1281
|
key: 'getPaymentCode',
|
|
1358
1282
|
value: function () {
|
|
1359
|
-
var
|
|
1283
|
+
var _ref21 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee20() {
|
|
1360
1284
|
var _comoData11, env, locationId, api, responseJson;
|
|
1361
1285
|
|
|
1362
|
-
return _regenerator2.default.wrap(function
|
|
1286
|
+
return _regenerator2.default.wrap(function _callee20$(_context20) {
|
|
1363
1287
|
while (1) {
|
|
1364
|
-
switch (
|
|
1288
|
+
switch (_context20.prev = _context20.next) {
|
|
1365
1289
|
case 0:
|
|
1366
1290
|
_comoData11 = this.comoData, env = _comoData11.env_params, locationId = _comoData11.locationId, api = _comoData11.api;
|
|
1367
|
-
|
|
1291
|
+
_context20.next = 3;
|
|
1368
1292
|
return api.getPaymentCode(env.zapp_root, locationId);
|
|
1369
1293
|
|
|
1370
1294
|
case 3:
|
|
1371
|
-
responseJson =
|
|
1372
|
-
return
|
|
1295
|
+
responseJson = _context20.sent;
|
|
1296
|
+
return _context20.abrupt('return', responseJson.VerificationCode);
|
|
1373
1297
|
|
|
1374
1298
|
case 5:
|
|
1375
1299
|
case 'end':
|
|
1376
|
-
return
|
|
1300
|
+
return _context20.stop();
|
|
1377
1301
|
}
|
|
1378
1302
|
}
|
|
1379
|
-
},
|
|
1303
|
+
}, _callee20, this);
|
|
1380
1304
|
}));
|
|
1381
1305
|
|
|
1382
1306
|
function getPaymentCode() {
|
|
1383
|
-
return
|
|
1307
|
+
return _ref21.apply(this, arguments);
|
|
1384
1308
|
}
|
|
1385
1309
|
|
|
1386
1310
|
return getPaymentCode;
|
|
@@ -1393,47 +1317,47 @@ var Como = function () {
|
|
|
1393
1317
|
}, {
|
|
1394
1318
|
key: 'logout',
|
|
1395
1319
|
value: function () {
|
|
1396
|
-
var
|
|
1397
|
-
var api, response, _error$response$
|
|
1320
|
+
var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee21() {
|
|
1321
|
+
var api, response, _error$response$data10, errCode, message;
|
|
1398
1322
|
|
|
1399
|
-
return _regenerator2.default.wrap(function
|
|
1323
|
+
return _regenerator2.default.wrap(function _callee21$(_context21) {
|
|
1400
1324
|
while (1) {
|
|
1401
|
-
switch (
|
|
1325
|
+
switch (_context21.prev = _context21.next) {
|
|
1402
1326
|
case 0:
|
|
1403
1327
|
api = this.comoData.api;
|
|
1404
|
-
|
|
1405
|
-
|
|
1328
|
+
_context21.prev = 1;
|
|
1329
|
+
_context21.next = 4;
|
|
1406
1330
|
return api.logOut();
|
|
1407
1331
|
|
|
1408
1332
|
case 4:
|
|
1409
|
-
response =
|
|
1410
|
-
return
|
|
1333
|
+
response = _context21.sent;
|
|
1334
|
+
return _context21.abrupt('return', response);
|
|
1411
1335
|
|
|
1412
1336
|
case 8:
|
|
1413
|
-
|
|
1414
|
-
|
|
1337
|
+
_context21.prev = 8;
|
|
1338
|
+
_context21.t0 = _context21['catch'](1);
|
|
1415
1339
|
|
|
1416
|
-
if (!(
|
|
1417
|
-
|
|
1340
|
+
if (!(_context21.t0.response && _context21.t0.response.data)) {
|
|
1341
|
+
_context21.next = 13;
|
|
1418
1342
|
break;
|
|
1419
1343
|
}
|
|
1420
1344
|
|
|
1421
|
-
_error$response$
|
|
1345
|
+
_error$response$data10 = _context21.t0.response.data, errCode = _error$response$data10.code, message = _error$response$data10.message;
|
|
1422
1346
|
throw new Error(errCode || message);
|
|
1423
1347
|
|
|
1424
1348
|
case 13:
|
|
1425
|
-
throw
|
|
1349
|
+
throw _context21.t0;
|
|
1426
1350
|
|
|
1427
1351
|
case 14:
|
|
1428
1352
|
case 'end':
|
|
1429
|
-
return
|
|
1353
|
+
return _context21.stop();
|
|
1430
1354
|
}
|
|
1431
1355
|
}
|
|
1432
|
-
},
|
|
1356
|
+
}, _callee21, this, [[1, 8]]);
|
|
1433
1357
|
}));
|
|
1434
1358
|
|
|
1435
1359
|
function logout() {
|
|
1436
|
-
return
|
|
1360
|
+
return _ref22.apply(this, arguments);
|
|
1437
1361
|
}
|
|
1438
1362
|
|
|
1439
1363
|
return logout;
|
|
@@ -1447,35 +1371,35 @@ var Como = function () {
|
|
|
1447
1371
|
}, {
|
|
1448
1372
|
key: 'redeemAsset',
|
|
1449
1373
|
value: function () {
|
|
1450
|
-
var
|
|
1374
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee22(assetKey) {
|
|
1451
1375
|
var _comoData12, env, locationId, api, responseJson;
|
|
1452
1376
|
|
|
1453
|
-
return _regenerator2.default.wrap(function
|
|
1377
|
+
return _regenerator2.default.wrap(function _callee22$(_context22) {
|
|
1454
1378
|
while (1) {
|
|
1455
|
-
switch (
|
|
1379
|
+
switch (_context22.prev = _context22.next) {
|
|
1456
1380
|
case 0:
|
|
1457
1381
|
_comoData12 = this.comoData, env = _comoData12.env_params, locationId = _comoData12.locationId, api = _comoData12.api;
|
|
1458
|
-
|
|
1382
|
+
_context22.next = 3;
|
|
1459
1383
|
return this.refreshTokenIfNeeded();
|
|
1460
1384
|
|
|
1461
1385
|
case 3:
|
|
1462
|
-
|
|
1386
|
+
_context22.next = 5;
|
|
1463
1387
|
return api.redeemAsset(env.zapp_root, locationId, assetKey);
|
|
1464
1388
|
|
|
1465
1389
|
case 5:
|
|
1466
|
-
responseJson =
|
|
1467
|
-
return
|
|
1390
|
+
responseJson = _context22.sent;
|
|
1391
|
+
return _context22.abrupt('return', responseJson);
|
|
1468
1392
|
|
|
1469
1393
|
case 7:
|
|
1470
1394
|
case 'end':
|
|
1471
|
-
return
|
|
1395
|
+
return _context22.stop();
|
|
1472
1396
|
}
|
|
1473
1397
|
}
|
|
1474
|
-
},
|
|
1398
|
+
}, _callee22, this);
|
|
1475
1399
|
}));
|
|
1476
1400
|
|
|
1477
|
-
function redeemAsset(
|
|
1478
|
-
return
|
|
1401
|
+
function redeemAsset(_x49) {
|
|
1402
|
+
return _ref23.apply(this, arguments);
|
|
1479
1403
|
}
|
|
1480
1404
|
|
|
1481
1405
|
return redeemAsset;
|
|
@@ -1489,31 +1413,31 @@ var Como = function () {
|
|
|
1489
1413
|
}, {
|
|
1490
1414
|
key: 'purchaseAsset',
|
|
1491
1415
|
value: function () {
|
|
1492
|
-
var
|
|
1416
|
+
var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee23(itemId) {
|
|
1493
1417
|
var _comoData13, env, locationId, api, responseJson;
|
|
1494
1418
|
|
|
1495
|
-
return _regenerator2.default.wrap(function
|
|
1419
|
+
return _regenerator2.default.wrap(function _callee23$(_context23) {
|
|
1496
1420
|
while (1) {
|
|
1497
|
-
switch (
|
|
1421
|
+
switch (_context23.prev = _context23.next) {
|
|
1498
1422
|
case 0:
|
|
1499
1423
|
_comoData13 = this.comoData, env = _comoData13.env_params, locationId = _comoData13.locationId, api = _comoData13.api;
|
|
1500
|
-
|
|
1424
|
+
_context23.next = 3;
|
|
1501
1425
|
return api.purchaseAsset(env.zapp_root, locationId, itemId);
|
|
1502
1426
|
|
|
1503
1427
|
case 3:
|
|
1504
|
-
responseJson =
|
|
1505
|
-
return
|
|
1428
|
+
responseJson = _context23.sent;
|
|
1429
|
+
return _context23.abrupt('return', responseJson);
|
|
1506
1430
|
|
|
1507
1431
|
case 5:
|
|
1508
1432
|
case 'end':
|
|
1509
|
-
return
|
|
1433
|
+
return _context23.stop();
|
|
1510
1434
|
}
|
|
1511
1435
|
}
|
|
1512
|
-
},
|
|
1436
|
+
}, _callee23, this);
|
|
1513
1437
|
}));
|
|
1514
1438
|
|
|
1515
|
-
function purchaseAsset(
|
|
1516
|
-
return
|
|
1439
|
+
function purchaseAsset(_x50) {
|
|
1440
|
+
return _ref24.apply(this, arguments);
|
|
1517
1441
|
}
|
|
1518
1442
|
|
|
1519
1443
|
return purchaseAsset;
|
|
@@ -1521,31 +1445,31 @@ var Como = function () {
|
|
|
1521
1445
|
}, {
|
|
1522
1446
|
key: 'getUserPointShopDataAPI2',
|
|
1523
1447
|
value: function () {
|
|
1524
|
-
var
|
|
1448
|
+
var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee24() {
|
|
1525
1449
|
var _comoData14, env, locationId, api, responseJson;
|
|
1526
1450
|
|
|
1527
|
-
return _regenerator2.default.wrap(function
|
|
1451
|
+
return _regenerator2.default.wrap(function _callee24$(_context24) {
|
|
1528
1452
|
while (1) {
|
|
1529
|
-
switch (
|
|
1453
|
+
switch (_context24.prev = _context24.next) {
|
|
1530
1454
|
case 0:
|
|
1531
1455
|
_comoData14 = this.comoData, env = _comoData14.env_params, locationId = _comoData14.locationId, api = _comoData14.api;
|
|
1532
|
-
|
|
1456
|
+
_context24.next = 3;
|
|
1533
1457
|
return api.getUserPointShopDataAPI2(env.zapp_root, locationId);
|
|
1534
1458
|
|
|
1535
1459
|
case 3:
|
|
1536
|
-
responseJson =
|
|
1537
|
-
return
|
|
1460
|
+
responseJson = _context24.sent;
|
|
1461
|
+
return _context24.abrupt('return', responseJson);
|
|
1538
1462
|
|
|
1539
1463
|
case 5:
|
|
1540
1464
|
case 'end':
|
|
1541
|
-
return
|
|
1465
|
+
return _context24.stop();
|
|
1542
1466
|
}
|
|
1543
1467
|
}
|
|
1544
|
-
},
|
|
1468
|
+
}, _callee24, this);
|
|
1545
1469
|
}));
|
|
1546
1470
|
|
|
1547
1471
|
function getUserPointShopDataAPI2() {
|
|
1548
|
-
return
|
|
1472
|
+
return _ref25.apply(this, arguments);
|
|
1549
1473
|
}
|
|
1550
1474
|
|
|
1551
1475
|
return getUserPointShopDataAPI2;
|
|
@@ -1553,31 +1477,31 @@ var Como = function () {
|
|
|
1553
1477
|
}, {
|
|
1554
1478
|
key: 'purchaseAssetAPI2',
|
|
1555
1479
|
value: function () {
|
|
1556
|
-
var
|
|
1480
|
+
var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee25(assetID) {
|
|
1557
1481
|
var _comoData15, env, locationId, api, responseJson;
|
|
1558
1482
|
|
|
1559
|
-
return _regenerator2.default.wrap(function
|
|
1483
|
+
return _regenerator2.default.wrap(function _callee25$(_context25) {
|
|
1560
1484
|
while (1) {
|
|
1561
|
-
switch (
|
|
1485
|
+
switch (_context25.prev = _context25.next) {
|
|
1562
1486
|
case 0:
|
|
1563
1487
|
_comoData15 = this.comoData, env = _comoData15.env_params, locationId = _comoData15.locationId, api = _comoData15.api;
|
|
1564
|
-
|
|
1488
|
+
_context25.next = 3;
|
|
1565
1489
|
return api.purchaseAssetAPI2(env.zapp_root, locationId, assetID);
|
|
1566
1490
|
|
|
1567
1491
|
case 3:
|
|
1568
|
-
responseJson =
|
|
1569
|
-
return
|
|
1492
|
+
responseJson = _context25.sent;
|
|
1493
|
+
return _context25.abrupt('return', responseJson);
|
|
1570
1494
|
|
|
1571
1495
|
case 5:
|
|
1572
1496
|
case 'end':
|
|
1573
|
-
return
|
|
1497
|
+
return _context25.stop();
|
|
1574
1498
|
}
|
|
1575
1499
|
}
|
|
1576
|
-
},
|
|
1500
|
+
}, _callee25, this);
|
|
1577
1501
|
}));
|
|
1578
1502
|
|
|
1579
|
-
function purchaseAssetAPI2(
|
|
1580
|
-
return
|
|
1503
|
+
function purchaseAssetAPI2(_x51) {
|
|
1504
|
+
return _ref26.apply(this, arguments);
|
|
1581
1505
|
}
|
|
1582
1506
|
|
|
1583
1507
|
return purchaseAssetAPI2;
|
|
@@ -1591,32 +1515,32 @@ var Como = function () {
|
|
|
1591
1515
|
}, {
|
|
1592
1516
|
key: 'reloadAssets',
|
|
1593
1517
|
value: function () {
|
|
1594
|
-
var
|
|
1518
|
+
var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee26() {
|
|
1595
1519
|
var _comoData16, env, locationId, api, responseJson;
|
|
1596
1520
|
|
|
1597
|
-
return _regenerator2.default.wrap(function
|
|
1521
|
+
return _regenerator2.default.wrap(function _callee26$(_context26) {
|
|
1598
1522
|
while (1) {
|
|
1599
|
-
switch (
|
|
1523
|
+
switch (_context26.prev = _context26.next) {
|
|
1600
1524
|
case 0:
|
|
1601
1525
|
_comoData16 = this.comoData, env = _comoData16.env_params, locationId = _comoData16.locationId, api = _comoData16.api;
|
|
1602
|
-
|
|
1526
|
+
_context26.next = 3;
|
|
1603
1527
|
return api.memberAssets(env.services_root, locationId);
|
|
1604
1528
|
|
|
1605
1529
|
case 3:
|
|
1606
|
-
responseJson =
|
|
1530
|
+
responseJson = _context26.sent;
|
|
1607
1531
|
|
|
1608
1532
|
this.comoData.assets = responseJson;
|
|
1609
1533
|
|
|
1610
1534
|
case 5:
|
|
1611
1535
|
case 'end':
|
|
1612
|
-
return
|
|
1536
|
+
return _context26.stop();
|
|
1613
1537
|
}
|
|
1614
1538
|
}
|
|
1615
|
-
},
|
|
1539
|
+
}, _callee26, this);
|
|
1616
1540
|
}));
|
|
1617
1541
|
|
|
1618
1542
|
function reloadAssets() {
|
|
1619
|
-
return
|
|
1543
|
+
return _ref27.apply(this, arguments);
|
|
1620
1544
|
}
|
|
1621
1545
|
|
|
1622
1546
|
return reloadAssets;
|
|
@@ -1664,16 +1588,16 @@ var Como = function () {
|
|
|
1664
1588
|
}, {
|
|
1665
1589
|
key: 'downloadMainResources',
|
|
1666
1590
|
value: function () {
|
|
1667
|
-
var
|
|
1591
|
+
var _ref28 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee27() {
|
|
1668
1592
|
var resources, downloadMainResource, downloads;
|
|
1669
|
-
return _regenerator2.default.wrap(function
|
|
1593
|
+
return _regenerator2.default.wrap(function _callee27$(_context27) {
|
|
1670
1594
|
while (1) {
|
|
1671
|
-
switch (
|
|
1595
|
+
switch (_context27.prev = _context27.next) {
|
|
1672
1596
|
case 0:
|
|
1673
1597
|
resources = ['LocationData', 'Menu', 'Updates', 'TCAlts', 'AppTexts', 'DefaultAppTexts'];
|
|
1674
1598
|
downloadMainResource = this.downloadMainResource.bind(this);
|
|
1675
1599
|
downloads = resources.map(downloadMainResource);
|
|
1676
|
-
|
|
1600
|
+
_context27.next = 5;
|
|
1677
1601
|
return _promise2.default.all(downloads);
|
|
1678
1602
|
|
|
1679
1603
|
case 5:
|
|
@@ -1681,14 +1605,14 @@ var Como = function () {
|
|
|
1681
1605
|
|
|
1682
1606
|
case 6:
|
|
1683
1607
|
case 'end':
|
|
1684
|
-
return
|
|
1608
|
+
return _context27.stop();
|
|
1685
1609
|
}
|
|
1686
1610
|
}
|
|
1687
|
-
},
|
|
1611
|
+
}, _callee27, this);
|
|
1688
1612
|
}));
|
|
1689
1613
|
|
|
1690
1614
|
function downloadMainResources() {
|
|
1691
|
-
return
|
|
1615
|
+
return _ref28.apply(this, arguments);
|
|
1692
1616
|
}
|
|
1693
1617
|
|
|
1694
1618
|
return downloadMainResources;
|
|
@@ -1863,27 +1787,27 @@ var Como = function () {
|
|
|
1863
1787
|
}, {
|
|
1864
1788
|
key: 'getRecaptchaConfig',
|
|
1865
1789
|
value: function () {
|
|
1866
|
-
var
|
|
1867
|
-
return _regenerator2.default.wrap(function
|
|
1790
|
+
var _ref29 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee28() {
|
|
1791
|
+
return _regenerator2.default.wrap(function _callee28$(_context28) {
|
|
1868
1792
|
while (1) {
|
|
1869
|
-
switch (
|
|
1793
|
+
switch (_context28.prev = _context28.next) {
|
|
1870
1794
|
case 0:
|
|
1871
|
-
|
|
1795
|
+
_context28.next = 2;
|
|
1872
1796
|
return this.refreshTokenIfNeeded();
|
|
1873
1797
|
|
|
1874
1798
|
case 2:
|
|
1875
|
-
return
|
|
1799
|
+
return _context28.abrupt('return', this.comoData.recaptchaConfig);
|
|
1876
1800
|
|
|
1877
1801
|
case 3:
|
|
1878
1802
|
case 'end':
|
|
1879
|
-
return
|
|
1803
|
+
return _context28.stop();
|
|
1880
1804
|
}
|
|
1881
1805
|
}
|
|
1882
|
-
},
|
|
1806
|
+
}, _callee28, this);
|
|
1883
1807
|
}));
|
|
1884
1808
|
|
|
1885
1809
|
function getRecaptchaConfig() {
|
|
1886
|
-
return
|
|
1810
|
+
return _ref29.apply(this, arguments);
|
|
1887
1811
|
}
|
|
1888
1812
|
|
|
1889
1813
|
return getRecaptchaConfig;
|
|
@@ -1896,33 +1820,33 @@ var Como = function () {
|
|
|
1896
1820
|
}, {
|
|
1897
1821
|
key: 'getRegistrationUrl',
|
|
1898
1822
|
value: function () {
|
|
1899
|
-
var
|
|
1823
|
+
var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee29(overrides) {
|
|
1900
1824
|
var _comoData24, token, installationId, locationId, env;
|
|
1901
1825
|
|
|
1902
|
-
return _regenerator2.default.wrap(function
|
|
1826
|
+
return _regenerator2.default.wrap(function _callee29$(_context29) {
|
|
1903
1827
|
while (1) {
|
|
1904
|
-
switch (
|
|
1828
|
+
switch (_context29.prev = _context29.next) {
|
|
1905
1829
|
case 0:
|
|
1906
|
-
|
|
1830
|
+
_context29.next = 2;
|
|
1907
1831
|
return this.refreshTokenIfNeeded();
|
|
1908
1832
|
|
|
1909
1833
|
case 2:
|
|
1910
1834
|
_comoData24 = this.comoData, token = _comoData24.token, installationId = _comoData24.installationId, locationId = _comoData24.locationId, env = _comoData24.env_params;
|
|
1911
|
-
return
|
|
1835
|
+
return _context29.abrupt('return', urlsUtils.appendQuery(env.app_modules_root + '/register?token=' + token + '&locationid=' + locationId, (0, _extends3.default)({}, this.getCredentials(), {
|
|
1912
1836
|
installationId: installationId,
|
|
1913
1837
|
disableSuccessScreen: 'true'
|
|
1914
1838
|
}, overrides)));
|
|
1915
1839
|
|
|
1916
1840
|
case 4:
|
|
1917
1841
|
case 'end':
|
|
1918
|
-
return
|
|
1842
|
+
return _context29.stop();
|
|
1919
1843
|
}
|
|
1920
1844
|
}
|
|
1921
|
-
},
|
|
1845
|
+
}, _callee29, this);
|
|
1922
1846
|
}));
|
|
1923
1847
|
|
|
1924
|
-
function getRegistrationUrl(
|
|
1925
|
-
return
|
|
1848
|
+
function getRegistrationUrl(_x52) {
|
|
1849
|
+
return _ref30.apply(this, arguments);
|
|
1926
1850
|
}
|
|
1927
1851
|
|
|
1928
1852
|
return getRegistrationUrl;
|
|
@@ -1935,33 +1859,33 @@ var Como = function () {
|
|
|
1935
1859
|
}, {
|
|
1936
1860
|
key: 'getProfileUrl',
|
|
1937
1861
|
value: function () {
|
|
1938
|
-
var
|
|
1862
|
+
var _ref31 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee30(overrides) {
|
|
1939
1863
|
var _comoData25, token, installationId, locationId, env;
|
|
1940
1864
|
|
|
1941
|
-
return _regenerator2.default.wrap(function
|
|
1865
|
+
return _regenerator2.default.wrap(function _callee30$(_context30) {
|
|
1942
1866
|
while (1) {
|
|
1943
|
-
switch (
|
|
1867
|
+
switch (_context30.prev = _context30.next) {
|
|
1944
1868
|
case 0:
|
|
1945
|
-
|
|
1869
|
+
_context30.next = 2;
|
|
1946
1870
|
return this.refreshTokenIfNeeded();
|
|
1947
1871
|
|
|
1948
1872
|
case 2:
|
|
1949
1873
|
_comoData25 = this.comoData, token = _comoData25.token, installationId = _comoData25.installationId, locationId = _comoData25.locationId, env = _comoData25.env_params;
|
|
1950
|
-
return
|
|
1874
|
+
return _context30.abrupt('return', urlsUtils.appendQuery(env.app_modules_root + '/profile?token=' + token + '&locationid=' + locationId, (0, _extends3.default)({}, this.getCredentials(), {
|
|
1951
1875
|
installationId: installationId,
|
|
1952
1876
|
disableSuccessScreen: 'true'
|
|
1953
1877
|
}, overrides)));
|
|
1954
1878
|
|
|
1955
1879
|
case 4:
|
|
1956
1880
|
case 'end':
|
|
1957
|
-
return
|
|
1881
|
+
return _context30.stop();
|
|
1958
1882
|
}
|
|
1959
1883
|
}
|
|
1960
|
-
},
|
|
1884
|
+
}, _callee30, this);
|
|
1961
1885
|
}));
|
|
1962
1886
|
|
|
1963
|
-
function getProfileUrl(
|
|
1964
|
-
return
|
|
1887
|
+
function getProfileUrl(_x53) {
|
|
1888
|
+
return _ref31.apply(this, arguments);
|
|
1965
1889
|
}
|
|
1966
1890
|
|
|
1967
1891
|
return getProfileUrl;
|
|
@@ -1974,30 +1898,30 @@ var Como = function () {
|
|
|
1974
1898
|
}, {
|
|
1975
1899
|
key: 'getLoginUrl',
|
|
1976
1900
|
value: function () {
|
|
1977
|
-
var
|
|
1901
|
+
var _ref32 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee31() {
|
|
1978
1902
|
var _comoData26, token, locationId, env;
|
|
1979
1903
|
|
|
1980
|
-
return _regenerator2.default.wrap(function
|
|
1904
|
+
return _regenerator2.default.wrap(function _callee31$(_context31) {
|
|
1981
1905
|
while (1) {
|
|
1982
|
-
switch (
|
|
1906
|
+
switch (_context31.prev = _context31.next) {
|
|
1983
1907
|
case 0:
|
|
1984
|
-
|
|
1908
|
+
_context31.next = 2;
|
|
1985
1909
|
return this.refreshTokenIfNeeded();
|
|
1986
1910
|
|
|
1987
1911
|
case 2:
|
|
1988
1912
|
_comoData26 = this.comoData, token = _comoData26.token, locationId = _comoData26.locationId, env = _comoData26.env_params;
|
|
1989
|
-
return
|
|
1913
|
+
return _context31.abrupt('return', env.app_modules_root + '/login?token=' + token + '&locationid=' + locationId);
|
|
1990
1914
|
|
|
1991
1915
|
case 4:
|
|
1992
1916
|
case 'end':
|
|
1993
|
-
return
|
|
1917
|
+
return _context31.stop();
|
|
1994
1918
|
}
|
|
1995
1919
|
}
|
|
1996
|
-
},
|
|
1920
|
+
}, _callee31, this);
|
|
1997
1921
|
}));
|
|
1998
1922
|
|
|
1999
1923
|
function getLoginUrl() {
|
|
2000
|
-
return
|
|
1924
|
+
return _ref32.apply(this, arguments);
|
|
2001
1925
|
}
|
|
2002
1926
|
|
|
2003
1927
|
return getLoginUrl;
|
|
@@ -2010,31 +1934,31 @@ var Como = function () {
|
|
|
2010
1934
|
}, {
|
|
2011
1935
|
key: 'getDataPortabilityUrl',
|
|
2012
1936
|
value: function () {
|
|
2013
|
-
var
|
|
1937
|
+
var _ref33 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(url, overrides) {
|
|
2014
1938
|
var installationId;
|
|
2015
|
-
return _regenerator2.default.wrap(function
|
|
1939
|
+
return _regenerator2.default.wrap(function _callee32$(_context32) {
|
|
2016
1940
|
while (1) {
|
|
2017
|
-
switch (
|
|
1941
|
+
switch (_context32.prev = _context32.next) {
|
|
2018
1942
|
case 0:
|
|
2019
|
-
|
|
1943
|
+
_context32.next = 2;
|
|
2020
1944
|
return this.refreshTokenIfNeeded();
|
|
2021
1945
|
|
|
2022
1946
|
case 2:
|
|
2023
1947
|
installationId = this.comoData.installationId;
|
|
2024
|
-
return
|
|
1948
|
+
return _context32.abrupt('return', urlsUtils.appendQuery('' + url, (0, _extends3.default)({
|
|
2025
1949
|
installationId: installationId
|
|
2026
1950
|
}, overrides)));
|
|
2027
1951
|
|
|
2028
1952
|
case 4:
|
|
2029
1953
|
case 'end':
|
|
2030
|
-
return
|
|
1954
|
+
return _context32.stop();
|
|
2031
1955
|
}
|
|
2032
1956
|
}
|
|
2033
|
-
},
|
|
1957
|
+
}, _callee32, this);
|
|
2034
1958
|
}));
|
|
2035
1959
|
|
|
2036
|
-
function getDataPortabilityUrl(
|
|
2037
|
-
return
|
|
1960
|
+
function getDataPortabilityUrl(_x54, _x55) {
|
|
1961
|
+
return _ref33.apply(this, arguments);
|
|
2038
1962
|
}
|
|
2039
1963
|
|
|
2040
1964
|
return getDataPortabilityUrl;
|
|
@@ -2047,29 +1971,29 @@ var Como = function () {
|
|
|
2047
1971
|
}, {
|
|
2048
1972
|
key: 'getAppModulesLegacyBaseUrl',
|
|
2049
1973
|
value: function () {
|
|
2050
|
-
var
|
|
1974
|
+
var _ref34 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee33() {
|
|
2051
1975
|
var env;
|
|
2052
|
-
return _regenerator2.default.wrap(function
|
|
1976
|
+
return _regenerator2.default.wrap(function _callee33$(_context33) {
|
|
2053
1977
|
while (1) {
|
|
2054
|
-
switch (
|
|
1978
|
+
switch (_context33.prev = _context33.next) {
|
|
2055
1979
|
case 0:
|
|
2056
|
-
|
|
1980
|
+
_context33.next = 2;
|
|
2057
1981
|
return this.refreshTokenIfNeeded();
|
|
2058
1982
|
|
|
2059
1983
|
case 2:
|
|
2060
1984
|
env = this.comoData.env_params;
|
|
2061
|
-
return
|
|
1985
|
+
return _context33.abrupt('return', '' + env.app_modules_legacy_root);
|
|
2062
1986
|
|
|
2063
1987
|
case 4:
|
|
2064
1988
|
case 'end':
|
|
2065
|
-
return
|
|
1989
|
+
return _context33.stop();
|
|
2066
1990
|
}
|
|
2067
1991
|
}
|
|
2068
|
-
},
|
|
1992
|
+
}, _callee33, this);
|
|
2069
1993
|
}));
|
|
2070
1994
|
|
|
2071
1995
|
function getAppModulesLegacyBaseUrl() {
|
|
2072
|
-
return
|
|
1996
|
+
return _ref34.apply(this, arguments);
|
|
2073
1997
|
}
|
|
2074
1998
|
|
|
2075
1999
|
return getAppModulesLegacyBaseUrl;
|
|
@@ -2087,7 +2011,7 @@ var Como = function () {
|
|
|
2087
2011
|
locationId = _comoData27.locationId;
|
|
2088
2012
|
|
|
2089
2013
|
var cpBaseUrl = env.cp_base_url.replace('{location_id}', locationId);
|
|
2090
|
-
return cpBaseUrl + '/auth/
|
|
2014
|
+
return cpBaseUrl + '/auth/signin?onboardingflow=register&ReferralCode=' + referral;
|
|
2091
2015
|
}
|
|
2092
2016
|
|
|
2093
2017
|
/**
|
|
@@ -2171,26 +2095,26 @@ var Como = function () {
|
|
|
2171
2095
|
}, {
|
|
2172
2096
|
key: 'getRegionConfig',
|
|
2173
2097
|
value: function () {
|
|
2174
|
-
var
|
|
2098
|
+
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee34() {
|
|
2175
2099
|
var _comoData30, api, locationId, env;
|
|
2176
2100
|
|
|
2177
|
-
return _regenerator2.default.wrap(function
|
|
2101
|
+
return _regenerator2.default.wrap(function _callee34$(_context34) {
|
|
2178
2102
|
while (1) {
|
|
2179
|
-
switch (
|
|
2103
|
+
switch (_context34.prev = _context34.next) {
|
|
2180
2104
|
case 0:
|
|
2181
2105
|
_comoData30 = this.comoData, api = _comoData30.api, locationId = _comoData30.locationId, env = _comoData30.env_params;
|
|
2182
|
-
return
|
|
2106
|
+
return _context34.abrupt('return', api.getClientBusinessBackend(env.zapp_root, locationId));
|
|
2183
2107
|
|
|
2184
2108
|
case 2:
|
|
2185
2109
|
case 'end':
|
|
2186
|
-
return
|
|
2110
|
+
return _context34.stop();
|
|
2187
2111
|
}
|
|
2188
2112
|
}
|
|
2189
|
-
},
|
|
2113
|
+
}, _callee34, this);
|
|
2190
2114
|
}));
|
|
2191
2115
|
|
|
2192
2116
|
function getRegionConfig() {
|
|
2193
|
-
return
|
|
2117
|
+
return _ref35.apply(this, arguments);
|
|
2194
2118
|
}
|
|
2195
2119
|
|
|
2196
2120
|
return getRegionConfig;
|
|
@@ -2213,26 +2137,26 @@ var Como = function () {
|
|
|
2213
2137
|
}, {
|
|
2214
2138
|
key: 'addPaymentMethod',
|
|
2215
2139
|
value: function () {
|
|
2216
|
-
var
|
|
2140
|
+
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee35(cardToken) {
|
|
2217
2141
|
var _comoData32, api, locationId, token, env;
|
|
2218
2142
|
|
|
2219
|
-
return _regenerator2.default.wrap(function
|
|
2143
|
+
return _regenerator2.default.wrap(function _callee35$(_context35) {
|
|
2220
2144
|
while (1) {
|
|
2221
|
-
switch (
|
|
2145
|
+
switch (_context35.prev = _context35.next) {
|
|
2222
2146
|
case 0:
|
|
2223
2147
|
_comoData32 = this.comoData, api = _comoData32.api, locationId = _comoData32.locationId, token = _comoData32.token, env = _comoData32.env_params;
|
|
2224
|
-
return
|
|
2148
|
+
return _context35.abrupt('return', api.addPaymentMethod(env.services_root, locationId, token, cardToken));
|
|
2225
2149
|
|
|
2226
2150
|
case 2:
|
|
2227
2151
|
case 'end':
|
|
2228
|
-
return
|
|
2152
|
+
return _context35.stop();
|
|
2229
2153
|
}
|
|
2230
2154
|
}
|
|
2231
|
-
},
|
|
2155
|
+
}, _callee35, this);
|
|
2232
2156
|
}));
|
|
2233
2157
|
|
|
2234
|
-
function addPaymentMethod(
|
|
2235
|
-
return
|
|
2158
|
+
function addPaymentMethod(_x57) {
|
|
2159
|
+
return _ref36.apply(this, arguments);
|
|
2236
2160
|
}
|
|
2237
2161
|
|
|
2238
2162
|
return addPaymentMethod;
|
|
@@ -2240,26 +2164,26 @@ var Como = function () {
|
|
|
2240
2164
|
}, {
|
|
2241
2165
|
key: 'knowYourData',
|
|
2242
2166
|
value: function () {
|
|
2243
|
-
var
|
|
2167
|
+
var _ref37 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee36(email) {
|
|
2244
2168
|
var _comoData33, api, locationId, env;
|
|
2245
2169
|
|
|
2246
|
-
return _regenerator2.default.wrap(function
|
|
2170
|
+
return _regenerator2.default.wrap(function _callee36$(_context36) {
|
|
2247
2171
|
while (1) {
|
|
2248
|
-
switch (
|
|
2172
|
+
switch (_context36.prev = _context36.next) {
|
|
2249
2173
|
case 0:
|
|
2250
2174
|
_comoData33 = this.comoData, api = _comoData33.api, locationId = _comoData33.locationId, env = _comoData33.env_params;
|
|
2251
|
-
return
|
|
2175
|
+
return _context36.abrupt('return', api.knowYourData(env.services_root, locationId, email));
|
|
2252
2176
|
|
|
2253
2177
|
case 2:
|
|
2254
2178
|
case 'end':
|
|
2255
|
-
return
|
|
2179
|
+
return _context36.stop();
|
|
2256
2180
|
}
|
|
2257
2181
|
}
|
|
2258
|
-
},
|
|
2182
|
+
}, _callee36, this);
|
|
2259
2183
|
}));
|
|
2260
2184
|
|
|
2261
|
-
function knowYourData(
|
|
2262
|
-
return
|
|
2185
|
+
function knowYourData(_x58) {
|
|
2186
|
+
return _ref37.apply(this, arguments);
|
|
2263
2187
|
}
|
|
2264
2188
|
|
|
2265
2189
|
return knowYourData;
|
|
@@ -2267,26 +2191,26 @@ var Como = function () {
|
|
|
2267
2191
|
}, {
|
|
2268
2192
|
key: 'consentWithdraw',
|
|
2269
2193
|
value: function () {
|
|
2270
|
-
var
|
|
2194
|
+
var _ref38 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee37(consentData) {
|
|
2271
2195
|
var _comoData34, api, locationId, env;
|
|
2272
2196
|
|
|
2273
|
-
return _regenerator2.default.wrap(function
|
|
2197
|
+
return _regenerator2.default.wrap(function _callee37$(_context37) {
|
|
2274
2198
|
while (1) {
|
|
2275
|
-
switch (
|
|
2199
|
+
switch (_context37.prev = _context37.next) {
|
|
2276
2200
|
case 0:
|
|
2277
2201
|
_comoData34 = this.comoData, api = _comoData34.api, locationId = _comoData34.locationId, env = _comoData34.env_params;
|
|
2278
|
-
return
|
|
2202
|
+
return _context37.abrupt('return', api.consentWithdraw(env.services_root, locationId, consentData));
|
|
2279
2203
|
|
|
2280
2204
|
case 2:
|
|
2281
2205
|
case 'end':
|
|
2282
|
-
return
|
|
2206
|
+
return _context37.stop();
|
|
2283
2207
|
}
|
|
2284
2208
|
}
|
|
2285
|
-
},
|
|
2209
|
+
}, _callee37, this);
|
|
2286
2210
|
}));
|
|
2287
2211
|
|
|
2288
|
-
function consentWithdraw(
|
|
2289
|
-
return
|
|
2212
|
+
function consentWithdraw(_x59) {
|
|
2213
|
+
return _ref38.apply(this, arguments);
|
|
2290
2214
|
}
|
|
2291
2215
|
|
|
2292
2216
|
return consentWithdraw;
|
|
@@ -2294,31 +2218,31 @@ var Como = function () {
|
|
|
2294
2218
|
}, {
|
|
2295
2219
|
key: 'getPaymentMethods',
|
|
2296
2220
|
value: function () {
|
|
2297
|
-
var
|
|
2221
|
+
var _ref39 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee38() {
|
|
2298
2222
|
var _comoData35, env, locationId, api, responseJson;
|
|
2299
2223
|
|
|
2300
|
-
return _regenerator2.default.wrap(function
|
|
2224
|
+
return _regenerator2.default.wrap(function _callee38$(_context38) {
|
|
2301
2225
|
while (1) {
|
|
2302
|
-
switch (
|
|
2226
|
+
switch (_context38.prev = _context38.next) {
|
|
2303
2227
|
case 0:
|
|
2304
2228
|
_comoData35 = this.comoData, env = _comoData35.env_params, locationId = _comoData35.locationId, api = _comoData35.api;
|
|
2305
|
-
|
|
2229
|
+
_context38.next = 3;
|
|
2306
2230
|
return api.getPaymentMethods(env.services_root, locationId);
|
|
2307
2231
|
|
|
2308
2232
|
case 3:
|
|
2309
|
-
responseJson =
|
|
2310
|
-
return
|
|
2233
|
+
responseJson = _context38.sent;
|
|
2234
|
+
return _context38.abrupt('return', responseJson);
|
|
2311
2235
|
|
|
2312
2236
|
case 5:
|
|
2313
2237
|
case 'end':
|
|
2314
|
-
return
|
|
2238
|
+
return _context38.stop();
|
|
2315
2239
|
}
|
|
2316
2240
|
}
|
|
2317
|
-
},
|
|
2241
|
+
}, _callee38, this);
|
|
2318
2242
|
}));
|
|
2319
2243
|
|
|
2320
2244
|
function getPaymentMethods() {
|
|
2321
|
-
return
|
|
2245
|
+
return _ref39.apply(this, arguments);
|
|
2322
2246
|
}
|
|
2323
2247
|
|
|
2324
2248
|
return getPaymentMethods;
|
|
@@ -2335,31 +2259,31 @@ var Como = function () {
|
|
|
2335
2259
|
}, {
|
|
2336
2260
|
key: 'payInApp',
|
|
2337
2261
|
value: function () {
|
|
2338
|
-
var
|
|
2262
|
+
var _ref40 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee39(amount, creditCardToken, itemName, itemNumber, membershipKey) {
|
|
2339
2263
|
var _comoData36, env, token, locationId, api, responseJson;
|
|
2340
2264
|
|
|
2341
|
-
return _regenerator2.default.wrap(function
|
|
2265
|
+
return _regenerator2.default.wrap(function _callee39$(_context39) {
|
|
2342
2266
|
while (1) {
|
|
2343
|
-
switch (
|
|
2267
|
+
switch (_context39.prev = _context39.next) {
|
|
2344
2268
|
case 0:
|
|
2345
2269
|
_comoData36 = this.comoData, env = _comoData36.env_params, token = _comoData36.token, locationId = _comoData36.locationId, api = _comoData36.api;
|
|
2346
|
-
|
|
2270
|
+
_context39.next = 3;
|
|
2347
2271
|
return api.payInApp(env.services_root, locationId, token, amount, creditCardToken, itemName, itemNumber, membershipKey);
|
|
2348
2272
|
|
|
2349
2273
|
case 3:
|
|
2350
|
-
responseJson =
|
|
2351
|
-
return
|
|
2274
|
+
responseJson = _context39.sent;
|
|
2275
|
+
return _context39.abrupt('return', responseJson);
|
|
2352
2276
|
|
|
2353
2277
|
case 5:
|
|
2354
2278
|
case 'end':
|
|
2355
|
-
return
|
|
2279
|
+
return _context39.stop();
|
|
2356
2280
|
}
|
|
2357
2281
|
}
|
|
2358
|
-
},
|
|
2282
|
+
}, _callee39, this);
|
|
2359
2283
|
}));
|
|
2360
2284
|
|
|
2361
|
-
function payInApp(
|
|
2362
|
-
return
|
|
2285
|
+
function payInApp(_x60, _x61, _x62, _x63, _x64) {
|
|
2286
|
+
return _ref40.apply(this, arguments);
|
|
2363
2287
|
}
|
|
2364
2288
|
|
|
2365
2289
|
return payInApp;
|
|
@@ -2372,31 +2296,31 @@ var Como = function () {
|
|
|
2372
2296
|
}, {
|
|
2373
2297
|
key: 'deletePayment',
|
|
2374
2298
|
value: function () {
|
|
2375
|
-
var
|
|
2299
|
+
var _ref41 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee40(creditCardToken) {
|
|
2376
2300
|
var _comoData37, env, token, locationId, api, responseJson;
|
|
2377
2301
|
|
|
2378
|
-
return _regenerator2.default.wrap(function
|
|
2302
|
+
return _regenerator2.default.wrap(function _callee40$(_context40) {
|
|
2379
2303
|
while (1) {
|
|
2380
|
-
switch (
|
|
2304
|
+
switch (_context40.prev = _context40.next) {
|
|
2381
2305
|
case 0:
|
|
2382
2306
|
_comoData37 = this.comoData, env = _comoData37.env_params, token = _comoData37.token, locationId = _comoData37.locationId, api = _comoData37.api;
|
|
2383
|
-
|
|
2307
|
+
_context40.next = 3;
|
|
2384
2308
|
return api.deletePayment(env.services_root, locationId, token, creditCardToken);
|
|
2385
2309
|
|
|
2386
2310
|
case 3:
|
|
2387
|
-
responseJson =
|
|
2388
|
-
return
|
|
2311
|
+
responseJson = _context40.sent;
|
|
2312
|
+
return _context40.abrupt('return', responseJson);
|
|
2389
2313
|
|
|
2390
2314
|
case 5:
|
|
2391
2315
|
case 'end':
|
|
2392
|
-
return
|
|
2316
|
+
return _context40.stop();
|
|
2393
2317
|
}
|
|
2394
2318
|
}
|
|
2395
|
-
},
|
|
2319
|
+
}, _callee40, this);
|
|
2396
2320
|
}));
|
|
2397
2321
|
|
|
2398
|
-
function deletePayment(
|
|
2399
|
-
return
|
|
2322
|
+
function deletePayment(_x65) {
|
|
2323
|
+
return _ref41.apply(this, arguments);
|
|
2400
2324
|
}
|
|
2401
2325
|
|
|
2402
2326
|
return deletePayment;
|
|
@@ -2408,32 +2332,32 @@ var Como = function () {
|
|
|
2408
2332
|
}, {
|
|
2409
2333
|
key: 'getMemberMessages',
|
|
2410
2334
|
value: function () {
|
|
2411
|
-
var
|
|
2335
|
+
var _ref42 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee41(tag, limit, offset) {
|
|
2412
2336
|
var fetchExpiredMessages = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
2413
2337
|
|
|
2414
2338
|
var _comoData38, api, locationId, env;
|
|
2415
2339
|
|
|
2416
|
-
return _regenerator2.default.wrap(function
|
|
2340
|
+
return _regenerator2.default.wrap(function _callee41$(_context41) {
|
|
2417
2341
|
while (1) {
|
|
2418
|
-
switch (
|
|
2342
|
+
switch (_context41.prev = _context41.next) {
|
|
2419
2343
|
case 0:
|
|
2420
2344
|
_comoData38 = this.comoData, api = _comoData38.api, locationId = _comoData38.locationId, env = _comoData38.env_params;
|
|
2421
|
-
|
|
2345
|
+
_context41.next = 3;
|
|
2422
2346
|
return this.refreshTokenIfNeeded();
|
|
2423
2347
|
|
|
2424
2348
|
case 3:
|
|
2425
|
-
return
|
|
2349
|
+
return _context41.abrupt('return', api.getMemberMessages(env.services_root, locationId, tag, limit, offset, fetchExpiredMessages));
|
|
2426
2350
|
|
|
2427
2351
|
case 4:
|
|
2428
2352
|
case 'end':
|
|
2429
|
-
return
|
|
2353
|
+
return _context41.stop();
|
|
2430
2354
|
}
|
|
2431
2355
|
}
|
|
2432
|
-
},
|
|
2356
|
+
}, _callee41, this);
|
|
2433
2357
|
}));
|
|
2434
2358
|
|
|
2435
|
-
function getMemberMessages(
|
|
2436
|
-
return
|
|
2359
|
+
function getMemberMessages(_x66, _x67, _x68) {
|
|
2360
|
+
return _ref42.apply(this, arguments);
|
|
2437
2361
|
}
|
|
2438
2362
|
|
|
2439
2363
|
return getMemberMessages;
|
|
@@ -2464,26 +2388,26 @@ var Como = function () {
|
|
|
2464
2388
|
}, {
|
|
2465
2389
|
key: 'budgetTransfer',
|
|
2466
2390
|
value: function () {
|
|
2467
|
-
var
|
|
2391
|
+
var _ref43 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee42(receiver, sender, amount, wallet) {
|
|
2468
2392
|
var _comoData40, api, locationId, env;
|
|
2469
2393
|
|
|
2470
|
-
return _regenerator2.default.wrap(function
|
|
2394
|
+
return _regenerator2.default.wrap(function _callee42$(_context42) {
|
|
2471
2395
|
while (1) {
|
|
2472
|
-
switch (
|
|
2396
|
+
switch (_context42.prev = _context42.next) {
|
|
2473
2397
|
case 0:
|
|
2474
2398
|
_comoData40 = this.comoData, api = _comoData40.api, locationId = _comoData40.locationId, env = _comoData40.env_params;
|
|
2475
|
-
return
|
|
2399
|
+
return _context42.abrupt('return', api.budgetTransfer(env.services_root, locationId, receiver, sender, amount, wallet));
|
|
2476
2400
|
|
|
2477
2401
|
case 2:
|
|
2478
2402
|
case 'end':
|
|
2479
|
-
return
|
|
2403
|
+
return _context42.stop();
|
|
2480
2404
|
}
|
|
2481
2405
|
}
|
|
2482
|
-
},
|
|
2406
|
+
}, _callee42, this);
|
|
2483
2407
|
}));
|
|
2484
2408
|
|
|
2485
|
-
function budgetTransfer(
|
|
2486
|
-
return
|
|
2409
|
+
function budgetTransfer(_x70, _x71, _x72, _x73) {
|
|
2410
|
+
return _ref43.apply(this, arguments);
|
|
2487
2411
|
}
|
|
2488
2412
|
|
|
2489
2413
|
return budgetTransfer;
|
|
@@ -2510,26 +2434,26 @@ var Como = function () {
|
|
|
2510
2434
|
}, {
|
|
2511
2435
|
key: 'budgetTransferClaim',
|
|
2512
2436
|
value: function () {
|
|
2513
|
-
var
|
|
2437
|
+
var _ref44 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee43(claimCode) {
|
|
2514
2438
|
var _comoData42, api, locationId, env;
|
|
2515
2439
|
|
|
2516
|
-
return _regenerator2.default.wrap(function
|
|
2440
|
+
return _regenerator2.default.wrap(function _callee43$(_context43) {
|
|
2517
2441
|
while (1) {
|
|
2518
|
-
switch (
|
|
2442
|
+
switch (_context43.prev = _context43.next) {
|
|
2519
2443
|
case 0:
|
|
2520
2444
|
_comoData42 = this.comoData, api = _comoData42.api, locationId = _comoData42.locationId, env = _comoData42.env_params;
|
|
2521
|
-
return
|
|
2445
|
+
return _context43.abrupt('return', api.budgetTransferClaim(env.services_root, locationId, claimCode));
|
|
2522
2446
|
|
|
2523
2447
|
case 2:
|
|
2524
2448
|
case 'end':
|
|
2525
|
-
return
|
|
2449
|
+
return _context43.stop();
|
|
2526
2450
|
}
|
|
2527
2451
|
}
|
|
2528
|
-
},
|
|
2452
|
+
}, _callee43, this);
|
|
2529
2453
|
}));
|
|
2530
2454
|
|
|
2531
|
-
function budgetTransferClaim(
|
|
2532
|
-
return
|
|
2455
|
+
function budgetTransferClaim(_x74) {
|
|
2456
|
+
return _ref44.apply(this, arguments);
|
|
2533
2457
|
}
|
|
2534
2458
|
|
|
2535
2459
|
return budgetTransferClaim;
|
|
@@ -2562,26 +2486,26 @@ var Como = function () {
|
|
|
2562
2486
|
}, {
|
|
2563
2487
|
key: 'logUserAction',
|
|
2564
2488
|
value: function () {
|
|
2565
|
-
var
|
|
2489
|
+
var _ref45 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee44(action, logData) {
|
|
2566
2490
|
var _comoData44, env, locationId, api;
|
|
2567
2491
|
|
|
2568
|
-
return _regenerator2.default.wrap(function
|
|
2492
|
+
return _regenerator2.default.wrap(function _callee44$(_context44) {
|
|
2569
2493
|
while (1) {
|
|
2570
|
-
switch (
|
|
2494
|
+
switch (_context44.prev = _context44.next) {
|
|
2571
2495
|
case 0:
|
|
2572
2496
|
_comoData44 = this.comoData, env = _comoData44.env_params, locationId = _comoData44.locationId, api = _comoData44.api;
|
|
2573
|
-
return
|
|
2497
|
+
return _context44.abrupt('return', api.logUserAction(env.zapp_root, locationId, action, logData));
|
|
2574
2498
|
|
|
2575
2499
|
case 2:
|
|
2576
2500
|
case 'end':
|
|
2577
|
-
return
|
|
2501
|
+
return _context44.stop();
|
|
2578
2502
|
}
|
|
2579
2503
|
}
|
|
2580
|
-
},
|
|
2504
|
+
}, _callee44, this);
|
|
2581
2505
|
}));
|
|
2582
2506
|
|
|
2583
|
-
function logUserAction(
|
|
2584
|
-
return
|
|
2507
|
+
function logUserAction(_x75, _x76) {
|
|
2508
|
+
return _ref45.apply(this, arguments);
|
|
2585
2509
|
}
|
|
2586
2510
|
|
|
2587
2511
|
return logUserAction;
|
|
@@ -2596,26 +2520,26 @@ var Como = function () {
|
|
|
2596
2520
|
}, {
|
|
2597
2521
|
key: 'getPurchaseHistory',
|
|
2598
2522
|
value: function () {
|
|
2599
|
-
var
|
|
2523
|
+
var _ref46 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee45(limit, offset) {
|
|
2600
2524
|
var _comoData45, locationId, api, membership;
|
|
2601
2525
|
|
|
2602
|
-
return _regenerator2.default.wrap(function
|
|
2526
|
+
return _regenerator2.default.wrap(function _callee45$(_context45) {
|
|
2603
2527
|
while (1) {
|
|
2604
|
-
switch (
|
|
2528
|
+
switch (_context45.prev = _context45.next) {
|
|
2605
2529
|
case 0:
|
|
2606
2530
|
_comoData45 = this.comoData, locationId = _comoData45.locationId, api = _comoData45.api, membership = _comoData45.membership;
|
|
2607
|
-
return
|
|
2531
|
+
return _context45.abrupt('return', api.getPurchaseHistory(locationId, membership.Key, limit, offset));
|
|
2608
2532
|
|
|
2609
2533
|
case 2:
|
|
2610
2534
|
case 'end':
|
|
2611
|
-
return
|
|
2535
|
+
return _context45.stop();
|
|
2612
2536
|
}
|
|
2613
2537
|
}
|
|
2614
|
-
},
|
|
2538
|
+
}, _callee45, this);
|
|
2615
2539
|
}));
|
|
2616
2540
|
|
|
2617
|
-
function getPurchaseHistory(
|
|
2618
|
-
return
|
|
2541
|
+
function getPurchaseHistory(_x77, _x78) {
|
|
2542
|
+
return _ref46.apply(this, arguments);
|
|
2619
2543
|
}
|
|
2620
2544
|
|
|
2621
2545
|
return getPurchaseHistory;
|
|
@@ -2644,28 +2568,28 @@ var Como = function () {
|
|
|
2644
2568
|
}, {
|
|
2645
2569
|
key: 'generateTemporaryToken',
|
|
2646
2570
|
value: function () {
|
|
2647
|
-
var
|
|
2571
|
+
var _ref47 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee46() {
|
|
2648
2572
|
var timeToLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
|
|
2649
2573
|
|
|
2650
2574
|
var _comoData47, api, locationId, env;
|
|
2651
2575
|
|
|
2652
|
-
return _regenerator2.default.wrap(function
|
|
2576
|
+
return _regenerator2.default.wrap(function _callee46$(_context46) {
|
|
2653
2577
|
while (1) {
|
|
2654
|
-
switch (
|
|
2578
|
+
switch (_context46.prev = _context46.next) {
|
|
2655
2579
|
case 0:
|
|
2656
2580
|
_comoData47 = this.comoData, api = _comoData47.api, locationId = _comoData47.locationId, env = _comoData47.env_params;
|
|
2657
|
-
return
|
|
2581
|
+
return _context46.abrupt('return', api.generateTemporaryToken(env.services_root, locationId, timeToLive));
|
|
2658
2582
|
|
|
2659
2583
|
case 2:
|
|
2660
2584
|
case 'end':
|
|
2661
|
-
return
|
|
2585
|
+
return _context46.stop();
|
|
2662
2586
|
}
|
|
2663
2587
|
}
|
|
2664
|
-
},
|
|
2588
|
+
}, _callee46, this);
|
|
2665
2589
|
}));
|
|
2666
2590
|
|
|
2667
2591
|
function generateTemporaryToken() {
|
|
2668
|
-
return
|
|
2592
|
+
return _ref47.apply(this, arguments);
|
|
2669
2593
|
}
|
|
2670
2594
|
|
|
2671
2595
|
return generateTemporaryToken;
|