@como/como-client
Advanced tools
Comparing version 0.1.49 to 0.1.50
@@ -1011,2 +1011,62 @@ 'use strict'; | ||
}(); | ||
}; | ||
exports.getUserPointShopDataAPI2 = function (service) { | ||
return function () { | ||
var _ref45 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee31(baseUrl, locationId) { | ||
var url, response; | ||
return _regenerator2.default.wrap(function _callee31$(_context31) { | ||
while (1) { | ||
switch (_context31.prev = _context31.next) { | ||
case 0: | ||
url = baseUrl + '/api/pointShop/member?locationId=' + locationId; | ||
_context31.next = 3; | ||
return service.get(url); | ||
case 3: | ||
response = _context31.sent; | ||
return _context31.abrupt('return', response); | ||
case 5: | ||
case 'end': | ||
return _context31.stop(); | ||
} | ||
} | ||
}, _callee31, undefined); | ||
})); | ||
return function (_x111, _x112) { | ||
return _ref45.apply(this, arguments); | ||
}; | ||
}(); | ||
}; | ||
exports.purchaseAssetAPI2 = function (service) { | ||
return function () { | ||
var _ref46 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(baseUrl, locationId, assetID) { | ||
var url, response; | ||
return _regenerator2.default.wrap(function _callee32$(_context32) { | ||
while (1) { | ||
switch (_context32.prev = _context32.next) { | ||
case 0: | ||
url = baseUrl + '/api/pointShop/purchase/' + assetID + '?locationId=' + locationId; | ||
_context32.next = 3; | ||
return service.post(url); | ||
case 3: | ||
response = _context32.sent; | ||
return _context32.abrupt('return', response); | ||
case 5: | ||
case 'end': | ||
return _context32.stop(); | ||
} | ||
} | ||
}, _callee32, undefined); | ||
})); | ||
return function (_x113, _x114, _x115) { | ||
return _ref46.apply(this, arguments); | ||
}; | ||
}(); | ||
}; |
{ | ||
"name": "@como/como-client", | ||
"version": "0.1.49", | ||
"version": "0.1.50", | ||
"description": "Client module for Como's loaylty API", | ||
@@ -5,0 +5,0 @@ "main": "src/como.js", |
@@ -441,2 +441,19 @@ const moment = require('moment-timezone'); | ||
async getUserPointShopDataAPI2() { | ||
const { | ||
env_params: env, locationId, api, | ||
} = this.comoData; | ||
const responseJson = await api.getUserPointShopDataAPI2(env.zapp_root, locationId); | ||
return responseJson; | ||
} | ||
async purchaseAssetAPI2(assetID) { | ||
const { | ||
env_params: env, locationId, api, | ||
} = this.comoData; | ||
const responseJson = await api.purchaseAssetAPI2(env.zapp_root, locationId, assetID); | ||
return responseJson; | ||
} | ||
/** | ||
@@ -711,3 +728,3 @@ * Reload and sets the internal assets (expired and valid) state. | ||
); | ||
} | ||
} | ||
@@ -714,0 +731,0 @@ /** |
Sorry, the diff of this file is too big to display
201869
4393