ravendb
Version:
RavenDB client for Node.js
50 lines • 1.75 kB
JavaScript
import { StringUtil } from "../../../Utility/StringUtil.js";
import { throwError } from "../../../Exceptions/index.js";
import { RavenCommand } from "../../../Http/RavenCommand.js";
import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js";
export class UnregisterReplicationHubAccessOperation {
_hubName;
_thumbprint;
constructor(hubName, thumbprint) {
if (StringUtil.isNullOrEmpty(hubName)) {
throwError("InvalidArgumentException", "HubName cannot be null or whitespace");
}
if (StringUtil.isNullOrEmpty(thumbprint)) {
throwError("InvalidArgumentException", "Thumbprint cannot be null or whitespace.");
}
this._hubName = hubName;
this._thumbprint = thumbprint;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new UnregisterReplicationHubAccessCommand(this._hubName, this._thumbprint);
}
}
class UnregisterReplicationHubAccessCommand extends RavenCommand {
_hubName;
_thumbprint;
constructor(hubName, thumbprint) {
super();
this._hubName = hubName;
this._thumbprint = thumbprint;
this._responseType = "Empty";
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database
+ "/admin/tasks/pull-replication/hub/access?name=" + this._urlEncode(this._hubName)
+ "&thumbprint=" + this._urlEncode(this._thumbprint);
return {
uri,
method: "DELETE"
};
}
get isReadRequest() {
return false;
}
getRaftUniqueRequestId() {
return RaftIdGenerator.newId();
}
}
//# sourceMappingURL=UnregisterReplicationHubAccessOperation.js.map