@studyportals/sp-hs-misc
Version:
Miscellaneous code used in HouseStark's projects
56 lines (47 loc) • 1.85 kB
JavaScript
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* A basic implementation of the ISuperAgentRequestFactory interface.
*
* @deprecated Use @studyportals/mb-platform-http-requests
*/
//# sourceMappingURL=base-super-agent-request-factory.class.js.map
var BaseSuperAgentRequestFactory = function () {
function BaseSuperAgentRequestFactory() {
_classCallCheck(this, BaseSuperAgentRequestFactory);
}
_createClass(BaseSuperAgentRequestFactory, [{
key: "get",
/**
* Creates a GET request to the specified path.
*/
value: function get(path) {
return superagent.get(path);
}
/**
* Creates a POST request to the specified path.
*/
}, {
key: "post",
value: function post(path) {
return superagent.post(path);
}
/**
* Creates a PUT request to the specified path.
*/
}, {
key: "put",
value: function put(path) {
return superagent.put(path);
}
/**
* Creates a DELETE request to the specified path.
*/
}, {
key: "delete",
value: function _delete(path) {
return superagent.delete(path);
}
}]);
return BaseSuperAgentRequestFactory;
}();