UNPKG

ravendb

Version:
63 lines 2.13 kB
import { throwError } from "../../Exceptions/index.js"; import { RavenCommand } from "../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../Utility/RaftIdGenerator.js"; export class ConfigureRevisionsForConflictsOperation { _database; _configuration; constructor(database, configuration) { this._database = database; if (!configuration) { throwError("InvalidArgumentException", "Configuration cannot be null"); } this._configuration = configuration; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new ConfigureRevisionsForConflictsCommand(conventions, this._database, this._configuration); } } class ConfigureRevisionsForConflictsCommand extends RavenCommand { _conventions; _databaseName; _configuration; constructor(conventions, database, configuration) { super(); if (!conventions) { throwError("InvalidArgumentException", "Conventions cannot be null"); } this._conventions = conventions; if (!database) { throwError("InvalidArgumentException", "Database cannot be null"); } this._databaseName = database; this._configuration = configuration; } createRequest(node) { const uri = node.url + "/databases/" + this._databaseName + "/admin/revisions/conflicts/config"; const body = this._serializer.serialize(this._configuration); return { uri, method: "POST", headers: this._headers().typeAppJson().build(), body }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator.newId(); } } export class ConfigureRevisionsForConflictsResult { raftCommandIndex; } //# sourceMappingURL=ConfigureRevisionsForConflictsOperation.js.map