UNPKG

@configurator/ravendb

Version:
46 lines 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateSubscriptionCommand = void 0; const RaftIdGenerator_1 = require("../../Utility/RaftIdGenerator"); const RavenCommand_1 = require("../../Http/RavenCommand"); class UpdateSubscriptionCommand extends RavenCommand_1.RavenCommand { constructor(options) { super(); this._options = options; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/subscriptions/update"; const body = this._serializer.serialize(this._options); return { uri, body, headers: this._headers().typeAppJson().build(), method: "POST" }; } async setResponseFromCache(cachedValue) { this.result = { name: this._options.name }; } async setResponseAsync(bodyStream, fromCache) { if (fromCache) { this.result = { name: this._options.name }; return; } if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator_1.RaftIdGenerator.newId(); } } exports.UpdateSubscriptionCommand = UpdateSubscriptionCommand; //# sourceMappingURL=UpdateSubscriptionCommand.js.map