UNPKG

sp-rest-proxy

Version:

SharePoint REST API Proxy for Node.js and Express local serve

39 lines 1.81 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.RestDeleteRouter = void 0; var BasicRouter_1 = require("../BasicRouter"); var headers_1 = require("../../utils/headers"); var RestDeleteRouter = (function (_super) { __extends(RestDeleteRouter, _super); function RestDeleteRouter(context, settings) { var _this = _super.call(this, context, settings) || this; _this.router = function (req, res) { var endpointUrl = _this.url.apiEndpoint(req); _this.logger.info('\nDELETE: ' + endpointUrl); var headers = (0, headers_1.getHeaders)(req.headers); _this.sp.fetch(endpointUrl, { method: 'DELETE', headers: headers }) .then(_this.handlers.isOK) .then(_this.handlers.response(res)) .catch(_this.handlers.error(res)); }; return _this; } return RestDeleteRouter; }(BasicRouter_1.BasicRouter)); exports.RestDeleteRouter = RestDeleteRouter; //# sourceMappingURL=restDelete.js.map