ravendb
Version:
RavenDB client for Node.js
53 lines • 1.87 kB
JavaScript
import { RavenCommand } from "../../../Http/RavenCommand.js";
import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js";
import { throwError } from "../../../Exceptions/index.js";
export class ResetEtlOperation {
_configurationName;
_transformationName;
constructor(configurationName, transformationName) {
if (!configurationName) {
throwError("InvalidArgumentException", "ConfigurationName cannot be null");
}
if (!transformationName) {
throwError("InvalidArgumentException", "TransformationName cannot be null");
}
this._configurationName = configurationName;
this._transformationName = transformationName;
}
getCommand(conventions) {
return new ResetEtlCommand(this._configurationName, this._transformationName);
}
get resultType() {
return "CommandResult";
}
}
class ResetEtlCommand extends RavenCommand {
_configurationName;
_transformationName;
constructor(configurationName, transformationName) {
super();
this._configurationName = configurationName;
this._transformationName = transformationName;
this._responseType = "Empty";
}
get isReadRequest() {
return false;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database + "/admin/etl?configurationName="
+ encodeURIComponent(this._configurationName)
+ "&transformationName=" + encodeURIComponent(this._transformationName);
const body = "{}";
const headers = this._headers().typeAppJson().build();
return {
method: "RESET",
headers,
body,
uri
};
}
getRaftUniqueRequestId() {
return RaftIdGenerator.newId();
}
}
//# sourceMappingURL=ResetEtlOperation.js.map