UNPKG

ravendb

Version:
58 lines 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoveTimeSeriesPolicyOperation = void 0; const index_js_1 = require("../../../Exceptions/index.js"); const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js"); const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class RemoveTimeSeriesPolicyOperation { _collection; _name; constructor(collection, name) { if (!collection) { (0, index_js_1.throwError)("InvalidArgumentException", "Name cannot be null"); } if (!name) { (0, index_js_1.throwError)("InvalidArgumentException", "Collection cannot be null"); } this._collection = collection; this._name = name; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new RemoveTimeSeriesPolicyCommand(this._collection, this._name); } } exports.RemoveTimeSeriesPolicyOperation = RemoveTimeSeriesPolicyOperation; class RemoveTimeSeriesPolicyCommand extends RavenCommand_js_1.RavenCommand { _collection; _name; constructor(collection, name) { super(); this._collection = collection; this._name = name; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/timeseries/policy?collection=" + this._urlEncode(this._collection) + "&name=" + this._urlEncode(this._name); return { method: "DELETE", uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } getRaftUniqueRequestId() { return RaftIdGenerator_js_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=RemoveTimeSeriesPolicyOperation.js.map