ravendb
Version:
RavenDB client for Node.js
42 lines • 1.38 kB
JavaScript
import { RavenCommand } from "../../../Http/RavenCommand.js";
import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js";
export class RemoveConnectionStringOperation {
_connectionString;
constructor(connectionString) {
this._connectionString = connectionString;
}
getCommand(conventions) {
return new RemoveConnectionStringCommand(this._connectionString);
}
get resultType() {
return "CommandResult";
}
}
export class RemoveConnectionStringCommand extends RavenCommand {
_connectionString;
constructor(connectionString) {
super();
this._connectionString = connectionString;
}
get isReadRequest() {
return false;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database + "/admin/connection-strings?connectionString="
+ encodeURIComponent(this._connectionString.name) + "&type=" + this._connectionString.type;
return {
method: "DELETE",
uri
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
getRaftUniqueRequestId() {
return RaftIdGenerator.newId();
}
}
//# sourceMappingURL=RemoveConnectionStringOperation.js.map