ravendb
Version:
RavenDB client for Node.js
53 lines • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigureDataArchivalOperation = void 0;
const RavenCommand_js_1 = require("../../../Http/RavenCommand.js");
const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js");
class ConfigureDataArchivalOperation {
_configuration;
constructor(configuration) {
this._configuration = configuration;
}
getCommand(conventions) {
return new ConfigureDataArchivalCommand(conventions, this._configuration);
}
get resultType() {
return "CommandResult";
}
}
exports.ConfigureDataArchivalOperation = ConfigureDataArchivalOperation;
class ConfigureDataArchivalCommand extends RavenCommand_js_1.RavenCommand {
_conventions;
_configuration;
constructor(conventions, configuration) {
super();
this._conventions = conventions;
this._configuration = configuration;
}
get isReadRequest() {
return false;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database + "/admin/data-archival/config";
const headers = this._headers()
.typeAppJson()
.build();
const body = this._serializer.serialize(this._configuration);
return {
method: "POST",
uri,
headers,
body
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
getRaftUniqueRequestId() {
return RaftIdGenerator_js_1.RaftIdGenerator.newId();
}
}
//# sourceMappingURL=ConfigureDataArchivalOperation.js.map