@stylusapparel/stylusop-api-node-wrapper
Version:
This is the official NodeJs wrapper for connecting to the StylusOP API
23 lines (22 loc) • 637 B
JavaScript
;
const __products = require('./lib/products');
module.exports = (_auth, _token, _config) => {
const __this = {
get: (productId) => {
return _auth._verify().then(() => _products._getProduct(productId));
},
list: () => {
return _auth._verify().then(() => _products._listProducts());
},
search: (params = {}) => {
return _auth._verify().then(() => _products._searchProducts(params));
},
variants: {
find: (params = {}) => {
return _auth._verify().then(() => _products._findVariants(params));
},
},
};
const _products = __products(_token, _config);
return __this;
};