@como/como-client 0.7.62 → 0.7.64
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 +56 -39
- package/lib/interceptors/refresh.js +1 -1
- package/lib/services/index.js +1 -1
- package/package.json +1 -1
- package/src/como.js +1 -1
package/lib/como.js
CHANGED
|
@@ -2121,14 +2121,31 @@ var Como = function () {
|
|
|
2121
2121
|
|
|
2122
2122
|
}, {
|
|
2123
2123
|
key: 'getMemberMessages',
|
|
2124
|
-
value: function
|
|
2125
|
-
var
|
|
2126
|
-
|
|
2127
|
-
locationId = _comoData36.locationId,
|
|
2128
|
-
env = _comoData36.env_params;
|
|
2124
|
+
value: function () {
|
|
2125
|
+
var _ref39 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee38(tag, limit, offset) {
|
|
2126
|
+
var _comoData36, api, locationId, env;
|
|
2129
2127
|
|
|
2130
|
-
|
|
2131
|
-
|
|
2128
|
+
return _regenerator2.default.wrap(function _callee38$(_context38) {
|
|
2129
|
+
while (1) {
|
|
2130
|
+
switch (_context38.prev = _context38.next) {
|
|
2131
|
+
case 0:
|
|
2132
|
+
_comoData36 = this.comoData, api = _comoData36.api, locationId = _comoData36.locationId, env = _comoData36.env_params;
|
|
2133
|
+
return _context38.abrupt('return', api.getMemberMessages(env.services_root, locationId, tag, limit, offset));
|
|
2134
|
+
|
|
2135
|
+
case 2:
|
|
2136
|
+
case 'end':
|
|
2137
|
+
return _context38.stop();
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
}, _callee38, this);
|
|
2141
|
+
}));
|
|
2142
|
+
|
|
2143
|
+
function getMemberMessages(_x55, _x56, _x57) {
|
|
2144
|
+
return _ref39.apply(this, arguments);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
return getMemberMessages;
|
|
2148
|
+
}()
|
|
2132
2149
|
|
|
2133
2150
|
/**
|
|
2134
2151
|
* @param {string} keysList keys of the messages to mark as read
|
|
@@ -2155,26 +2172,26 @@ var Como = function () {
|
|
|
2155
2172
|
}, {
|
|
2156
2173
|
key: 'budgetTransfer',
|
|
2157
2174
|
value: function () {
|
|
2158
|
-
var
|
|
2175
|
+
var _ref40 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee39(receiver, sender, amount, wallet) {
|
|
2159
2176
|
var _comoData38, api, locationId, env;
|
|
2160
2177
|
|
|
2161
|
-
return _regenerator2.default.wrap(function
|
|
2178
|
+
return _regenerator2.default.wrap(function _callee39$(_context39) {
|
|
2162
2179
|
while (1) {
|
|
2163
|
-
switch (
|
|
2180
|
+
switch (_context39.prev = _context39.next) {
|
|
2164
2181
|
case 0:
|
|
2165
2182
|
_comoData38 = this.comoData, api = _comoData38.api, locationId = _comoData38.locationId, env = _comoData38.env_params;
|
|
2166
|
-
return
|
|
2183
|
+
return _context39.abrupt('return', api.budgetTransfer(env.services_root, locationId, receiver, sender, amount, wallet));
|
|
2167
2184
|
|
|
2168
2185
|
case 2:
|
|
2169
2186
|
case 'end':
|
|
2170
|
-
return
|
|
2187
|
+
return _context39.stop();
|
|
2171
2188
|
}
|
|
2172
2189
|
}
|
|
2173
|
-
},
|
|
2190
|
+
}, _callee39, this);
|
|
2174
2191
|
}));
|
|
2175
2192
|
|
|
2176
|
-
function budgetTransfer(
|
|
2177
|
-
return
|
|
2193
|
+
function budgetTransfer(_x58, _x59, _x60, _x61) {
|
|
2194
|
+
return _ref40.apply(this, arguments);
|
|
2178
2195
|
}
|
|
2179
2196
|
|
|
2180
2197
|
return budgetTransfer;
|
|
@@ -2201,26 +2218,26 @@ var Como = function () {
|
|
|
2201
2218
|
}, {
|
|
2202
2219
|
key: 'budgetTransferClaim',
|
|
2203
2220
|
value: function () {
|
|
2204
|
-
var
|
|
2221
|
+
var _ref41 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee40(claimCode) {
|
|
2205
2222
|
var _comoData40, api, locationId, env;
|
|
2206
2223
|
|
|
2207
|
-
return _regenerator2.default.wrap(function
|
|
2224
|
+
return _regenerator2.default.wrap(function _callee40$(_context40) {
|
|
2208
2225
|
while (1) {
|
|
2209
|
-
switch (
|
|
2226
|
+
switch (_context40.prev = _context40.next) {
|
|
2210
2227
|
case 0:
|
|
2211
2228
|
_comoData40 = this.comoData, api = _comoData40.api, locationId = _comoData40.locationId, env = _comoData40.env_params;
|
|
2212
|
-
return
|
|
2229
|
+
return _context40.abrupt('return', api.budgetTransferClaim(env.services_root, locationId, claimCode));
|
|
2213
2230
|
|
|
2214
2231
|
case 2:
|
|
2215
2232
|
case 'end':
|
|
2216
|
-
return
|
|
2233
|
+
return _context40.stop();
|
|
2217
2234
|
}
|
|
2218
2235
|
}
|
|
2219
|
-
},
|
|
2236
|
+
}, _callee40, this);
|
|
2220
2237
|
}));
|
|
2221
2238
|
|
|
2222
|
-
function budgetTransferClaim(
|
|
2223
|
-
return
|
|
2239
|
+
function budgetTransferClaim(_x62) {
|
|
2240
|
+
return _ref41.apply(this, arguments);
|
|
2224
2241
|
}
|
|
2225
2242
|
|
|
2226
2243
|
return budgetTransferClaim;
|
|
@@ -2254,26 +2271,26 @@ var Como = function () {
|
|
|
2254
2271
|
}, {
|
|
2255
2272
|
key: 'logUserAction',
|
|
2256
2273
|
value: function () {
|
|
2257
|
-
var
|
|
2274
|
+
var _ref42 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee41(action, logData) {
|
|
2258
2275
|
var _comoData42, env, locationId, api, token;
|
|
2259
2276
|
|
|
2260
|
-
return _regenerator2.default.wrap(function
|
|
2277
|
+
return _regenerator2.default.wrap(function _callee41$(_context41) {
|
|
2261
2278
|
while (1) {
|
|
2262
|
-
switch (
|
|
2279
|
+
switch (_context41.prev = _context41.next) {
|
|
2263
2280
|
case 0:
|
|
2264
2281
|
_comoData42 = this.comoData, env = _comoData42.env_params, locationId = _comoData42.locationId, api = _comoData42.api, token = _comoData42.token;
|
|
2265
|
-
return
|
|
2282
|
+
return _context41.abrupt('return', api.logUserAction(env.zapp_root, locationId, token, action, logData));
|
|
2266
2283
|
|
|
2267
2284
|
case 2:
|
|
2268
2285
|
case 'end':
|
|
2269
|
-
return
|
|
2286
|
+
return _context41.stop();
|
|
2270
2287
|
}
|
|
2271
2288
|
}
|
|
2272
|
-
},
|
|
2289
|
+
}, _callee41, this);
|
|
2273
2290
|
}));
|
|
2274
2291
|
|
|
2275
|
-
function logUserAction(
|
|
2276
|
-
return
|
|
2292
|
+
function logUserAction(_x63, _x64) {
|
|
2293
|
+
return _ref42.apply(this, arguments);
|
|
2277
2294
|
}
|
|
2278
2295
|
|
|
2279
2296
|
return logUserAction;
|
|
@@ -2288,26 +2305,26 @@ var Como = function () {
|
|
|
2288
2305
|
}, {
|
|
2289
2306
|
key: 'getPurchaseHistory',
|
|
2290
2307
|
value: function () {
|
|
2291
|
-
var
|
|
2308
|
+
var _ref43 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee42(limit, offset) {
|
|
2292
2309
|
var _comoData43, locationId, api, membership;
|
|
2293
2310
|
|
|
2294
|
-
return _regenerator2.default.wrap(function
|
|
2311
|
+
return _regenerator2.default.wrap(function _callee42$(_context42) {
|
|
2295
2312
|
while (1) {
|
|
2296
|
-
switch (
|
|
2313
|
+
switch (_context42.prev = _context42.next) {
|
|
2297
2314
|
case 0:
|
|
2298
2315
|
_comoData43 = this.comoData, locationId = _comoData43.locationId, api = _comoData43.api, membership = _comoData43.membership;
|
|
2299
|
-
return
|
|
2316
|
+
return _context42.abrupt('return', api.getPurchaseHistory(locationId, membership.Key, limit, offset));
|
|
2300
2317
|
|
|
2301
2318
|
case 2:
|
|
2302
2319
|
case 'end':
|
|
2303
|
-
return
|
|
2320
|
+
return _context42.stop();
|
|
2304
2321
|
}
|
|
2305
2322
|
}
|
|
2306
|
-
},
|
|
2323
|
+
}, _callee42, this);
|
|
2307
2324
|
}));
|
|
2308
2325
|
|
|
2309
|
-
function getPurchaseHistory(
|
|
2310
|
-
return
|
|
2326
|
+
function getPurchaseHistory(_x65, _x66) {
|
|
2327
|
+
return _ref43.apply(this, arguments);
|
|
2311
2328
|
}
|
|
2312
2329
|
|
|
2313
2330
|
return getPurchaseHistory;
|
|
@@ -22,7 +22,7 @@ var moment = require('moment-timezone');
|
|
|
22
22
|
* @param {string} expires date format
|
|
23
23
|
*/
|
|
24
24
|
var isExpired = function isExpired(expires) {
|
|
25
|
-
return moment(expires).isBefore(moment());
|
|
25
|
+
return moment(expires).subtract(20, 'seconds').isBefore(moment());
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
package/lib/services/index.js
CHANGED
|
@@ -36,7 +36,7 @@ exports.getService = function (baseURL, uid, getCredentials, credentialsRefresh,
|
|
|
36
36
|
var binaryVersion = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'not-defined';
|
|
37
37
|
var phoenixVersion = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'not-defined';
|
|
38
38
|
|
|
39
|
-
var httpClient = axios.create({ baseURL: baseURL, headers: { 'x-comojs-version': version, 'x-binary-version': binaryVersion, 'x-phoenix-version': phoenixVersion } });
|
|
39
|
+
var httpClient = axios.create({ baseURL: baseURL, headers: { 'x-comojs-version': version, 'x-binary-version': binaryVersion, 'x-phoenix-version': phoenixVersion, 'x-phoenix-uid': uid } });
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* TODO: Make refresher prettier.
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -873,7 +873,7 @@ class Como {
|
|
|
873
873
|
/**
|
|
874
874
|
* @param {string} tag for Pop-up Message Trigger (Optional param)
|
|
875
875
|
*/
|
|
876
|
-
getMemberMessages(tag, limit, offset) {
|
|
876
|
+
async getMemberMessages(tag, limit, offset) {
|
|
877
877
|
const {
|
|
878
878
|
api, locationId, env_params: env,
|
|
879
879
|
} = this.comoData;
|