UNPKG

ravendb

Version:
48 lines 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteAiAgentOperation = void 0; const RavenCommand_js_1 = require("../../../../Http/RavenCommand.js"); const StringUtil_js_1 = require("../../../../Utility/StringUtil.js"); const index_js_1 = require("../../../../Exceptions/index.js"); class DeleteAiAgentOperation { _identifier; constructor(identifier) { if (StringUtil_js_1.StringUtil.isNullOrEmpty(identifier)) { (0, index_js_1.throwError)("InvalidArgumentException", "identifier cannot be null or empty"); } this._identifier = identifier; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new DeleteAiAgentCommand(this._identifier, conventions); } } exports.DeleteAiAgentOperation = DeleteAiAgentOperation; class DeleteAiAgentCommand extends RavenCommand_js_1.RavenCommand { _identifier; _conventions; constructor(identifier, conventions) { super(); this._identifier = identifier; this._conventions = conventions; } get isReadRequest() { return false; } createRequest(node) { const uri = `${node.url}/databases/${node.database}/admin/ai/agent?agentId=${encodeURIComponent(this._identifier)}`; return { method: "DELETE", uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } } //# sourceMappingURL=DeleteAiAgentOperation.js.map