ravendb
Version:
RavenDB client for Node.js
72 lines • 2.4 kB
JavaScript
import { throwError } from "../../../Exceptions/index.js";
import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js";
import { RavenCommand } from "../../../Http/RavenCommand.js";
export class EditClientCertificateOperation {
_thumbprint;
_permissions;
_name;
_clearance;
constructor(parameters) {
if (!parameters) {
throwError("InvalidArgumentException", "Parameters cannot be null");
}
if (!parameters.name) {
throwError("InvalidArgumentException", "Name cannot be null");
}
if (!parameters.thumbprint) {
throwError("InvalidArgumentException", "Thumbprint cannot be null");
}
if (!parameters.permissions) {
throwError("InvalidArgumentException", "Permissions cannot be null");
}
if (!parameters.clearance) {
throwError("InvalidArgumentException", "Clearance cannot be null");
}
this._name = parameters.name;
this._thumbprint = parameters.thumbprint;
this._permissions = parameters.permissions;
this._clearance = parameters.clearance;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new EditClientCertificateCommand(this._thumbprint, this._name, this._permissions, this._clearance);
}
}
class EditClientCertificateCommand extends RavenCommand {
_thumbprint;
_permissions;
_name;
_clearance;
constructor(thumbprint, name, permissions, clearance) {
super();
this._thumbprint = thumbprint;
this._name = name;
this._permissions = permissions;
this._clearance = clearance;
}
get isReadRequest() {
return false;
}
createRequest(node) {
const uri = node.url + "/admin/certificates/edit";
const definition = {
thumbprint: this._thumbprint,
permissions: this._permissions,
securityClearance: this._clearance,
name: this._name
};
const body = this._serializer.serialize(definition);
return {
method: "POST",
uri,
headers: this._headers().typeAppJson().build(),
body
};
}
getRaftUniqueRequestId() {
return RaftIdGenerator.newId();
}
}
//# sourceMappingURL=EditClientCertificateOperation.js.map