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