UNPKG

ravendb

Version:
42 lines 1.29 kB
import { throwError } from "../../../Exceptions/index.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js"; export class DeleteCertificateOperation { _thumbprint; constructor(thumbprint) { if (!thumbprint) { throwError("InvalidArgumentException", "Thumbprint cannot be null."); } this._thumbprint = thumbprint; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new DeleteCertificateCommand(this._thumbprint); } } class DeleteCertificateCommand extends RavenCommand { _thumbprint; constructor(thumbprint) { super(); if (!thumbprint) { throwError("InvalidArgumentException", "Thumbprint cannot be null"); } this._thumbprint = thumbprint; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/admin/certificates?thumbprint=" + encodeURIComponent(this._thumbprint); return { uri, method: "DELETE" }; } getRaftUniqueRequestId() { return RaftIdGenerator.newId(); } } //# sourceMappingURL=DeleteCertificateOperation.js.map