@stylusapparel/shipstation-api-node
Version:
Unofficial Shipstation API Wrapper for Node.js
21 lines (19 loc) • 677 B
JavaScript
;
const { __carriers } = require("../constants/url");
const { _formatResponse: _fr } = require("./utils");
module.exports = (__http) => {
const __this = {
_getCarrier: (__carrierCode) =>
_fr(__http.get(__carriers.GET_CARRIER + "?carrierCode=" + __carrierCode)),
_getAllCarriers: () => _fr(__http.get(__carriers.GET_CARRIERS)),
_getAllPackages: (__carrierCode) =>
_fr(
__http.get(__carriers.GET_PACKAGES + "?carrierCode=" + __carrierCode)
),
_getAllServices: (__carrierCode) =>
_fr(
__http.get(__carriers.GET_SERVICES + "?carrierCode=" + __carrierCode)
),
};
return __this;
};