UNPKG

ravendb

Version:
34 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteDocumentCommand = void 0; const RavenCommand_js_1 = require("../../Http/RavenCommand.js"); const index_js_1 = require("../../Exceptions/index.js"); class DeleteDocumentCommand extends RavenCommand_js_1.RavenCommand { _id; _changeVector; constructor(id, changeVector = null) { super(); if (!id) { (0, index_js_1.throwError)("InvalidArgumentException", "Id cannot be null."); } this._responseType = "Empty"; this._id = id; this._changeVector = changeVector; } createRequest(node) { RavenCommand_js_1.RavenCommand.ensureIsNotNullOrEmpty(this._id, "id"); const uri = node.url + "/databases/" + node.database + "/docs?id=" + encodeURIComponent(this._id); const request = { method: "DELETE", uri, headers: this._headers().build() }; this._addChangeVectorIfNotNull(this._changeVector, request); return request; } get isReadRequest() { return false; } } exports.DeleteDocumentCommand = DeleteDocumentCommand; //# sourceMappingURL=DeleteDocumentCommand.js.map