@como/como-client 0.8.7 → 0.8.8
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 +503 -447
- package/lib/services/auth.service.js +76 -44
- package/package.json +1 -1
- package/src/como.js +48 -28
package/lib/como.js
CHANGED
|
@@ -807,6 +807,62 @@ var Como = function () {
|
|
|
807
807
|
return unsubscribeSms;
|
|
808
808
|
}()
|
|
809
809
|
|
|
810
|
+
/**
|
|
811
|
+
*
|
|
812
|
+
* @param {string} unsubscribeWhatsapp unsubscribe user at location
|
|
813
|
+
* @param {string} PhoneNumber phone number to identify user
|
|
814
|
+
*/
|
|
815
|
+
|
|
816
|
+
}, {
|
|
817
|
+
key: 'unsubscribeWhatsapp',
|
|
818
|
+
value: function () {
|
|
819
|
+
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(PhoneNumber) {
|
|
820
|
+
var _comoData5, api, locationId, identifier, data, _error$response$data7, code, message;
|
|
821
|
+
|
|
822
|
+
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
|
823
|
+
while (1) {
|
|
824
|
+
switch (_context11.prev = _context11.next) {
|
|
825
|
+
case 0:
|
|
826
|
+
_comoData5 = this.comoData, api = _comoData5.api, locationId = _comoData5.locationId;
|
|
827
|
+
_context11.prev = 1;
|
|
828
|
+
identifier = { PhoneNumber: PhoneNumber };
|
|
829
|
+
_context11.next = 5;
|
|
830
|
+
return api.unsubscribeWhatsapp(locationId, identifier);
|
|
831
|
+
|
|
832
|
+
case 5:
|
|
833
|
+
data = _context11.sent;
|
|
834
|
+
return _context11.abrupt('return', data);
|
|
835
|
+
|
|
836
|
+
case 9:
|
|
837
|
+
_context11.prev = 9;
|
|
838
|
+
_context11.t0 = _context11['catch'](1);
|
|
839
|
+
|
|
840
|
+
if (!(_context11.t0.response && _context11.t0.response.data)) {
|
|
841
|
+
_context11.next = 14;
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
_error$response$data7 = _context11.t0.response.data, code = _error$response$data7.code, message = _error$response$data7.message;
|
|
846
|
+
throw new Error(code || message);
|
|
847
|
+
|
|
848
|
+
case 14:
|
|
849
|
+
throw _context11.t0;
|
|
850
|
+
|
|
851
|
+
case 15:
|
|
852
|
+
case 'end':
|
|
853
|
+
return _context11.stop();
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}, _callee11, this, [[1, 9]]);
|
|
857
|
+
}));
|
|
858
|
+
|
|
859
|
+
function unsubscribeWhatsapp(_x31) {
|
|
860
|
+
return _ref11.apply(this, arguments);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
return unsubscribeWhatsapp;
|
|
864
|
+
}()
|
|
865
|
+
|
|
810
866
|
/**
|
|
811
867
|
*
|
|
812
868
|
* @param {Object} identifier an object which identifies the user by its credentials
|
|
@@ -819,47 +875,47 @@ var Como = function () {
|
|
|
819
875
|
}, {
|
|
820
876
|
key: 'login',
|
|
821
877
|
value: function () {
|
|
822
|
-
var
|
|
823
|
-
var api, data, _error$response$
|
|
878
|
+
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(identifier, type, reCaptchaToken, recaptchaTokenType, devicePlatform) {
|
|
879
|
+
var api, data, _error$response$data8, code, message;
|
|
824
880
|
|
|
825
|
-
return _regenerator2.default.wrap(function
|
|
881
|
+
return _regenerator2.default.wrap(function _callee12$(_context12) {
|
|
826
882
|
while (1) {
|
|
827
|
-
switch (
|
|
883
|
+
switch (_context12.prev = _context12.next) {
|
|
828
884
|
case 0:
|
|
829
885
|
api = this.comoData.api;
|
|
830
|
-
|
|
831
|
-
|
|
886
|
+
_context12.prev = 1;
|
|
887
|
+
_context12.next = 4;
|
|
832
888
|
return api.logIn(type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform);
|
|
833
889
|
|
|
834
890
|
case 4:
|
|
835
|
-
data =
|
|
836
|
-
return
|
|
891
|
+
data = _context12.sent;
|
|
892
|
+
return _context12.abrupt('return', data);
|
|
837
893
|
|
|
838
894
|
case 8:
|
|
839
|
-
|
|
840
|
-
|
|
895
|
+
_context12.prev = 8;
|
|
896
|
+
_context12.t0 = _context12['catch'](1);
|
|
841
897
|
|
|
842
|
-
if (!(
|
|
843
|
-
|
|
898
|
+
if (!(_context12.t0.response && _context12.t0.response.data)) {
|
|
899
|
+
_context12.next = 13;
|
|
844
900
|
break;
|
|
845
901
|
}
|
|
846
902
|
|
|
847
|
-
_error$response$
|
|
903
|
+
_error$response$data8 = _context12.t0.response.data, code = _error$response$data8.code, message = _error$response$data8.message;
|
|
848
904
|
throw new Error(code || message);
|
|
849
905
|
|
|
850
906
|
case 13:
|
|
851
|
-
throw
|
|
907
|
+
throw _context12.t0;
|
|
852
908
|
|
|
853
909
|
case 14:
|
|
854
910
|
case 'end':
|
|
855
|
-
return
|
|
911
|
+
return _context12.stop();
|
|
856
912
|
}
|
|
857
913
|
}
|
|
858
|
-
},
|
|
914
|
+
}, _callee12, this, [[1, 8]]);
|
|
859
915
|
}));
|
|
860
916
|
|
|
861
|
-
function login(
|
|
862
|
-
return
|
|
917
|
+
function login(_x32, _x33, _x34, _x35, _x36) {
|
|
918
|
+
return _ref12.apply(this, arguments);
|
|
863
919
|
}
|
|
864
920
|
|
|
865
921
|
return login;
|
|
@@ -878,39 +934,39 @@ var Como = function () {
|
|
|
878
934
|
}, {
|
|
879
935
|
key: 'loginVerify',
|
|
880
936
|
value: function () {
|
|
881
|
-
var
|
|
882
|
-
var api,
|
|
937
|
+
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(identifier, type, code, reCaptchaToken, recaptchaTokenType, devicePlatform) {
|
|
938
|
+
var api, _ref14, consent, _error$response$data9, errCode, message;
|
|
883
939
|
|
|
884
|
-
return _regenerator2.default.wrap(function
|
|
940
|
+
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
|
885
941
|
while (1) {
|
|
886
|
-
switch (
|
|
942
|
+
switch (_context13.prev = _context13.next) {
|
|
887
943
|
case 0:
|
|
888
944
|
api = this.comoData.api;
|
|
889
|
-
|
|
890
|
-
|
|
945
|
+
_context13.prev = 1;
|
|
946
|
+
_context13.next = 4;
|
|
891
947
|
return api.logInVerify(code, type, identifier, reCaptchaToken, recaptchaTokenType, devicePlatform);
|
|
892
948
|
|
|
893
949
|
case 4:
|
|
894
|
-
|
|
895
|
-
consent =
|
|
950
|
+
_ref14 = _context13.sent;
|
|
951
|
+
consent = _ref14.consent;
|
|
896
952
|
|
|
897
953
|
this.comoData.consent = consent;
|
|
898
|
-
|
|
954
|
+
_context13.next = 17;
|
|
899
955
|
break;
|
|
900
956
|
|
|
901
957
|
case 9:
|
|
902
|
-
|
|
903
|
-
|
|
958
|
+
_context13.prev = 9;
|
|
959
|
+
_context13.t0 = _context13['catch'](1);
|
|
904
960
|
|
|
905
|
-
if (!(
|
|
906
|
-
|
|
961
|
+
if (!(_context13.t0.response && _context13.t0.response.data)) {
|
|
962
|
+
_context13.next = 16;
|
|
907
963
|
break;
|
|
908
964
|
}
|
|
909
965
|
|
|
910
|
-
_error$response$
|
|
966
|
+
_error$response$data9 = _context13.t0.response.data, errCode = _error$response$data9.code, message = _error$response$data9.message;
|
|
911
967
|
|
|
912
968
|
if (!(message && message === 'Invalid verification Code')) {
|
|
913
|
-
|
|
969
|
+
_context13.next = 15;
|
|
914
970
|
break;
|
|
915
971
|
}
|
|
916
972
|
|
|
@@ -920,21 +976,21 @@ var Como = function () {
|
|
|
920
976
|
throw new Error(errCode || message);
|
|
921
977
|
|
|
922
978
|
case 16:
|
|
923
|
-
throw
|
|
979
|
+
throw _context13.t0;
|
|
924
980
|
|
|
925
981
|
case 17:
|
|
926
|
-
return
|
|
982
|
+
return _context13.abrupt('return', this.getCredentials());
|
|
927
983
|
|
|
928
984
|
case 18:
|
|
929
985
|
case 'end':
|
|
930
|
-
return
|
|
986
|
+
return _context13.stop();
|
|
931
987
|
}
|
|
932
988
|
}
|
|
933
|
-
},
|
|
989
|
+
}, _callee13, this, [[1, 9]]);
|
|
934
990
|
}));
|
|
935
991
|
|
|
936
|
-
function loginVerify(
|
|
937
|
-
return
|
|
992
|
+
function loginVerify(_x37, _x38, _x39, _x40, _x41, _x42) {
|
|
993
|
+
return _ref13.apply(this, arguments);
|
|
938
994
|
}
|
|
939
995
|
|
|
940
996
|
return loginVerify;
|
|
@@ -950,34 +1006,34 @@ var Como = function () {
|
|
|
950
1006
|
}, {
|
|
951
1007
|
key: 'reloadMembership',
|
|
952
1008
|
value: function () {
|
|
953
|
-
var
|
|
1009
|
+
var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
|
|
954
1010
|
var onlyAssetKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
955
1011
|
|
|
956
|
-
var
|
|
1012
|
+
var _comoData6, env, locationId, api, membership;
|
|
957
1013
|
|
|
958
|
-
return _regenerator2.default.wrap(function
|
|
1014
|
+
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
|
959
1015
|
while (1) {
|
|
960
|
-
switch (
|
|
1016
|
+
switch (_context14.prev = _context14.next) {
|
|
961
1017
|
case 0:
|
|
962
|
-
|
|
963
|
-
|
|
1018
|
+
_comoData6 = this.comoData, env = _comoData6.env_params, locationId = _comoData6.locationId, api = _comoData6.api;
|
|
1019
|
+
_context14.next = 3;
|
|
964
1020
|
return api.getUserAtLocation(env.zapp_root, locationId, onlyAssetKeys);
|
|
965
1021
|
|
|
966
1022
|
case 3:
|
|
967
|
-
membership =
|
|
1023
|
+
membership = _context14.sent;
|
|
968
1024
|
|
|
969
1025
|
this.comoData.membership = membership;
|
|
970
1026
|
|
|
971
1027
|
case 5:
|
|
972
1028
|
case 'end':
|
|
973
|
-
return
|
|
1029
|
+
return _context14.stop();
|
|
974
1030
|
}
|
|
975
1031
|
}
|
|
976
|
-
},
|
|
1032
|
+
}, _callee14, this);
|
|
977
1033
|
}));
|
|
978
1034
|
|
|
979
1035
|
function reloadMembership() {
|
|
980
|
-
return
|
|
1036
|
+
return _ref15.apply(this, arguments);
|
|
981
1037
|
}
|
|
982
1038
|
|
|
983
1039
|
return reloadMembership;
|
|
@@ -990,26 +1046,26 @@ var Como = function () {
|
|
|
990
1046
|
}, {
|
|
991
1047
|
key: 'openApp',
|
|
992
1048
|
value: function () {
|
|
993
|
-
var
|
|
994
|
-
var
|
|
1049
|
+
var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(data) {
|
|
1050
|
+
var _comoData7, api, locationId, env;
|
|
995
1051
|
|
|
996
|
-
return _regenerator2.default.wrap(function
|
|
1052
|
+
return _regenerator2.default.wrap(function _callee15$(_context15) {
|
|
997
1053
|
while (1) {
|
|
998
|
-
switch (
|
|
1054
|
+
switch (_context15.prev = _context15.next) {
|
|
999
1055
|
case 0:
|
|
1000
|
-
|
|
1001
|
-
return
|
|
1056
|
+
_comoData7 = this.comoData, api = _comoData7.api, locationId = _comoData7.locationId, env = _comoData7.env_params;
|
|
1057
|
+
return _context15.abrupt('return', api.openApp(env.zapp_root, locationId, data));
|
|
1002
1058
|
|
|
1003
1059
|
case 2:
|
|
1004
1060
|
case 'end':
|
|
1005
|
-
return
|
|
1061
|
+
return _context15.stop();
|
|
1006
1062
|
}
|
|
1007
1063
|
}
|
|
1008
|
-
},
|
|
1064
|
+
}, _callee15, this);
|
|
1009
1065
|
}));
|
|
1010
1066
|
|
|
1011
|
-
function openApp(
|
|
1012
|
-
return
|
|
1067
|
+
function openApp(_x44) {
|
|
1068
|
+
return _ref16.apply(this, arguments);
|
|
1013
1069
|
}
|
|
1014
1070
|
|
|
1015
1071
|
return openApp;
|
|
@@ -1024,33 +1080,33 @@ var Como = function () {
|
|
|
1024
1080
|
}, {
|
|
1025
1081
|
key: 'clientUpdateMembership',
|
|
1026
1082
|
value: function () {
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1083
|
+
var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(pushEnable, locationEnable) {
|
|
1084
|
+
var _comoData8, api, locationId, token, env;
|
|
1029
1085
|
|
|
1030
|
-
return _regenerator2.default.wrap(function
|
|
1086
|
+
return _regenerator2.default.wrap(function _callee16$(_context16) {
|
|
1031
1087
|
while (1) {
|
|
1032
|
-
switch (
|
|
1088
|
+
switch (_context16.prev = _context16.next) {
|
|
1033
1089
|
case 0:
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
return
|
|
1090
|
+
_comoData8 = this.comoData, api = _comoData8.api, locationId = _comoData8.locationId, token = _comoData8.token, env = _comoData8.env_params;
|
|
1091
|
+
_context16.prev = 1;
|
|
1092
|
+
return _context16.abrupt('return', api.clientUpdateMembership(env.services_root, locationId, pushEnable, locationEnable));
|
|
1037
1093
|
|
|
1038
1094
|
case 5:
|
|
1039
|
-
|
|
1040
|
-
|
|
1095
|
+
_context16.prev = 5;
|
|
1096
|
+
_context16.t0 = _context16['catch'](1);
|
|
1041
1097
|
|
|
1042
|
-
console.log('clientUpdateMembership failed, token:' + token + ', locationId:' + locationId + ', error: ' +
|
|
1098
|
+
console.log('clientUpdateMembership failed, token:' + token + ', locationId:' + locationId + ', error: ' + _context16.t0);
|
|
1043
1099
|
|
|
1044
1100
|
case 8:
|
|
1045
1101
|
case 'end':
|
|
1046
|
-
return
|
|
1102
|
+
return _context16.stop();
|
|
1047
1103
|
}
|
|
1048
1104
|
}
|
|
1049
|
-
},
|
|
1105
|
+
}, _callee16, this, [[1, 5]]);
|
|
1050
1106
|
}));
|
|
1051
1107
|
|
|
1052
|
-
function clientUpdateMembership(
|
|
1053
|
-
return
|
|
1108
|
+
function clientUpdateMembership(_x45, _x46) {
|
|
1109
|
+
return _ref17.apply(this, arguments);
|
|
1054
1110
|
}
|
|
1055
1111
|
|
|
1056
1112
|
return clientUpdateMembership;
|
|
@@ -1064,18 +1120,18 @@ var Como = function () {
|
|
|
1064
1120
|
}, {
|
|
1065
1121
|
key: 'downloadMainResource',
|
|
1066
1122
|
value: function () {
|
|
1067
|
-
var
|
|
1068
|
-
var resource, err,
|
|
1123
|
+
var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(resourceId) {
|
|
1124
|
+
var resource, err, _comoData9, env, api, responseJson;
|
|
1069
1125
|
|
|
1070
|
-
return _regenerator2.default.wrap(function
|
|
1126
|
+
return _regenerator2.default.wrap(function _callee17$(_context17) {
|
|
1071
1127
|
while (1) {
|
|
1072
|
-
switch (
|
|
1128
|
+
switch (_context17.prev = _context17.next) {
|
|
1073
1129
|
case 0:
|
|
1074
|
-
|
|
1130
|
+
_context17.prev = 0;
|
|
1075
1131
|
resource = this.comoData.mainResourcesMap[resourceId];
|
|
1076
1132
|
|
|
1077
1133
|
if (resource) {
|
|
1078
|
-
|
|
1134
|
+
_context17.next = 5;
|
|
1079
1135
|
break;
|
|
1080
1136
|
}
|
|
1081
1137
|
|
|
@@ -1083,35 +1139,35 @@ var Como = function () {
|
|
|
1083
1139
|
throw new Error(err);
|
|
1084
1140
|
|
|
1085
1141
|
case 5:
|
|
1086
|
-
|
|
1087
|
-
|
|
1142
|
+
_comoData9 = this.comoData, env = _comoData9.env_params, api = _comoData9.api;
|
|
1143
|
+
_context17.next = 8;
|
|
1088
1144
|
return api.getLoyaltyResource(env.services_root_cdn, resource.id, 'Namespace' in resource ? resource.Namespace : 'location_' + this.comoData.locationId, resource.Version, this.comoData.locationId);
|
|
1089
1145
|
|
|
1090
1146
|
case 8:
|
|
1091
|
-
responseJson =
|
|
1147
|
+
responseJson = _context17.sent;
|
|
1092
1148
|
|
|
1093
1149
|
|
|
1094
1150
|
this.comoData.mainResources[resourceId] = responseJson;
|
|
1095
|
-
|
|
1151
|
+
_context17.next = 16;
|
|
1096
1152
|
break;
|
|
1097
1153
|
|
|
1098
1154
|
case 12:
|
|
1099
|
-
|
|
1100
|
-
|
|
1155
|
+
_context17.prev = 12;
|
|
1156
|
+
_context17.t0 = _context17['catch'](0);
|
|
1101
1157
|
|
|
1102
|
-
console.log('downloadMainResource failed, resourceId:' + resourceId + ', locationId:' + this.comoData.locationId + ', this.comoData.mainResourcesMap: ' + this.comoData.mainResourcesMap + ', error: ' +
|
|
1103
|
-
throw new Error(
|
|
1158
|
+
console.log('downloadMainResource failed, resourceId:' + resourceId + ', locationId:' + this.comoData.locationId + ', this.comoData.mainResourcesMap: ' + this.comoData.mainResourcesMap + ', error: ' + _context17.t0);
|
|
1159
|
+
throw new Error(_context17.t0);
|
|
1104
1160
|
|
|
1105
1161
|
case 16:
|
|
1106
1162
|
case 'end':
|
|
1107
|
-
return
|
|
1163
|
+
return _context17.stop();
|
|
1108
1164
|
}
|
|
1109
1165
|
}
|
|
1110
|
-
},
|
|
1166
|
+
}, _callee17, this, [[0, 12]]);
|
|
1111
1167
|
}));
|
|
1112
1168
|
|
|
1113
|
-
function downloadMainResource(
|
|
1114
|
-
return
|
|
1169
|
+
function downloadMainResource(_x47) {
|
|
1170
|
+
return _ref18.apply(this, arguments);
|
|
1115
1171
|
}
|
|
1116
1172
|
|
|
1117
1173
|
return downloadMainResource;
|
|
@@ -1125,18 +1181,18 @@ var Como = function () {
|
|
|
1125
1181
|
}, {
|
|
1126
1182
|
key: 'reloadLocationState',
|
|
1127
1183
|
value: function () {
|
|
1128
|
-
var
|
|
1184
|
+
var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18() {
|
|
1129
1185
|
var api, state, mainResources;
|
|
1130
|
-
return _regenerator2.default.wrap(function
|
|
1186
|
+
return _regenerator2.default.wrap(function _callee18$(_context18) {
|
|
1131
1187
|
while (1) {
|
|
1132
|
-
switch (
|
|
1188
|
+
switch (_context18.prev = _context18.next) {
|
|
1133
1189
|
case 0:
|
|
1134
1190
|
api = this.comoData.api;
|
|
1135
|
-
|
|
1191
|
+
_context18.next = 3;
|
|
1136
1192
|
return api.getLocationState(this.comoData.env_params.zapp_root, this.comoData.locationId);
|
|
1137
1193
|
|
|
1138
1194
|
case 3:
|
|
1139
|
-
state =
|
|
1195
|
+
state = _context18.sent;
|
|
1140
1196
|
|
|
1141
1197
|
this.comoData.locationState = state;
|
|
1142
1198
|
mainResources = state.MainResources.Resource;
|
|
@@ -1149,14 +1205,14 @@ var Como = function () {
|
|
|
1149
1205
|
|
|
1150
1206
|
case 7:
|
|
1151
1207
|
case 'end':
|
|
1152
|
-
return
|
|
1208
|
+
return _context18.stop();
|
|
1153
1209
|
}
|
|
1154
1210
|
}
|
|
1155
|
-
},
|
|
1211
|
+
}, _callee18, this);
|
|
1156
1212
|
}));
|
|
1157
1213
|
|
|
1158
1214
|
function reloadLocationState() {
|
|
1159
|
-
return
|
|
1215
|
+
return _ref19.apply(this, arguments);
|
|
1160
1216
|
}
|
|
1161
1217
|
|
|
1162
1218
|
return reloadLocationState;
|
|
@@ -1169,35 +1225,35 @@ var Como = function () {
|
|
|
1169
1225
|
}, {
|
|
1170
1226
|
key: 'getAppClientID',
|
|
1171
1227
|
value: function () {
|
|
1172
|
-
var
|
|
1173
|
-
var
|
|
1228
|
+
var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee19() {
|
|
1229
|
+
var _comoData10, env, locationId, api, responseJson;
|
|
1174
1230
|
|
|
1175
|
-
return _regenerator2.default.wrap(function
|
|
1231
|
+
return _regenerator2.default.wrap(function _callee19$(_context19) {
|
|
1176
1232
|
while (1) {
|
|
1177
|
-
switch (
|
|
1233
|
+
switch (_context19.prev = _context19.next) {
|
|
1178
1234
|
case 0:
|
|
1179
|
-
|
|
1180
|
-
|
|
1235
|
+
_comoData10 = this.comoData, env = _comoData10.env_params, locationId = _comoData10.locationId, api = _comoData10.api;
|
|
1236
|
+
_context19.next = 3;
|
|
1181
1237
|
return this.refreshTokenIfNeeded();
|
|
1182
1238
|
|
|
1183
1239
|
case 3:
|
|
1184
|
-
|
|
1240
|
+
_context19.next = 5;
|
|
1185
1241
|
return api.getShortUserId(env.zapp_root, locationId);
|
|
1186
1242
|
|
|
1187
1243
|
case 5:
|
|
1188
|
-
responseJson =
|
|
1189
|
-
return
|
|
1244
|
+
responseJson = _context19.sent;
|
|
1245
|
+
return _context19.abrupt('return', responseJson.ID);
|
|
1190
1246
|
|
|
1191
1247
|
case 7:
|
|
1192
1248
|
case 'end':
|
|
1193
|
-
return
|
|
1249
|
+
return _context19.stop();
|
|
1194
1250
|
}
|
|
1195
1251
|
}
|
|
1196
|
-
},
|
|
1252
|
+
}, _callee19, this);
|
|
1197
1253
|
}));
|
|
1198
1254
|
|
|
1199
1255
|
function getAppClientID() {
|
|
1200
|
-
return
|
|
1256
|
+
return _ref20.apply(this, arguments);
|
|
1201
1257
|
}
|
|
1202
1258
|
|
|
1203
1259
|
return getAppClientID;
|
|
@@ -1210,31 +1266,31 @@ var Como = function () {
|
|
|
1210
1266
|
}, {
|
|
1211
1267
|
key: 'getPaymentCode',
|
|
1212
1268
|
value: function () {
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1269
|
+
var _ref21 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee20() {
|
|
1270
|
+
var _comoData11, env, locationId, api, responseJson;
|
|
1215
1271
|
|
|
1216
|
-
return _regenerator2.default.wrap(function
|
|
1272
|
+
return _regenerator2.default.wrap(function _callee20$(_context20) {
|
|
1217
1273
|
while (1) {
|
|
1218
|
-
switch (
|
|
1274
|
+
switch (_context20.prev = _context20.next) {
|
|
1219
1275
|
case 0:
|
|
1220
|
-
|
|
1221
|
-
|
|
1276
|
+
_comoData11 = this.comoData, env = _comoData11.env_params, locationId = _comoData11.locationId, api = _comoData11.api;
|
|
1277
|
+
_context20.next = 3;
|
|
1222
1278
|
return api.getPaymentCode(env.zapp_root, locationId);
|
|
1223
1279
|
|
|
1224
1280
|
case 3:
|
|
1225
|
-
responseJson =
|
|
1226
|
-
return
|
|
1281
|
+
responseJson = _context20.sent;
|
|
1282
|
+
return _context20.abrupt('return', responseJson.VerificationCode);
|
|
1227
1283
|
|
|
1228
1284
|
case 5:
|
|
1229
1285
|
case 'end':
|
|
1230
|
-
return
|
|
1286
|
+
return _context20.stop();
|
|
1231
1287
|
}
|
|
1232
1288
|
}
|
|
1233
|
-
},
|
|
1289
|
+
}, _callee20, this);
|
|
1234
1290
|
}));
|
|
1235
1291
|
|
|
1236
1292
|
function getPaymentCode() {
|
|
1237
|
-
return
|
|
1293
|
+
return _ref21.apply(this, arguments);
|
|
1238
1294
|
}
|
|
1239
1295
|
|
|
1240
1296
|
return getPaymentCode;
|
|
@@ -1247,47 +1303,47 @@ var Como = function () {
|
|
|
1247
1303
|
}, {
|
|
1248
1304
|
key: 'logout',
|
|
1249
1305
|
value: function () {
|
|
1250
|
-
var
|
|
1251
|
-
var api, response, _error$response$
|
|
1306
|
+
var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee21() {
|
|
1307
|
+
var api, response, _error$response$data10, errCode, message;
|
|
1252
1308
|
|
|
1253
|
-
return _regenerator2.default.wrap(function
|
|
1309
|
+
return _regenerator2.default.wrap(function _callee21$(_context21) {
|
|
1254
1310
|
while (1) {
|
|
1255
|
-
switch (
|
|
1311
|
+
switch (_context21.prev = _context21.next) {
|
|
1256
1312
|
case 0:
|
|
1257
1313
|
api = this.comoData.api;
|
|
1258
|
-
|
|
1259
|
-
|
|
1314
|
+
_context21.prev = 1;
|
|
1315
|
+
_context21.next = 4;
|
|
1260
1316
|
return api.logOut();
|
|
1261
1317
|
|
|
1262
1318
|
case 4:
|
|
1263
|
-
response =
|
|
1264
|
-
return
|
|
1319
|
+
response = _context21.sent;
|
|
1320
|
+
return _context21.abrupt('return', response);
|
|
1265
1321
|
|
|
1266
1322
|
case 8:
|
|
1267
|
-
|
|
1268
|
-
|
|
1323
|
+
_context21.prev = 8;
|
|
1324
|
+
_context21.t0 = _context21['catch'](1);
|
|
1269
1325
|
|
|
1270
|
-
if (!(
|
|
1271
|
-
|
|
1326
|
+
if (!(_context21.t0.response && _context21.t0.response.data)) {
|
|
1327
|
+
_context21.next = 13;
|
|
1272
1328
|
break;
|
|
1273
1329
|
}
|
|
1274
1330
|
|
|
1275
|
-
_error$response$
|
|
1331
|
+
_error$response$data10 = _context21.t0.response.data, errCode = _error$response$data10.code, message = _error$response$data10.message;
|
|
1276
1332
|
throw new Error(errCode || message);
|
|
1277
1333
|
|
|
1278
1334
|
case 13:
|
|
1279
|
-
throw
|
|
1335
|
+
throw _context21.t0;
|
|
1280
1336
|
|
|
1281
1337
|
case 14:
|
|
1282
1338
|
case 'end':
|
|
1283
|
-
return
|
|
1339
|
+
return _context21.stop();
|
|
1284
1340
|
}
|
|
1285
1341
|
}
|
|
1286
|
-
},
|
|
1342
|
+
}, _callee21, this, [[1, 8]]);
|
|
1287
1343
|
}));
|
|
1288
1344
|
|
|
1289
1345
|
function logout() {
|
|
1290
|
-
return
|
|
1346
|
+
return _ref22.apply(this, arguments);
|
|
1291
1347
|
}
|
|
1292
1348
|
|
|
1293
1349
|
return logout;
|
|
@@ -1301,35 +1357,35 @@ var Como = function () {
|
|
|
1301
1357
|
}, {
|
|
1302
1358
|
key: 'redeemAsset',
|
|
1303
1359
|
value: function () {
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1360
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee22(assetKey) {
|
|
1361
|
+
var _comoData12, env, locationId, api, responseJson;
|
|
1306
1362
|
|
|
1307
|
-
return _regenerator2.default.wrap(function
|
|
1363
|
+
return _regenerator2.default.wrap(function _callee22$(_context22) {
|
|
1308
1364
|
while (1) {
|
|
1309
|
-
switch (
|
|
1365
|
+
switch (_context22.prev = _context22.next) {
|
|
1310
1366
|
case 0:
|
|
1311
|
-
|
|
1312
|
-
|
|
1367
|
+
_comoData12 = this.comoData, env = _comoData12.env_params, locationId = _comoData12.locationId, api = _comoData12.api;
|
|
1368
|
+
_context22.next = 3;
|
|
1313
1369
|
return this.refreshTokenIfNeeded();
|
|
1314
1370
|
|
|
1315
1371
|
case 3:
|
|
1316
|
-
|
|
1372
|
+
_context22.next = 5;
|
|
1317
1373
|
return api.redeemAsset(env.zapp_root, locationId, assetKey);
|
|
1318
1374
|
|
|
1319
1375
|
case 5:
|
|
1320
|
-
responseJson =
|
|
1321
|
-
return
|
|
1376
|
+
responseJson = _context22.sent;
|
|
1377
|
+
return _context22.abrupt('return', responseJson);
|
|
1322
1378
|
|
|
1323
1379
|
case 7:
|
|
1324
1380
|
case 'end':
|
|
1325
|
-
return
|
|
1381
|
+
return _context22.stop();
|
|
1326
1382
|
}
|
|
1327
1383
|
}
|
|
1328
|
-
},
|
|
1384
|
+
}, _callee22, this);
|
|
1329
1385
|
}));
|
|
1330
1386
|
|
|
1331
|
-
function redeemAsset(
|
|
1332
|
-
return
|
|
1387
|
+
function redeemAsset(_x48) {
|
|
1388
|
+
return _ref23.apply(this, arguments);
|
|
1333
1389
|
}
|
|
1334
1390
|
|
|
1335
1391
|
return redeemAsset;
|
|
@@ -1343,31 +1399,31 @@ var Como = function () {
|
|
|
1343
1399
|
}, {
|
|
1344
1400
|
key: 'purchaseAsset',
|
|
1345
1401
|
value: function () {
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1402
|
+
var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee23(itemId) {
|
|
1403
|
+
var _comoData13, env, locationId, api, responseJson;
|
|
1348
1404
|
|
|
1349
|
-
return _regenerator2.default.wrap(function
|
|
1405
|
+
return _regenerator2.default.wrap(function _callee23$(_context23) {
|
|
1350
1406
|
while (1) {
|
|
1351
|
-
switch (
|
|
1407
|
+
switch (_context23.prev = _context23.next) {
|
|
1352
1408
|
case 0:
|
|
1353
|
-
|
|
1354
|
-
|
|
1409
|
+
_comoData13 = this.comoData, env = _comoData13.env_params, locationId = _comoData13.locationId, api = _comoData13.api;
|
|
1410
|
+
_context23.next = 3;
|
|
1355
1411
|
return api.purchaseAsset(env.zapp_root, locationId, itemId);
|
|
1356
1412
|
|
|
1357
1413
|
case 3:
|
|
1358
|
-
responseJson =
|
|
1359
|
-
return
|
|
1414
|
+
responseJson = _context23.sent;
|
|
1415
|
+
return _context23.abrupt('return', responseJson);
|
|
1360
1416
|
|
|
1361
1417
|
case 5:
|
|
1362
1418
|
case 'end':
|
|
1363
|
-
return
|
|
1419
|
+
return _context23.stop();
|
|
1364
1420
|
}
|
|
1365
1421
|
}
|
|
1366
|
-
},
|
|
1422
|
+
}, _callee23, this);
|
|
1367
1423
|
}));
|
|
1368
1424
|
|
|
1369
|
-
function purchaseAsset(
|
|
1370
|
-
return
|
|
1425
|
+
function purchaseAsset(_x49) {
|
|
1426
|
+
return _ref24.apply(this, arguments);
|
|
1371
1427
|
}
|
|
1372
1428
|
|
|
1373
1429
|
return purchaseAsset;
|
|
@@ -1375,31 +1431,31 @@ var Como = function () {
|
|
|
1375
1431
|
}, {
|
|
1376
1432
|
key: 'getUserPointShopDataAPI2',
|
|
1377
1433
|
value: function () {
|
|
1378
|
-
var
|
|
1379
|
-
var
|
|
1434
|
+
var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee24() {
|
|
1435
|
+
var _comoData14, env, locationId, api, responseJson;
|
|
1380
1436
|
|
|
1381
|
-
return _regenerator2.default.wrap(function
|
|
1437
|
+
return _regenerator2.default.wrap(function _callee24$(_context24) {
|
|
1382
1438
|
while (1) {
|
|
1383
|
-
switch (
|
|
1439
|
+
switch (_context24.prev = _context24.next) {
|
|
1384
1440
|
case 0:
|
|
1385
|
-
|
|
1386
|
-
|
|
1441
|
+
_comoData14 = this.comoData, env = _comoData14.env_params, locationId = _comoData14.locationId, api = _comoData14.api;
|
|
1442
|
+
_context24.next = 3;
|
|
1387
1443
|
return api.getUserPointShopDataAPI2(env.zapp_root, locationId);
|
|
1388
1444
|
|
|
1389
1445
|
case 3:
|
|
1390
|
-
responseJson =
|
|
1391
|
-
return
|
|
1446
|
+
responseJson = _context24.sent;
|
|
1447
|
+
return _context24.abrupt('return', responseJson);
|
|
1392
1448
|
|
|
1393
1449
|
case 5:
|
|
1394
1450
|
case 'end':
|
|
1395
|
-
return
|
|
1451
|
+
return _context24.stop();
|
|
1396
1452
|
}
|
|
1397
1453
|
}
|
|
1398
|
-
},
|
|
1454
|
+
}, _callee24, this);
|
|
1399
1455
|
}));
|
|
1400
1456
|
|
|
1401
1457
|
function getUserPointShopDataAPI2() {
|
|
1402
|
-
return
|
|
1458
|
+
return _ref25.apply(this, arguments);
|
|
1403
1459
|
}
|
|
1404
1460
|
|
|
1405
1461
|
return getUserPointShopDataAPI2;
|
|
@@ -1407,31 +1463,31 @@ var Como = function () {
|
|
|
1407
1463
|
}, {
|
|
1408
1464
|
key: 'purchaseAssetAPI2',
|
|
1409
1465
|
value: function () {
|
|
1410
|
-
var
|
|
1411
|
-
var
|
|
1466
|
+
var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee25(assetID) {
|
|
1467
|
+
var _comoData15, env, locationId, api, responseJson;
|
|
1412
1468
|
|
|
1413
|
-
return _regenerator2.default.wrap(function
|
|
1469
|
+
return _regenerator2.default.wrap(function _callee25$(_context25) {
|
|
1414
1470
|
while (1) {
|
|
1415
|
-
switch (
|
|
1471
|
+
switch (_context25.prev = _context25.next) {
|
|
1416
1472
|
case 0:
|
|
1417
|
-
|
|
1418
|
-
|
|
1473
|
+
_comoData15 = this.comoData, env = _comoData15.env_params, locationId = _comoData15.locationId, api = _comoData15.api;
|
|
1474
|
+
_context25.next = 3;
|
|
1419
1475
|
return api.purchaseAssetAPI2(env.zapp_root, locationId, assetID);
|
|
1420
1476
|
|
|
1421
1477
|
case 3:
|
|
1422
|
-
responseJson =
|
|
1423
|
-
return
|
|
1478
|
+
responseJson = _context25.sent;
|
|
1479
|
+
return _context25.abrupt('return', responseJson);
|
|
1424
1480
|
|
|
1425
1481
|
case 5:
|
|
1426
1482
|
case 'end':
|
|
1427
|
-
return
|
|
1483
|
+
return _context25.stop();
|
|
1428
1484
|
}
|
|
1429
1485
|
}
|
|
1430
|
-
},
|
|
1486
|
+
}, _callee25, this);
|
|
1431
1487
|
}));
|
|
1432
1488
|
|
|
1433
|
-
function purchaseAssetAPI2(
|
|
1434
|
-
return
|
|
1489
|
+
function purchaseAssetAPI2(_x50) {
|
|
1490
|
+
return _ref26.apply(this, arguments);
|
|
1435
1491
|
}
|
|
1436
1492
|
|
|
1437
1493
|
return purchaseAssetAPI2;
|
|
@@ -1445,32 +1501,32 @@ var Como = function () {
|
|
|
1445
1501
|
}, {
|
|
1446
1502
|
key: 'reloadAssets',
|
|
1447
1503
|
value: function () {
|
|
1448
|
-
var
|
|
1449
|
-
var
|
|
1504
|
+
var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee26() {
|
|
1505
|
+
var _comoData16, env, locationId, api, responseJson;
|
|
1450
1506
|
|
|
1451
|
-
return _regenerator2.default.wrap(function
|
|
1507
|
+
return _regenerator2.default.wrap(function _callee26$(_context26) {
|
|
1452
1508
|
while (1) {
|
|
1453
|
-
switch (
|
|
1509
|
+
switch (_context26.prev = _context26.next) {
|
|
1454
1510
|
case 0:
|
|
1455
|
-
|
|
1456
|
-
|
|
1511
|
+
_comoData16 = this.comoData, env = _comoData16.env_params, locationId = _comoData16.locationId, api = _comoData16.api;
|
|
1512
|
+
_context26.next = 3;
|
|
1457
1513
|
return api.memberAssets(env.services_root, locationId);
|
|
1458
1514
|
|
|
1459
1515
|
case 3:
|
|
1460
|
-
responseJson =
|
|
1516
|
+
responseJson = _context26.sent;
|
|
1461
1517
|
|
|
1462
1518
|
this.comoData.assets = responseJson;
|
|
1463
1519
|
|
|
1464
1520
|
case 5:
|
|
1465
1521
|
case 'end':
|
|
1466
|
-
return
|
|
1522
|
+
return _context26.stop();
|
|
1467
1523
|
}
|
|
1468
1524
|
}
|
|
1469
|
-
},
|
|
1525
|
+
}, _callee26, this);
|
|
1470
1526
|
}));
|
|
1471
1527
|
|
|
1472
1528
|
function reloadAssets() {
|
|
1473
|
-
return
|
|
1529
|
+
return _ref27.apply(this, arguments);
|
|
1474
1530
|
}
|
|
1475
1531
|
|
|
1476
1532
|
return reloadAssets;
|
|
@@ -1518,16 +1574,16 @@ var Como = function () {
|
|
|
1518
1574
|
}, {
|
|
1519
1575
|
key: 'downloadMainResources',
|
|
1520
1576
|
value: function () {
|
|
1521
|
-
var
|
|
1577
|
+
var _ref28 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee27() {
|
|
1522
1578
|
var resources, downloadMainResource, downloads;
|
|
1523
|
-
return _regenerator2.default.wrap(function
|
|
1579
|
+
return _regenerator2.default.wrap(function _callee27$(_context27) {
|
|
1524
1580
|
while (1) {
|
|
1525
|
-
switch (
|
|
1581
|
+
switch (_context27.prev = _context27.next) {
|
|
1526
1582
|
case 0:
|
|
1527
1583
|
resources = ['LocationData', 'Menu', 'Updates', 'TCAlts', 'AppTexts', 'DefaultAppTexts'];
|
|
1528
1584
|
downloadMainResource = this.downloadMainResource.bind(this);
|
|
1529
1585
|
downloads = resources.map(downloadMainResource);
|
|
1530
|
-
|
|
1586
|
+
_context27.next = 5;
|
|
1531
1587
|
return _promise2.default.all(downloads);
|
|
1532
1588
|
|
|
1533
1589
|
case 5:
|
|
@@ -1535,14 +1591,14 @@ var Como = function () {
|
|
|
1535
1591
|
|
|
1536
1592
|
case 6:
|
|
1537
1593
|
case 'end':
|
|
1538
|
-
return
|
|
1594
|
+
return _context27.stop();
|
|
1539
1595
|
}
|
|
1540
1596
|
}
|
|
1541
|
-
},
|
|
1597
|
+
}, _callee27, this);
|
|
1542
1598
|
}));
|
|
1543
1599
|
|
|
1544
1600
|
function downloadMainResources() {
|
|
1545
|
-
return
|
|
1601
|
+
return _ref28.apply(this, arguments);
|
|
1546
1602
|
}
|
|
1547
1603
|
|
|
1548
1604
|
return downloadMainResources;
|
|
@@ -1556,9 +1612,9 @@ var Como = function () {
|
|
|
1556
1612
|
}, {
|
|
1557
1613
|
key: 'loadForm',
|
|
1558
1614
|
value: function loadForm(type) {
|
|
1559
|
-
var
|
|
1560
|
-
api =
|
|
1561
|
-
locationId =
|
|
1615
|
+
var _comoData17 = this.comoData,
|
|
1616
|
+
api = _comoData17.api,
|
|
1617
|
+
locationId = _comoData17.locationId;
|
|
1562
1618
|
|
|
1563
1619
|
|
|
1564
1620
|
return api.getForm(type, locationId);
|
|
@@ -1572,9 +1628,9 @@ var Como = function () {
|
|
|
1572
1628
|
}, {
|
|
1573
1629
|
key: 'getConfigration',
|
|
1574
1630
|
value: function getConfigration(type) {
|
|
1575
|
-
var
|
|
1576
|
-
api =
|
|
1577
|
-
locationId =
|
|
1631
|
+
var _comoData18 = this.comoData,
|
|
1632
|
+
api = _comoData18.api,
|
|
1633
|
+
locationId = _comoData18.locationId;
|
|
1578
1634
|
|
|
1579
1635
|
var locationState = this.getLocationState();
|
|
1580
1636
|
var version = null;
|
|
@@ -1593,9 +1649,9 @@ var Como = function () {
|
|
|
1593
1649
|
}, {
|
|
1594
1650
|
key: 'getResource',
|
|
1595
1651
|
value: function getResource(type) {
|
|
1596
|
-
var
|
|
1597
|
-
api =
|
|
1598
|
-
locationId =
|
|
1652
|
+
var _comoData19 = this.comoData,
|
|
1653
|
+
api = _comoData19.api,
|
|
1654
|
+
locationId = _comoData19.locationId;
|
|
1599
1655
|
|
|
1600
1656
|
return api.getResource(type, locationId);
|
|
1601
1657
|
}
|
|
@@ -1608,9 +1664,9 @@ var Como = function () {
|
|
|
1608
1664
|
}, {
|
|
1609
1665
|
key: 'getLegacyResources',
|
|
1610
1666
|
value: function getLegacyResources() {
|
|
1611
|
-
var
|
|
1612
|
-
api =
|
|
1613
|
-
locationId =
|
|
1667
|
+
var _comoData20 = this.comoData,
|
|
1668
|
+
api = _comoData20.api,
|
|
1669
|
+
locationId = _comoData20.locationId;
|
|
1614
1670
|
|
|
1615
1671
|
return api.getZappResource(locationId);
|
|
1616
1672
|
}
|
|
@@ -1622,10 +1678,10 @@ var Como = function () {
|
|
|
1622
1678
|
}, {
|
|
1623
1679
|
key: 'generateReferralCode',
|
|
1624
1680
|
value: function generateReferralCode() {
|
|
1625
|
-
var
|
|
1626
|
-
api =
|
|
1627
|
-
locationId =
|
|
1628
|
-
env =
|
|
1681
|
+
var _comoData21 = this.comoData,
|
|
1682
|
+
api = _comoData21.api,
|
|
1683
|
+
locationId = _comoData21.locationId,
|
|
1684
|
+
env = _comoData21.env_params;
|
|
1629
1685
|
|
|
1630
1686
|
|
|
1631
1687
|
return api.generateReferralCode(env.services_root, locationId);
|
|
@@ -1638,10 +1694,10 @@ var Como = function () {
|
|
|
1638
1694
|
}, {
|
|
1639
1695
|
key: 'verifyReferralCode',
|
|
1640
1696
|
value: function verifyReferralCode(code) {
|
|
1641
|
-
var
|
|
1642
|
-
api =
|
|
1643
|
-
locationId =
|
|
1644
|
-
env =
|
|
1697
|
+
var _comoData22 = this.comoData,
|
|
1698
|
+
api = _comoData22.api,
|
|
1699
|
+
locationId = _comoData22.locationId,
|
|
1700
|
+
env = _comoData22.env_params;
|
|
1645
1701
|
|
|
1646
1702
|
|
|
1647
1703
|
return api.verifyReferralCode(env.services_root, locationId, code);
|
|
@@ -1655,12 +1711,12 @@ var Como = function () {
|
|
|
1655
1711
|
}, {
|
|
1656
1712
|
key: 'getCredentials',
|
|
1657
1713
|
value: function getCredentials() {
|
|
1658
|
-
var
|
|
1659
|
-
accessToken =
|
|
1660
|
-
refreshToken =
|
|
1661
|
-
expiresIn =
|
|
1662
|
-
consent =
|
|
1663
|
-
locationId =
|
|
1714
|
+
var _comoData23 = this.comoData,
|
|
1715
|
+
accessToken = _comoData23.accessToken,
|
|
1716
|
+
refreshToken = _comoData23.refreshToken,
|
|
1717
|
+
expiresIn = _comoData23.expiresIn,
|
|
1718
|
+
consent = _comoData23.consent,
|
|
1719
|
+
locationId = _comoData23.locationId;
|
|
1664
1720
|
|
|
1665
1721
|
return {
|
|
1666
1722
|
accessToken: accessToken, refreshToken: refreshToken, expiresIn: expiresIn, consent: consent, locationId: locationId
|
|
@@ -1717,27 +1773,27 @@ var Como = function () {
|
|
|
1717
1773
|
}, {
|
|
1718
1774
|
key: 'getRecaptchaConfig',
|
|
1719
1775
|
value: function () {
|
|
1720
|
-
var
|
|
1721
|
-
return _regenerator2.default.wrap(function
|
|
1776
|
+
var _ref29 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee28() {
|
|
1777
|
+
return _regenerator2.default.wrap(function _callee28$(_context28) {
|
|
1722
1778
|
while (1) {
|
|
1723
|
-
switch (
|
|
1779
|
+
switch (_context28.prev = _context28.next) {
|
|
1724
1780
|
case 0:
|
|
1725
|
-
|
|
1781
|
+
_context28.next = 2;
|
|
1726
1782
|
return this.refreshTokenIfNeeded();
|
|
1727
1783
|
|
|
1728
1784
|
case 2:
|
|
1729
|
-
return
|
|
1785
|
+
return _context28.abrupt('return', this.comoData.recaptchaConfig);
|
|
1730
1786
|
|
|
1731
1787
|
case 3:
|
|
1732
1788
|
case 'end':
|
|
1733
|
-
return
|
|
1789
|
+
return _context28.stop();
|
|
1734
1790
|
}
|
|
1735
1791
|
}
|
|
1736
|
-
},
|
|
1792
|
+
}, _callee28, this);
|
|
1737
1793
|
}));
|
|
1738
1794
|
|
|
1739
1795
|
function getRecaptchaConfig() {
|
|
1740
|
-
return
|
|
1796
|
+
return _ref29.apply(this, arguments);
|
|
1741
1797
|
}
|
|
1742
1798
|
|
|
1743
1799
|
return getRecaptchaConfig;
|
|
@@ -1750,33 +1806,33 @@ var Como = function () {
|
|
|
1750
1806
|
}, {
|
|
1751
1807
|
key: 'getRegistrationUrl',
|
|
1752
1808
|
value: function () {
|
|
1753
|
-
var
|
|
1754
|
-
var
|
|
1809
|
+
var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee29(overrides) {
|
|
1810
|
+
var _comoData24, token, installationId, locationId, env;
|
|
1755
1811
|
|
|
1756
|
-
return _regenerator2.default.wrap(function
|
|
1812
|
+
return _regenerator2.default.wrap(function _callee29$(_context29) {
|
|
1757
1813
|
while (1) {
|
|
1758
|
-
switch (
|
|
1814
|
+
switch (_context29.prev = _context29.next) {
|
|
1759
1815
|
case 0:
|
|
1760
|
-
|
|
1816
|
+
_context29.next = 2;
|
|
1761
1817
|
return this.refreshTokenIfNeeded();
|
|
1762
1818
|
|
|
1763
1819
|
case 2:
|
|
1764
|
-
|
|
1765
|
-
return
|
|
1820
|
+
_comoData24 = this.comoData, token = _comoData24.token, installationId = _comoData24.installationId, locationId = _comoData24.locationId, env = _comoData24.env_params;
|
|
1821
|
+
return _context29.abrupt('return', urlsUtils.appendQuery(env.app_modules_root + '/register?token=' + token + '&locationid=' + locationId, (0, _extends3.default)({}, this.getCredentials(), {
|
|
1766
1822
|
installationId: installationId,
|
|
1767
1823
|
disableSuccessScreen: 'true'
|
|
1768
1824
|
}, overrides)));
|
|
1769
1825
|
|
|
1770
1826
|
case 4:
|
|
1771
1827
|
case 'end':
|
|
1772
|
-
return
|
|
1828
|
+
return _context29.stop();
|
|
1773
1829
|
}
|
|
1774
1830
|
}
|
|
1775
|
-
},
|
|
1831
|
+
}, _callee29, this);
|
|
1776
1832
|
}));
|
|
1777
1833
|
|
|
1778
|
-
function getRegistrationUrl(
|
|
1779
|
-
return
|
|
1834
|
+
function getRegistrationUrl(_x51) {
|
|
1835
|
+
return _ref30.apply(this, arguments);
|
|
1780
1836
|
}
|
|
1781
1837
|
|
|
1782
1838
|
return getRegistrationUrl;
|
|
@@ -1789,33 +1845,33 @@ var Como = function () {
|
|
|
1789
1845
|
}, {
|
|
1790
1846
|
key: 'getProfileUrl',
|
|
1791
1847
|
value: function () {
|
|
1792
|
-
var
|
|
1793
|
-
var
|
|
1848
|
+
var _ref31 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee30(overrides) {
|
|
1849
|
+
var _comoData25, token, installationId, locationId, env;
|
|
1794
1850
|
|
|
1795
|
-
return _regenerator2.default.wrap(function
|
|
1851
|
+
return _regenerator2.default.wrap(function _callee30$(_context30) {
|
|
1796
1852
|
while (1) {
|
|
1797
|
-
switch (
|
|
1853
|
+
switch (_context30.prev = _context30.next) {
|
|
1798
1854
|
case 0:
|
|
1799
|
-
|
|
1855
|
+
_context30.next = 2;
|
|
1800
1856
|
return this.refreshTokenIfNeeded();
|
|
1801
1857
|
|
|
1802
1858
|
case 2:
|
|
1803
|
-
|
|
1804
|
-
return
|
|
1859
|
+
_comoData25 = this.comoData, token = _comoData25.token, installationId = _comoData25.installationId, locationId = _comoData25.locationId, env = _comoData25.env_params;
|
|
1860
|
+
return _context30.abrupt('return', urlsUtils.appendQuery(env.app_modules_root + '/profile?token=' + token + '&locationid=' + locationId, (0, _extends3.default)({}, this.getCredentials(), {
|
|
1805
1861
|
installationId: installationId,
|
|
1806
1862
|
disableSuccessScreen: 'true'
|
|
1807
1863
|
}, overrides)));
|
|
1808
1864
|
|
|
1809
1865
|
case 4:
|
|
1810
1866
|
case 'end':
|
|
1811
|
-
return
|
|
1867
|
+
return _context30.stop();
|
|
1812
1868
|
}
|
|
1813
1869
|
}
|
|
1814
|
-
},
|
|
1870
|
+
}, _callee30, this);
|
|
1815
1871
|
}));
|
|
1816
1872
|
|
|
1817
|
-
function getProfileUrl(
|
|
1818
|
-
return
|
|
1873
|
+
function getProfileUrl(_x52) {
|
|
1874
|
+
return _ref31.apply(this, arguments);
|
|
1819
1875
|
}
|
|
1820
1876
|
|
|
1821
1877
|
return getProfileUrl;
|
|
@@ -1828,30 +1884,30 @@ var Como = function () {
|
|
|
1828
1884
|
}, {
|
|
1829
1885
|
key: 'getLoginUrl',
|
|
1830
1886
|
value: function () {
|
|
1831
|
-
var
|
|
1832
|
-
var
|
|
1887
|
+
var _ref32 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee31() {
|
|
1888
|
+
var _comoData26, token, locationId, env;
|
|
1833
1889
|
|
|
1834
|
-
return _regenerator2.default.wrap(function
|
|
1890
|
+
return _regenerator2.default.wrap(function _callee31$(_context31) {
|
|
1835
1891
|
while (1) {
|
|
1836
|
-
switch (
|
|
1892
|
+
switch (_context31.prev = _context31.next) {
|
|
1837
1893
|
case 0:
|
|
1838
|
-
|
|
1894
|
+
_context31.next = 2;
|
|
1839
1895
|
return this.refreshTokenIfNeeded();
|
|
1840
1896
|
|
|
1841
1897
|
case 2:
|
|
1842
|
-
|
|
1843
|
-
return
|
|
1898
|
+
_comoData26 = this.comoData, token = _comoData26.token, locationId = _comoData26.locationId, env = _comoData26.env_params;
|
|
1899
|
+
return _context31.abrupt('return', env.app_modules_root + '/login?token=' + token + '&locationid=' + locationId);
|
|
1844
1900
|
|
|
1845
1901
|
case 4:
|
|
1846
1902
|
case 'end':
|
|
1847
|
-
return
|
|
1903
|
+
return _context31.stop();
|
|
1848
1904
|
}
|
|
1849
1905
|
}
|
|
1850
|
-
},
|
|
1906
|
+
}, _callee31, this);
|
|
1851
1907
|
}));
|
|
1852
1908
|
|
|
1853
1909
|
function getLoginUrl() {
|
|
1854
|
-
return
|
|
1910
|
+
return _ref32.apply(this, arguments);
|
|
1855
1911
|
}
|
|
1856
1912
|
|
|
1857
1913
|
return getLoginUrl;
|
|
@@ -1864,31 +1920,31 @@ var Como = function () {
|
|
|
1864
1920
|
}, {
|
|
1865
1921
|
key: 'getDataPortabilityUrl',
|
|
1866
1922
|
value: function () {
|
|
1867
|
-
var
|
|
1923
|
+
var _ref33 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(url, overrides) {
|
|
1868
1924
|
var installationId;
|
|
1869
|
-
return _regenerator2.default.wrap(function
|
|
1925
|
+
return _regenerator2.default.wrap(function _callee32$(_context32) {
|
|
1870
1926
|
while (1) {
|
|
1871
|
-
switch (
|
|
1927
|
+
switch (_context32.prev = _context32.next) {
|
|
1872
1928
|
case 0:
|
|
1873
|
-
|
|
1929
|
+
_context32.next = 2;
|
|
1874
1930
|
return this.refreshTokenIfNeeded();
|
|
1875
1931
|
|
|
1876
1932
|
case 2:
|
|
1877
1933
|
installationId = this.comoData.installationId;
|
|
1878
|
-
return
|
|
1934
|
+
return _context32.abrupt('return', urlsUtils.appendQuery('' + url, (0, _extends3.default)({
|
|
1879
1935
|
installationId: installationId
|
|
1880
1936
|
}, overrides)));
|
|
1881
1937
|
|
|
1882
1938
|
case 4:
|
|
1883
1939
|
case 'end':
|
|
1884
|
-
return
|
|
1940
|
+
return _context32.stop();
|
|
1885
1941
|
}
|
|
1886
1942
|
}
|
|
1887
|
-
},
|
|
1943
|
+
}, _callee32, this);
|
|
1888
1944
|
}));
|
|
1889
1945
|
|
|
1890
|
-
function getDataPortabilityUrl(
|
|
1891
|
-
return
|
|
1946
|
+
function getDataPortabilityUrl(_x53, _x54) {
|
|
1947
|
+
return _ref33.apply(this, arguments);
|
|
1892
1948
|
}
|
|
1893
1949
|
|
|
1894
1950
|
return getDataPortabilityUrl;
|
|
@@ -1901,29 +1957,29 @@ var Como = function () {
|
|
|
1901
1957
|
}, {
|
|
1902
1958
|
key: 'getAppModulesLegacyBaseUrl',
|
|
1903
1959
|
value: function () {
|
|
1904
|
-
var
|
|
1960
|
+
var _ref34 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee33() {
|
|
1905
1961
|
var env;
|
|
1906
|
-
return _regenerator2.default.wrap(function
|
|
1962
|
+
return _regenerator2.default.wrap(function _callee33$(_context33) {
|
|
1907
1963
|
while (1) {
|
|
1908
|
-
switch (
|
|
1964
|
+
switch (_context33.prev = _context33.next) {
|
|
1909
1965
|
case 0:
|
|
1910
|
-
|
|
1966
|
+
_context33.next = 2;
|
|
1911
1967
|
return this.refreshTokenIfNeeded();
|
|
1912
1968
|
|
|
1913
1969
|
case 2:
|
|
1914
1970
|
env = this.comoData.env_params;
|
|
1915
|
-
return
|
|
1971
|
+
return _context33.abrupt('return', '' + env.app_modules_legacy_root);
|
|
1916
1972
|
|
|
1917
1973
|
case 4:
|
|
1918
1974
|
case 'end':
|
|
1919
|
-
return
|
|
1975
|
+
return _context33.stop();
|
|
1920
1976
|
}
|
|
1921
1977
|
}
|
|
1922
|
-
},
|
|
1978
|
+
}, _callee33, this);
|
|
1923
1979
|
}));
|
|
1924
1980
|
|
|
1925
1981
|
function getAppModulesLegacyBaseUrl() {
|
|
1926
|
-
return
|
|
1982
|
+
return _ref34.apply(this, arguments);
|
|
1927
1983
|
}
|
|
1928
1984
|
|
|
1929
1985
|
return getAppModulesLegacyBaseUrl;
|
|
@@ -1981,10 +2037,10 @@ var Como = function () {
|
|
|
1981
2037
|
}, {
|
|
1982
2038
|
key: 'getResourceUrl',
|
|
1983
2039
|
value: function getResourceUrl(resourceId, namespace, version) {
|
|
1984
|
-
var
|
|
1985
|
-
api =
|
|
1986
|
-
env =
|
|
1987
|
-
locationId =
|
|
2040
|
+
var _comoData27 = this.comoData,
|
|
2041
|
+
api = _comoData27.api,
|
|
2042
|
+
env = _comoData27.env_params,
|
|
2043
|
+
locationId = _comoData27.locationId;
|
|
1988
2044
|
|
|
1989
2045
|
return api.getResourceUrl(env.services_root_cdn, resourceId, namespace, version, locationId);
|
|
1990
2046
|
}
|
|
@@ -2010,36 +2066,36 @@ var Como = function () {
|
|
|
2010
2066
|
key: 'sendPushChannel',
|
|
2011
2067
|
value: function sendPushChannel(identifier) {
|
|
2012
2068
|
var isFirebaseProjectMigrated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2013
|
-
var
|
|
2014
|
-
api =
|
|
2015
|
-
locationId =
|
|
2016
|
-
env =
|
|
2069
|
+
var _comoData28 = this.comoData,
|
|
2070
|
+
api = _comoData28.api,
|
|
2071
|
+
locationId = _comoData28.locationId,
|
|
2072
|
+
env = _comoData28.env_params;
|
|
2017
2073
|
|
|
2018
2074
|
return api.sendPushChannel(env.services_root, locationId, identifier, isFirebaseProjectMigrated);
|
|
2019
2075
|
}
|
|
2020
2076
|
}, {
|
|
2021
2077
|
key: 'getRegionConfig',
|
|
2022
2078
|
value: function () {
|
|
2023
|
-
var
|
|
2024
|
-
var
|
|
2079
|
+
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee34() {
|
|
2080
|
+
var _comoData29, api, locationId, env;
|
|
2025
2081
|
|
|
2026
|
-
return _regenerator2.default.wrap(function
|
|
2082
|
+
return _regenerator2.default.wrap(function _callee34$(_context34) {
|
|
2027
2083
|
while (1) {
|
|
2028
|
-
switch (
|
|
2084
|
+
switch (_context34.prev = _context34.next) {
|
|
2029
2085
|
case 0:
|
|
2030
|
-
|
|
2031
|
-
return
|
|
2086
|
+
_comoData29 = this.comoData, api = _comoData29.api, locationId = _comoData29.locationId, env = _comoData29.env_params;
|
|
2087
|
+
return _context34.abrupt('return', api.getClientBusinessBackend(env.zapp_root, locationId));
|
|
2032
2088
|
|
|
2033
2089
|
case 2:
|
|
2034
2090
|
case 'end':
|
|
2035
|
-
return
|
|
2091
|
+
return _context34.stop();
|
|
2036
2092
|
}
|
|
2037
2093
|
}
|
|
2038
|
-
},
|
|
2094
|
+
}, _callee34, this);
|
|
2039
2095
|
}));
|
|
2040
2096
|
|
|
2041
2097
|
function getRegionConfig() {
|
|
2042
|
-
return
|
|
2098
|
+
return _ref35.apply(this, arguments);
|
|
2043
2099
|
}
|
|
2044
2100
|
|
|
2045
2101
|
return getRegionConfig;
|
|
@@ -2052,36 +2108,36 @@ var Como = function () {
|
|
|
2052
2108
|
}, {
|
|
2053
2109
|
key: 'sendCouponCode',
|
|
2054
2110
|
value: function sendCouponCode(code) {
|
|
2055
|
-
var
|
|
2056
|
-
api =
|
|
2057
|
-
locationId =
|
|
2058
|
-
env =
|
|
2111
|
+
var _comoData30 = this.comoData,
|
|
2112
|
+
api = _comoData30.api,
|
|
2113
|
+
locationId = _comoData30.locationId,
|
|
2114
|
+
env = _comoData30.env_params;
|
|
2059
2115
|
|
|
2060
2116
|
return api.sendCouponCode(env.zapp_root, locationId, code);
|
|
2061
2117
|
}
|
|
2062
2118
|
}, {
|
|
2063
2119
|
key: 'addPaymentMethod',
|
|
2064
2120
|
value: function () {
|
|
2065
|
-
var
|
|
2066
|
-
var
|
|
2121
|
+
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee35(cardToken) {
|
|
2122
|
+
var _comoData31, api, locationId, token, env;
|
|
2067
2123
|
|
|
2068
|
-
return _regenerator2.default.wrap(function
|
|
2124
|
+
return _regenerator2.default.wrap(function _callee35$(_context35) {
|
|
2069
2125
|
while (1) {
|
|
2070
|
-
switch (
|
|
2126
|
+
switch (_context35.prev = _context35.next) {
|
|
2071
2127
|
case 0:
|
|
2072
|
-
|
|
2073
|
-
return
|
|
2128
|
+
_comoData31 = this.comoData, api = _comoData31.api, locationId = _comoData31.locationId, token = _comoData31.token, env = _comoData31.env_params;
|
|
2129
|
+
return _context35.abrupt('return', api.addPaymentMethod(env.services_root, locationId, token, cardToken));
|
|
2074
2130
|
|
|
2075
2131
|
case 2:
|
|
2076
2132
|
case 'end':
|
|
2077
|
-
return
|
|
2133
|
+
return _context35.stop();
|
|
2078
2134
|
}
|
|
2079
2135
|
}
|
|
2080
|
-
},
|
|
2136
|
+
}, _callee35, this);
|
|
2081
2137
|
}));
|
|
2082
2138
|
|
|
2083
|
-
function addPaymentMethod(
|
|
2084
|
-
return
|
|
2139
|
+
function addPaymentMethod(_x56) {
|
|
2140
|
+
return _ref36.apply(this, arguments);
|
|
2085
2141
|
}
|
|
2086
2142
|
|
|
2087
2143
|
return addPaymentMethod;
|
|
@@ -2089,26 +2145,26 @@ var Como = function () {
|
|
|
2089
2145
|
}, {
|
|
2090
2146
|
key: 'knowYourData',
|
|
2091
2147
|
value: function () {
|
|
2092
|
-
var
|
|
2093
|
-
var
|
|
2148
|
+
var _ref37 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee36(email) {
|
|
2149
|
+
var _comoData32, api, locationId, env;
|
|
2094
2150
|
|
|
2095
|
-
return _regenerator2.default.wrap(function
|
|
2151
|
+
return _regenerator2.default.wrap(function _callee36$(_context36) {
|
|
2096
2152
|
while (1) {
|
|
2097
|
-
switch (
|
|
2153
|
+
switch (_context36.prev = _context36.next) {
|
|
2098
2154
|
case 0:
|
|
2099
|
-
|
|
2100
|
-
return
|
|
2155
|
+
_comoData32 = this.comoData, api = _comoData32.api, locationId = _comoData32.locationId, env = _comoData32.env_params;
|
|
2156
|
+
return _context36.abrupt('return', api.knowYourData(env.services_root, locationId, email));
|
|
2101
2157
|
|
|
2102
2158
|
case 2:
|
|
2103
2159
|
case 'end':
|
|
2104
|
-
return
|
|
2160
|
+
return _context36.stop();
|
|
2105
2161
|
}
|
|
2106
2162
|
}
|
|
2107
|
-
},
|
|
2163
|
+
}, _callee36, this);
|
|
2108
2164
|
}));
|
|
2109
2165
|
|
|
2110
|
-
function knowYourData(
|
|
2111
|
-
return
|
|
2166
|
+
function knowYourData(_x57) {
|
|
2167
|
+
return _ref37.apply(this, arguments);
|
|
2112
2168
|
}
|
|
2113
2169
|
|
|
2114
2170
|
return knowYourData;
|
|
@@ -2116,26 +2172,26 @@ var Como = function () {
|
|
|
2116
2172
|
}, {
|
|
2117
2173
|
key: 'consentWithdraw',
|
|
2118
2174
|
value: function () {
|
|
2119
|
-
var
|
|
2120
|
-
var
|
|
2175
|
+
var _ref38 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee37(consentData) {
|
|
2176
|
+
var _comoData33, api, locationId, env;
|
|
2121
2177
|
|
|
2122
|
-
return _regenerator2.default.wrap(function
|
|
2178
|
+
return _regenerator2.default.wrap(function _callee37$(_context37) {
|
|
2123
2179
|
while (1) {
|
|
2124
|
-
switch (
|
|
2180
|
+
switch (_context37.prev = _context37.next) {
|
|
2125
2181
|
case 0:
|
|
2126
|
-
|
|
2127
|
-
return
|
|
2182
|
+
_comoData33 = this.comoData, api = _comoData33.api, locationId = _comoData33.locationId, env = _comoData33.env_params;
|
|
2183
|
+
return _context37.abrupt('return', api.consentWithdraw(env.services_root, locationId, consentData));
|
|
2128
2184
|
|
|
2129
2185
|
case 2:
|
|
2130
2186
|
case 'end':
|
|
2131
|
-
return
|
|
2187
|
+
return _context37.stop();
|
|
2132
2188
|
}
|
|
2133
2189
|
}
|
|
2134
|
-
},
|
|
2190
|
+
}, _callee37, this);
|
|
2135
2191
|
}));
|
|
2136
2192
|
|
|
2137
|
-
function consentWithdraw(
|
|
2138
|
-
return
|
|
2193
|
+
function consentWithdraw(_x58) {
|
|
2194
|
+
return _ref38.apply(this, arguments);
|
|
2139
2195
|
}
|
|
2140
2196
|
|
|
2141
2197
|
return consentWithdraw;
|
|
@@ -2143,31 +2199,31 @@ var Como = function () {
|
|
|
2143
2199
|
}, {
|
|
2144
2200
|
key: 'getPaymentMethods',
|
|
2145
2201
|
value: function () {
|
|
2146
|
-
var
|
|
2147
|
-
var
|
|
2202
|
+
var _ref39 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee38() {
|
|
2203
|
+
var _comoData34, env, locationId, api, responseJson;
|
|
2148
2204
|
|
|
2149
|
-
return _regenerator2.default.wrap(function
|
|
2205
|
+
return _regenerator2.default.wrap(function _callee38$(_context38) {
|
|
2150
2206
|
while (1) {
|
|
2151
|
-
switch (
|
|
2207
|
+
switch (_context38.prev = _context38.next) {
|
|
2152
2208
|
case 0:
|
|
2153
|
-
|
|
2154
|
-
|
|
2209
|
+
_comoData34 = this.comoData, env = _comoData34.env_params, locationId = _comoData34.locationId, api = _comoData34.api;
|
|
2210
|
+
_context38.next = 3;
|
|
2155
2211
|
return api.getPaymentMethods(env.services_root, locationId);
|
|
2156
2212
|
|
|
2157
2213
|
case 3:
|
|
2158
|
-
responseJson =
|
|
2159
|
-
return
|
|
2214
|
+
responseJson = _context38.sent;
|
|
2215
|
+
return _context38.abrupt('return', responseJson);
|
|
2160
2216
|
|
|
2161
2217
|
case 5:
|
|
2162
2218
|
case 'end':
|
|
2163
|
-
return
|
|
2219
|
+
return _context38.stop();
|
|
2164
2220
|
}
|
|
2165
2221
|
}
|
|
2166
|
-
},
|
|
2222
|
+
}, _callee38, this);
|
|
2167
2223
|
}));
|
|
2168
2224
|
|
|
2169
2225
|
function getPaymentMethods() {
|
|
2170
|
-
return
|
|
2226
|
+
return _ref39.apply(this, arguments);
|
|
2171
2227
|
}
|
|
2172
2228
|
|
|
2173
2229
|
return getPaymentMethods;
|
|
@@ -2184,31 +2240,31 @@ var Como = function () {
|
|
|
2184
2240
|
}, {
|
|
2185
2241
|
key: 'payInApp',
|
|
2186
2242
|
value: function () {
|
|
2187
|
-
var
|
|
2188
|
-
var
|
|
2243
|
+
var _ref40 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee39(amount, creditCardToken, itemName, itemNumber, membershipKey) {
|
|
2244
|
+
var _comoData35, env, token, locationId, api, responseJson;
|
|
2189
2245
|
|
|
2190
|
-
return _regenerator2.default.wrap(function
|
|
2246
|
+
return _regenerator2.default.wrap(function _callee39$(_context39) {
|
|
2191
2247
|
while (1) {
|
|
2192
|
-
switch (
|
|
2248
|
+
switch (_context39.prev = _context39.next) {
|
|
2193
2249
|
case 0:
|
|
2194
|
-
|
|
2195
|
-
|
|
2250
|
+
_comoData35 = this.comoData, env = _comoData35.env_params, token = _comoData35.token, locationId = _comoData35.locationId, api = _comoData35.api;
|
|
2251
|
+
_context39.next = 3;
|
|
2196
2252
|
return api.payInApp(env.services_root, locationId, token, amount, creditCardToken, itemName, itemNumber, membershipKey);
|
|
2197
2253
|
|
|
2198
2254
|
case 3:
|
|
2199
|
-
responseJson =
|
|
2200
|
-
return
|
|
2255
|
+
responseJson = _context39.sent;
|
|
2256
|
+
return _context39.abrupt('return', responseJson);
|
|
2201
2257
|
|
|
2202
2258
|
case 5:
|
|
2203
2259
|
case 'end':
|
|
2204
|
-
return
|
|
2260
|
+
return _context39.stop();
|
|
2205
2261
|
}
|
|
2206
2262
|
}
|
|
2207
|
-
},
|
|
2263
|
+
}, _callee39, this);
|
|
2208
2264
|
}));
|
|
2209
2265
|
|
|
2210
|
-
function payInApp(
|
|
2211
|
-
return
|
|
2266
|
+
function payInApp(_x59, _x60, _x61, _x62, _x63) {
|
|
2267
|
+
return _ref40.apply(this, arguments);
|
|
2212
2268
|
}
|
|
2213
2269
|
|
|
2214
2270
|
return payInApp;
|
|
@@ -2221,31 +2277,31 @@ var Como = function () {
|
|
|
2221
2277
|
}, {
|
|
2222
2278
|
key: 'deletePayment',
|
|
2223
2279
|
value: function () {
|
|
2224
|
-
var
|
|
2225
|
-
var
|
|
2280
|
+
var _ref41 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee40(creditCardToken) {
|
|
2281
|
+
var _comoData36, env, token, locationId, api, responseJson;
|
|
2226
2282
|
|
|
2227
|
-
return _regenerator2.default.wrap(function
|
|
2283
|
+
return _regenerator2.default.wrap(function _callee40$(_context40) {
|
|
2228
2284
|
while (1) {
|
|
2229
|
-
switch (
|
|
2285
|
+
switch (_context40.prev = _context40.next) {
|
|
2230
2286
|
case 0:
|
|
2231
|
-
|
|
2232
|
-
|
|
2287
|
+
_comoData36 = this.comoData, env = _comoData36.env_params, token = _comoData36.token, locationId = _comoData36.locationId, api = _comoData36.api;
|
|
2288
|
+
_context40.next = 3;
|
|
2233
2289
|
return api.deletePayment(env.services_root, locationId, token, creditCardToken);
|
|
2234
2290
|
|
|
2235
2291
|
case 3:
|
|
2236
|
-
responseJson =
|
|
2237
|
-
return
|
|
2292
|
+
responseJson = _context40.sent;
|
|
2293
|
+
return _context40.abrupt('return', responseJson);
|
|
2238
2294
|
|
|
2239
2295
|
case 5:
|
|
2240
2296
|
case 'end':
|
|
2241
|
-
return
|
|
2297
|
+
return _context40.stop();
|
|
2242
2298
|
}
|
|
2243
2299
|
}
|
|
2244
|
-
},
|
|
2300
|
+
}, _callee40, this);
|
|
2245
2301
|
}));
|
|
2246
2302
|
|
|
2247
|
-
function deletePayment(
|
|
2248
|
-
return
|
|
2303
|
+
function deletePayment(_x64) {
|
|
2304
|
+
return _ref41.apply(this, arguments);
|
|
2249
2305
|
}
|
|
2250
2306
|
|
|
2251
2307
|
return deletePayment;
|
|
@@ -2257,32 +2313,32 @@ var Como = function () {
|
|
|
2257
2313
|
}, {
|
|
2258
2314
|
key: 'getMemberMessages',
|
|
2259
2315
|
value: function () {
|
|
2260
|
-
var
|
|
2316
|
+
var _ref42 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee41(tag, limit, offset) {
|
|
2261
2317
|
var fetchExpiredMessages = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
2262
2318
|
|
|
2263
|
-
var
|
|
2319
|
+
var _comoData37, api, locationId, env;
|
|
2264
2320
|
|
|
2265
|
-
return _regenerator2.default.wrap(function
|
|
2321
|
+
return _regenerator2.default.wrap(function _callee41$(_context41) {
|
|
2266
2322
|
while (1) {
|
|
2267
|
-
switch (
|
|
2323
|
+
switch (_context41.prev = _context41.next) {
|
|
2268
2324
|
case 0:
|
|
2269
|
-
|
|
2270
|
-
|
|
2325
|
+
_comoData37 = this.comoData, api = _comoData37.api, locationId = _comoData37.locationId, env = _comoData37.env_params;
|
|
2326
|
+
_context41.next = 3;
|
|
2271
2327
|
return this.refreshTokenIfNeeded();
|
|
2272
2328
|
|
|
2273
2329
|
case 3:
|
|
2274
|
-
return
|
|
2330
|
+
return _context41.abrupt('return', api.getMemberMessages(env.services_root, locationId, tag, limit, offset, fetchExpiredMessages));
|
|
2275
2331
|
|
|
2276
2332
|
case 4:
|
|
2277
2333
|
case 'end':
|
|
2278
|
-
return
|
|
2334
|
+
return _context41.stop();
|
|
2279
2335
|
}
|
|
2280
2336
|
}
|
|
2281
|
-
},
|
|
2337
|
+
}, _callee41, this);
|
|
2282
2338
|
}));
|
|
2283
2339
|
|
|
2284
|
-
function getMemberMessages(
|
|
2285
|
-
return
|
|
2340
|
+
function getMemberMessages(_x65, _x66, _x67) {
|
|
2341
|
+
return _ref42.apply(this, arguments);
|
|
2286
2342
|
}
|
|
2287
2343
|
|
|
2288
2344
|
return getMemberMessages;
|
|
@@ -2295,10 +2351,10 @@ var Como = function () {
|
|
|
2295
2351
|
}, {
|
|
2296
2352
|
key: 'markAsReadMemberMessages',
|
|
2297
2353
|
value: function markAsReadMemberMessages(keysList) {
|
|
2298
|
-
var
|
|
2299
|
-
api =
|
|
2300
|
-
locationId =
|
|
2301
|
-
env =
|
|
2354
|
+
var _comoData38 = this.comoData,
|
|
2355
|
+
api = _comoData38.api,
|
|
2356
|
+
locationId = _comoData38.locationId,
|
|
2357
|
+
env = _comoData38.env_params;
|
|
2302
2358
|
|
|
2303
2359
|
return api.markAsReadMemberMessages(env.services_root, locationId, keysList);
|
|
2304
2360
|
}
|
|
@@ -2313,26 +2369,26 @@ var Como = function () {
|
|
|
2313
2369
|
}, {
|
|
2314
2370
|
key: 'budgetTransfer',
|
|
2315
2371
|
value: function () {
|
|
2316
|
-
var
|
|
2317
|
-
var
|
|
2372
|
+
var _ref43 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee42(receiver, sender, amount, wallet) {
|
|
2373
|
+
var _comoData39, api, locationId, env;
|
|
2318
2374
|
|
|
2319
|
-
return _regenerator2.default.wrap(function
|
|
2375
|
+
return _regenerator2.default.wrap(function _callee42$(_context42) {
|
|
2320
2376
|
while (1) {
|
|
2321
|
-
switch (
|
|
2377
|
+
switch (_context42.prev = _context42.next) {
|
|
2322
2378
|
case 0:
|
|
2323
|
-
|
|
2324
|
-
return
|
|
2379
|
+
_comoData39 = this.comoData, api = _comoData39.api, locationId = _comoData39.locationId, env = _comoData39.env_params;
|
|
2380
|
+
return _context42.abrupt('return', api.budgetTransfer(env.services_root, locationId, receiver, sender, amount, wallet));
|
|
2325
2381
|
|
|
2326
2382
|
case 2:
|
|
2327
2383
|
case 'end':
|
|
2328
|
-
return
|
|
2384
|
+
return _context42.stop();
|
|
2329
2385
|
}
|
|
2330
2386
|
}
|
|
2331
|
-
},
|
|
2387
|
+
}, _callee42, this);
|
|
2332
2388
|
}));
|
|
2333
2389
|
|
|
2334
|
-
function budgetTransfer(
|
|
2335
|
-
return
|
|
2390
|
+
function budgetTransfer(_x69, _x70, _x71, _x72) {
|
|
2391
|
+
return _ref43.apply(this, arguments);
|
|
2336
2392
|
}
|
|
2337
2393
|
|
|
2338
2394
|
return budgetTransfer;
|
|
@@ -2345,9 +2401,9 @@ var Como = function () {
|
|
|
2345
2401
|
}, {
|
|
2346
2402
|
key: 'getCreditClaimData',
|
|
2347
2403
|
value: function getCreditClaimData(claimId) {
|
|
2348
|
-
var
|
|
2349
|
-
api =
|
|
2350
|
-
env =
|
|
2404
|
+
var _comoData40 = this.comoData,
|
|
2405
|
+
api = _comoData40.api,
|
|
2406
|
+
env = _comoData40.env_params;
|
|
2351
2407
|
|
|
2352
2408
|
return api.getCreditClaimData(env.services_root, claimId);
|
|
2353
2409
|
}
|
|
@@ -2359,26 +2415,26 @@ var Como = function () {
|
|
|
2359
2415
|
}, {
|
|
2360
2416
|
key: 'budgetTransferClaim',
|
|
2361
2417
|
value: function () {
|
|
2362
|
-
var
|
|
2363
|
-
var
|
|
2418
|
+
var _ref44 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee43(claimCode) {
|
|
2419
|
+
var _comoData41, api, locationId, env;
|
|
2364
2420
|
|
|
2365
|
-
return _regenerator2.default.wrap(function
|
|
2421
|
+
return _regenerator2.default.wrap(function _callee43$(_context43) {
|
|
2366
2422
|
while (1) {
|
|
2367
|
-
switch (
|
|
2423
|
+
switch (_context43.prev = _context43.next) {
|
|
2368
2424
|
case 0:
|
|
2369
|
-
|
|
2370
|
-
return
|
|
2425
|
+
_comoData41 = this.comoData, api = _comoData41.api, locationId = _comoData41.locationId, env = _comoData41.env_params;
|
|
2426
|
+
return _context43.abrupt('return', api.budgetTransferClaim(env.services_root, locationId, claimCode));
|
|
2371
2427
|
|
|
2372
2428
|
case 2:
|
|
2373
2429
|
case 'end':
|
|
2374
|
-
return
|
|
2430
|
+
return _context43.stop();
|
|
2375
2431
|
}
|
|
2376
2432
|
}
|
|
2377
|
-
},
|
|
2433
|
+
}, _callee43, this);
|
|
2378
2434
|
}));
|
|
2379
2435
|
|
|
2380
|
-
function budgetTransferClaim(
|
|
2381
|
-
return
|
|
2436
|
+
function budgetTransferClaim(_x73) {
|
|
2437
|
+
return _ref44.apply(this, arguments);
|
|
2382
2438
|
}
|
|
2383
2439
|
|
|
2384
2440
|
return budgetTransferClaim;
|
|
@@ -2394,10 +2450,10 @@ var Como = function () {
|
|
|
2394
2450
|
}, {
|
|
2395
2451
|
key: 'claim',
|
|
2396
2452
|
value: function claim(assetKey, itemId, tag) {
|
|
2397
|
-
var
|
|
2398
|
-
env =
|
|
2399
|
-
locationId =
|
|
2400
|
-
api =
|
|
2453
|
+
var _comoData42 = this.comoData,
|
|
2454
|
+
env = _comoData42.env_params,
|
|
2455
|
+
locationId = _comoData42.locationId,
|
|
2456
|
+
api = _comoData42.api;
|
|
2401
2457
|
|
|
2402
2458
|
return api.claim(env.zapp_root, locationId, assetKey, itemId, tag);
|
|
2403
2459
|
}
|
|
@@ -2411,26 +2467,26 @@ var Como = function () {
|
|
|
2411
2467
|
}, {
|
|
2412
2468
|
key: 'logUserAction',
|
|
2413
2469
|
value: function () {
|
|
2414
|
-
var
|
|
2415
|
-
var
|
|
2470
|
+
var _ref45 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee44(action, logData) {
|
|
2471
|
+
var _comoData43, env, locationId, api;
|
|
2416
2472
|
|
|
2417
|
-
return _regenerator2.default.wrap(function
|
|
2473
|
+
return _regenerator2.default.wrap(function _callee44$(_context44) {
|
|
2418
2474
|
while (1) {
|
|
2419
|
-
switch (
|
|
2475
|
+
switch (_context44.prev = _context44.next) {
|
|
2420
2476
|
case 0:
|
|
2421
|
-
|
|
2422
|
-
return
|
|
2477
|
+
_comoData43 = this.comoData, env = _comoData43.env_params, locationId = _comoData43.locationId, api = _comoData43.api;
|
|
2478
|
+
return _context44.abrupt('return', api.logUserAction(env.zapp_root, locationId, action, logData));
|
|
2423
2479
|
|
|
2424
2480
|
case 2:
|
|
2425
2481
|
case 'end':
|
|
2426
|
-
return
|
|
2482
|
+
return _context44.stop();
|
|
2427
2483
|
}
|
|
2428
2484
|
}
|
|
2429
|
-
},
|
|
2485
|
+
}, _callee44, this);
|
|
2430
2486
|
}));
|
|
2431
2487
|
|
|
2432
|
-
function logUserAction(
|
|
2433
|
-
return
|
|
2488
|
+
function logUserAction(_x74, _x75) {
|
|
2489
|
+
return _ref45.apply(this, arguments);
|
|
2434
2490
|
}
|
|
2435
2491
|
|
|
2436
2492
|
return logUserAction;
|
|
@@ -2445,26 +2501,26 @@ var Como = function () {
|
|
|
2445
2501
|
}, {
|
|
2446
2502
|
key: 'getPurchaseHistory',
|
|
2447
2503
|
value: function () {
|
|
2448
|
-
var
|
|
2449
|
-
var
|
|
2504
|
+
var _ref46 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee45(limit, offset) {
|
|
2505
|
+
var _comoData44, locationId, api, membership;
|
|
2450
2506
|
|
|
2451
|
-
return _regenerator2.default.wrap(function
|
|
2507
|
+
return _regenerator2.default.wrap(function _callee45$(_context45) {
|
|
2452
2508
|
while (1) {
|
|
2453
|
-
switch (
|
|
2509
|
+
switch (_context45.prev = _context45.next) {
|
|
2454
2510
|
case 0:
|
|
2455
|
-
|
|
2456
|
-
return
|
|
2511
|
+
_comoData44 = this.comoData, locationId = _comoData44.locationId, api = _comoData44.api, membership = _comoData44.membership;
|
|
2512
|
+
return _context45.abrupt('return', api.getPurchaseHistory(locationId, membership.Key, limit, offset));
|
|
2457
2513
|
|
|
2458
2514
|
case 2:
|
|
2459
2515
|
case 'end':
|
|
2460
|
-
return
|
|
2516
|
+
return _context45.stop();
|
|
2461
2517
|
}
|
|
2462
2518
|
}
|
|
2463
|
-
},
|
|
2519
|
+
}, _callee45, this);
|
|
2464
2520
|
}));
|
|
2465
2521
|
|
|
2466
|
-
function getPurchaseHistory(
|
|
2467
|
-
return
|
|
2522
|
+
function getPurchaseHistory(_x76, _x77) {
|
|
2523
|
+
return _ref46.apply(this, arguments);
|
|
2468
2524
|
}
|
|
2469
2525
|
|
|
2470
2526
|
return getPurchaseHistory;
|
|
@@ -2477,9 +2533,9 @@ var Como = function () {
|
|
|
2477
2533
|
}, {
|
|
2478
2534
|
key: 'getAppTextsV2',
|
|
2479
2535
|
value: function getAppTextsV2() {
|
|
2480
|
-
var
|
|
2481
|
-
api =
|
|
2482
|
-
locationId =
|
|
2536
|
+
var _comoData45 = this.comoData,
|
|
2537
|
+
api = _comoData45.api,
|
|
2538
|
+
locationId = _comoData45.locationId;
|
|
2483
2539
|
|
|
2484
2540
|
return api.getAllTranslations(locationId);
|
|
2485
2541
|
}
|
|
@@ -2493,28 +2549,28 @@ var Como = function () {
|
|
|
2493
2549
|
}, {
|
|
2494
2550
|
key: 'generateTemporaryToken',
|
|
2495
2551
|
value: function () {
|
|
2496
|
-
var
|
|
2552
|
+
var _ref47 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee46() {
|
|
2497
2553
|
var timeToLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
|
|
2498
2554
|
|
|
2499
|
-
var
|
|
2555
|
+
var _comoData46, api, locationId, env;
|
|
2500
2556
|
|
|
2501
|
-
return _regenerator2.default.wrap(function
|
|
2557
|
+
return _regenerator2.default.wrap(function _callee46$(_context46) {
|
|
2502
2558
|
while (1) {
|
|
2503
|
-
switch (
|
|
2559
|
+
switch (_context46.prev = _context46.next) {
|
|
2504
2560
|
case 0:
|
|
2505
|
-
|
|
2506
|
-
return
|
|
2561
|
+
_comoData46 = this.comoData, api = _comoData46.api, locationId = _comoData46.locationId, env = _comoData46.env_params;
|
|
2562
|
+
return _context46.abrupt('return', api.generateTemporaryToken(env.services_root, locationId, timeToLive));
|
|
2507
2563
|
|
|
2508
2564
|
case 2:
|
|
2509
2565
|
case 'end':
|
|
2510
|
-
return
|
|
2566
|
+
return _context46.stop();
|
|
2511
2567
|
}
|
|
2512
2568
|
}
|
|
2513
|
-
},
|
|
2569
|
+
}, _callee46, this);
|
|
2514
2570
|
}));
|
|
2515
2571
|
|
|
2516
2572
|
function generateTemporaryToken() {
|
|
2517
|
-
return
|
|
2573
|
+
return _ref47.apply(this, arguments);
|
|
2518
2574
|
}
|
|
2519
2575
|
|
|
2520
2576
|
return generateTemporaryToken;
|