ravendb
Version:
RavenDB client for Node.js
44 lines • 1.41 kB
JavaScript
import { RavenCommand } from "../../../../Http/RavenCommand.js";
import { StringUtil } from "../../../../Utility/StringUtil.js";
import { throwError } from "../../../../Exceptions/index.js";
export class DeleteAiAgentOperation {
_identifier;
constructor(identifier) {
if (StringUtil.isNullOrEmpty(identifier)) {
throwError("InvalidArgumentException", "identifier cannot be null or empty");
}
this._identifier = identifier;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new DeleteAiAgentCommand(this._identifier, conventions);
}
}
class DeleteAiAgentCommand extends 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