ravendb
Version:
RavenDB client for Node.js
42 lines • 1.15 kB
JavaScript
import { RavenCommand } from "../../../../Http/RavenCommand.js";
export class GetAiAgentsOperation {
_agentId;
constructor(agentId) {
this._agentId = agentId;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new GetAiAgentsCommand(this._agentId, conventions);
}
}
class GetAiAgentsCommand extends RavenCommand {
_agentId;
_conventions;
constructor(agentId, conventions) {
super();
this._agentId = agentId;
this._conventions = conventions;
}
get isReadRequest() {
return true;
}
createRequest(node) {
let uri = `${node.url}/databases/${node.database}/admin/ai/agent`;
if (this._agentId) {
uri += `?agentId=${encodeURIComponent(this._agentId)}`;
}
return {
method: "GET",
uri
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
}
//# sourceMappingURL=GetAiAgentsOperation.js.map