ravendb
Version:
RavenDB client for Node.js
46 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAiAgentsOperation = void 0;
const RavenCommand_js_1 = require("../../../../Http/RavenCommand.js");
class GetAiAgentsOperation {
_agentId;
constructor(agentId) {
this._agentId = agentId;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new GetAiAgentsCommand(this._agentId, conventions);
}
}
exports.GetAiAgentsOperation = GetAiAgentsOperation;
class GetAiAgentsCommand extends RavenCommand_js_1.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