mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +6 -0
- package/Client.js +10 -0
- package/README.md +11 -11
- package/api/resources/action/client/Client.d.ts +78 -0
- package/api/resources/action/client/Client.js +304 -0
- package/api/resources/action/client/index.d.ts +1 -0
- package/api/resources/action/client/index.js +1 -0
- package/api/resources/action/index.d.ts +2 -0
- package/api/resources/action/index.js +2 -0
- package/api/resources/action/types/Action.d.ts +23 -0
- package/api/resources/action/types/ActionParameter.d.ts +8 -0
- package/api/resources/action/types/index.d.ts +2 -0
- package/api/resources/action/types/index.js +2 -0
- package/api/resources/actionSet/client/Client.d.ts +71 -0
- package/api/resources/actionSet/client/Client.js +297 -0
- package/api/resources/actionSet/client/index.d.ts +1 -0
- package/api/resources/actionSet/client/index.js +1 -0
- package/api/resources/actionSet/index.d.ts +2 -0
- package/api/resources/actionSet/index.js +2 -0
- package/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
- package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/actionSet/types/ActionSetBase.js} +1 -3
- package/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
- package/api/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetRequest.js} +1 -3
- package/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
- package/api/resources/actionSet/types/ActionSetResponse.js +4 -0
- package/api/resources/actionSet/types/index.d.ts +3 -0
- package/api/resources/actionSet/types/index.js +3 -0
- package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
- package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
- package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
- package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
- package/{dist/api/resources/conversation/errors/EmptyConversationError.d.ts → api/resources/commons/errors/ServerError.d.ts} +1 -1
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -1
- package/api/resources/commons/errors/index.js +3 -1
- package/api/resources/commons/types/Feedback.d.ts +16 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
- package/api/resources/commons/types/User.d.ts +1 -0
- package/api/resources/commons/types/index.d.ts +2 -0
- package/api/resources/commons/types/index.js +2 -0
- package/api/resources/conversation/client/Client.d.ts +61 -29
- package/api/resources/conversation/client/Client.js +215 -109
- package/api/resources/conversation/index.d.ts +0 -1
- package/api/resources/conversation/index.js +0 -1
- package/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
- package/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
- package/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
- package/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
- package/api/resources/conversation/types/UserMessage.d.ts +1 -0
- package/api/resources/conversation/types/index.d.ts +2 -1
- package/api/resources/conversation/types/index.js +2 -1
- package/api/resources/index.d.ts +4 -2
- package/api/resources/index.js +4 -2
- package/api/resources/knowledge/client/Client.d.ts +30 -34
- package/api/resources/knowledge/client/Client.js +94 -121
- package/api/resources/knowledge/index.d.ts +0 -1
- package/api/resources/knowledge/index.js +0 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
- package/api/resources/knowledge/types/index.d.ts +0 -1
- package/api/resources/knowledge/types/index.js +0 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/dist/Client.d.ts +6 -0
- package/dist/Client.js +10 -0
- package/dist/api/resources/action/client/Client.d.ts +78 -0
- package/dist/api/resources/action/client/Client.js +304 -0
- package/dist/api/resources/action/client/index.d.ts +1 -0
- package/dist/api/resources/action/client/index.js +1 -0
- package/dist/api/resources/action/index.d.ts +2 -0
- package/dist/api/resources/action/index.js +2 -0
- package/dist/api/resources/action/types/Action.d.ts +23 -0
- package/dist/api/resources/action/types/Action.js +4 -0
- package/dist/api/resources/action/types/ActionParameter.d.ts +8 -0
- package/dist/api/resources/action/types/ActionParameter.js +4 -0
- package/dist/api/resources/action/types/index.d.ts +2 -0
- package/dist/api/resources/action/types/index.js +2 -0
- package/dist/api/resources/actionSet/client/Client.d.ts +71 -0
- package/dist/api/resources/actionSet/client/Client.js +297 -0
- package/dist/api/resources/actionSet/client/index.d.ts +1 -0
- package/dist/api/resources/actionSet/client/index.js +1 -0
- package/dist/api/resources/actionSet/index.d.ts +2 -0
- package/dist/api/resources/actionSet/index.js +2 -0
- package/dist/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
- package/dist/api/resources/actionSet/types/ActionSetBase.js +4 -0
- package/dist/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
- package/dist/api/resources/actionSet/types/ActionSetRequest.js +4 -0
- package/dist/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
- package/dist/api/resources/actionSet/types/ActionSetResponse.js +4 -0
- package/dist/api/resources/actionSet/types/index.d.ts +3 -0
- package/dist/api/resources/actionSet/types/index.js +3 -0
- package/{api/resources/conversation/errors/EmptyConversationError.d.ts → dist/api/resources/commons/errors/BadRequestError.d.ts} +1 -1
- package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -1
- package/dist/api/resources/commons/errors/index.js +3 -1
- package/dist/api/resources/commons/types/Feedback.d.ts +16 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
- package/dist/api/resources/commons/types/User.d.ts +1 -0
- package/dist/api/resources/commons/types/index.d.ts +2 -0
- package/dist/api/resources/commons/types/index.js +2 -0
- package/dist/api/resources/conversation/client/Client.d.ts +61 -29
- package/dist/api/resources/conversation/client/Client.js +215 -109
- package/dist/api/resources/conversation/index.d.ts +0 -1
- package/dist/api/resources/conversation/index.js +0 -1
- package/dist/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
- package/dist/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
- package/dist/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
- package/dist/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
- package/dist/api/resources/conversation/types/UserMessage.d.ts +1 -0
- package/dist/api/resources/conversation/types/index.d.ts +2 -1
- package/dist/api/resources/conversation/types/index.js +2 -1
- package/dist/api/resources/index.d.ts +4 -2
- package/dist/api/resources/index.js +4 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +30 -34
- package/dist/api/resources/knowledge/client/Client.js +94 -121
- package/dist/api/resources/knowledge/index.d.ts +0 -1
- package/dist/api/resources/knowledge/index.js +0 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
- package/dist/api/resources/knowledge/types/index.d.ts +0 -1
- package/dist/api/resources/knowledge/types/index.js +0 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/serialization/resources/action/index.d.ts +1 -0
- package/dist/serialization/resources/action/index.js +1 -0
- package/dist/serialization/resources/action/types/Action.d.ts +21 -0
- package/dist/serialization/resources/action/types/Action.js +16 -0
- package/dist/serialization/resources/action/types/ActionParameter.d.ts +14 -0
- package/dist/serialization/resources/action/types/ActionParameter.js +9 -0
- package/dist/serialization/resources/action/types/index.d.ts +2 -0
- package/dist/serialization/resources/action/types/index.js +2 -0
- package/dist/serialization/resources/actionSet/index.d.ts +1 -0
- package/dist/serialization/resources/actionSet/index.js +1 -0
- package/dist/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
- package/dist/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
- package/dist/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
- package/dist/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
- package/dist/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
- package/dist/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
- package/dist/serialization/resources/actionSet/types/index.d.ts +3 -0
- package/dist/serialization/resources/actionSet/types/index.js +3 -0
- package/dist/serialization/resources/commons/types/Feedback.d.ts +17 -0
- package/dist/serialization/resources/commons/types/Feedback.js +12 -0
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/dist/serialization/resources/commons/types/User.d.ts +1 -0
- package/dist/serialization/resources/commons/types/User.js +1 -0
- package/dist/serialization/resources/commons/types/index.d.ts +2 -0
- package/dist/serialization/resources/commons/types/index.js +2 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
- package/dist/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
- package/dist/serialization/resources/conversation/types/index.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/index.js +2 -1
- package/dist/serialization/resources/index.d.ts +4 -0
- package/dist/serialization/resources/index.js +4 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/index.js +0 -1
- package/package.json +1 -1
- package/serialization/resources/action/index.d.ts +1 -0
- package/serialization/resources/action/index.js +1 -0
- package/serialization/resources/action/types/Action.d.ts +21 -0
- package/serialization/resources/action/types/Action.js +16 -0
- package/serialization/resources/action/types/ActionParameter.d.ts +14 -0
- package/serialization/resources/action/types/ActionParameter.js +9 -0
- package/serialization/resources/action/types/index.d.ts +2 -0
- package/serialization/resources/action/types/index.js +2 -0
- package/serialization/resources/actionSet/index.d.ts +1 -0
- package/serialization/resources/actionSet/index.js +1 -0
- package/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
- package/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
- package/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
- package/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
- package/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
- package/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
- package/serialization/resources/actionSet/types/index.d.ts +3 -0
- package/serialization/resources/actionSet/types/index.js +3 -0
- package/serialization/resources/commons/types/Feedback.d.ts +17 -0
- package/serialization/resources/commons/types/Feedback.js +12 -0
- package/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
- package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/serialization/resources/commons/types/User.d.ts +1 -0
- package/serialization/resources/commons/types/User.js +1 -0
- package/serialization/resources/commons/types/index.d.ts +2 -0
- package/serialization/resources/commons/types/index.js +2 -0
- package/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
- package/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
- package/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
- package/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
- package/serialization/resources/conversation/types/index.d.ts +2 -1
- package/serialization/resources/conversation/types/index.js +2 -1
- package/serialization/resources/index.d.ts +4 -0
- package/serialization/resources/index.js +4 -0
- package/serialization/resources/knowledge/types/index.d.ts +0 -1
- package/serialization/resources/knowledge/types/index.js +0 -1
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/api/resources/conversation/errors/index.d.ts +0 -7
- package/api/resources/conversation/errors/index.js +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/api/resources/knowledge/errors/index.d.ts +0 -6
- package/api/resources/knowledge/errors/index.js +0 -6
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/dist/api/resources/conversation/errors/index.d.ts +0 -7
- package/dist/api/resources/conversation/errors/index.js +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
- package/dist/api/resources/knowledge/errors/index.js +0 -6
- /package/api/resources/{knowledge/types/IdBody.js → action/types/Action.js} +0 -0
- /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/action/types/ActionParameter.js} +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments";
|
|
14
|
+
import * as core from "../../../../core";
|
|
15
|
+
import * as MavenAGI from "../../../index";
|
|
16
|
+
import urlJoin from "url-join";
|
|
17
|
+
import * as serializers from "../../../../serialization/index";
|
|
18
|
+
import * as errors from "../../../../errors/index";
|
|
19
|
+
export class ActionSet {
|
|
20
|
+
constructor(_options) {
|
|
21
|
+
this._options = _options;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get an action set by its supplied ID
|
|
25
|
+
*
|
|
26
|
+
* @param {string} actionSetId - The ID of the action set to get
|
|
27
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
+
* @throws {@link MavenAGI.ServerError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.actionSet.get("string")
|
|
35
|
+
*/
|
|
36
|
+
get(actionSetId, requestOptions) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
40
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/action-sets/${encodeURIComponent(actionSetId)}`),
|
|
41
|
+
method: "GET",
|
|
42
|
+
headers: {
|
|
43
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
44
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
45
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
46
|
+
"X-Fern-Language": "JavaScript",
|
|
47
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
48
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.3",
|
|
49
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
|
+
},
|
|
52
|
+
contentType: "application/json",
|
|
53
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
54
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
});
|
|
57
|
+
if (_response.ok) {
|
|
58
|
+
return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
|
|
59
|
+
unrecognizedObjectKeys: "passthrough",
|
|
60
|
+
allowUnrecognizedUnionMembers: true,
|
|
61
|
+
allowUnrecognizedEnumValues: true,
|
|
62
|
+
breadcrumbsPrefix: ["response"],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (_response.error.reason === "status-code") {
|
|
66
|
+
switch (_response.error.statusCode) {
|
|
67
|
+
case 404:
|
|
68
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
69
|
+
unrecognizedObjectKeys: "passthrough",
|
|
70
|
+
allowUnrecognizedUnionMembers: true,
|
|
71
|
+
allowUnrecognizedEnumValues: true,
|
|
72
|
+
breadcrumbsPrefix: ["response"],
|
|
73
|
+
}));
|
|
74
|
+
case 400:
|
|
75
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
76
|
+
unrecognizedObjectKeys: "passthrough",
|
|
77
|
+
allowUnrecognizedUnionMembers: true,
|
|
78
|
+
allowUnrecognizedEnumValues: true,
|
|
79
|
+
breadcrumbsPrefix: ["response"],
|
|
80
|
+
}));
|
|
81
|
+
case 500:
|
|
82
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
83
|
+
unrecognizedObjectKeys: "passthrough",
|
|
84
|
+
allowUnrecognizedUnionMembers: true,
|
|
85
|
+
allowUnrecognizedEnumValues: true,
|
|
86
|
+
breadcrumbsPrefix: ["response"],
|
|
87
|
+
}));
|
|
88
|
+
default:
|
|
89
|
+
throw new errors.MavenAGIError({
|
|
90
|
+
statusCode: _response.error.statusCode,
|
|
91
|
+
body: _response.error.body,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
switch (_response.error.reason) {
|
|
96
|
+
case "non-json":
|
|
97
|
+
throw new errors.MavenAGIError({
|
|
98
|
+
statusCode: _response.error.statusCode,
|
|
99
|
+
body: _response.error.rawBody,
|
|
100
|
+
});
|
|
101
|
+
case "timeout":
|
|
102
|
+
throw new errors.MavenAGITimeoutError();
|
|
103
|
+
case "unknown":
|
|
104
|
+
throw new errors.MavenAGIError({
|
|
105
|
+
message: _response.error.errorMessage,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create an action set
|
|
112
|
+
*
|
|
113
|
+
* @param {MavenAGI.ActionSetRequest} request
|
|
114
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
|
+
*
|
|
116
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
117
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
118
|
+
* @throws {@link MavenAGI.ServerError}
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* await client.actionSet.create({
|
|
122
|
+
* id: "string",
|
|
123
|
+
* name: "string"
|
|
124
|
+
* })
|
|
125
|
+
*/
|
|
126
|
+
create(request, requestOptions) {
|
|
127
|
+
var _a, _b;
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
130
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/action-sets"),
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers: {
|
|
133
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
134
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
135
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
136
|
+
"X-Fern-Language": "JavaScript",
|
|
137
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
138
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.3",
|
|
139
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
140
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
141
|
+
},
|
|
142
|
+
contentType: "application/json",
|
|
143
|
+
body: yield serializers.ActionSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
144
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
145
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
146
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
147
|
+
});
|
|
148
|
+
if (_response.ok) {
|
|
149
|
+
return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
|
|
150
|
+
unrecognizedObjectKeys: "passthrough",
|
|
151
|
+
allowUnrecognizedUnionMembers: true,
|
|
152
|
+
allowUnrecognizedEnumValues: true,
|
|
153
|
+
breadcrumbsPrefix: ["response"],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (_response.error.reason === "status-code") {
|
|
157
|
+
switch (_response.error.statusCode) {
|
|
158
|
+
case 404:
|
|
159
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
160
|
+
unrecognizedObjectKeys: "passthrough",
|
|
161
|
+
allowUnrecognizedUnionMembers: true,
|
|
162
|
+
allowUnrecognizedEnumValues: true,
|
|
163
|
+
breadcrumbsPrefix: ["response"],
|
|
164
|
+
}));
|
|
165
|
+
case 400:
|
|
166
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
167
|
+
unrecognizedObjectKeys: "passthrough",
|
|
168
|
+
allowUnrecognizedUnionMembers: true,
|
|
169
|
+
allowUnrecognizedEnumValues: true,
|
|
170
|
+
breadcrumbsPrefix: ["response"],
|
|
171
|
+
}));
|
|
172
|
+
case 500:
|
|
173
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
breadcrumbsPrefix: ["response"],
|
|
178
|
+
}));
|
|
179
|
+
default:
|
|
180
|
+
throw new errors.MavenAGIError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.body,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
switch (_response.error.reason) {
|
|
187
|
+
case "non-json":
|
|
188
|
+
throw new errors.MavenAGIError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.rawBody,
|
|
191
|
+
});
|
|
192
|
+
case "timeout":
|
|
193
|
+
throw new errors.MavenAGITimeoutError();
|
|
194
|
+
case "unknown":
|
|
195
|
+
throw new errors.MavenAGIError({
|
|
196
|
+
message: _response.error.errorMessage,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Delete an action set
|
|
203
|
+
*
|
|
204
|
+
* @param {string} actionSetId - The ID of the action set to delete
|
|
205
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
+
*
|
|
207
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
208
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
209
|
+
* @throws {@link MavenAGI.ServerError}
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* await client.actionSet.delete("string")
|
|
213
|
+
*/
|
|
214
|
+
delete(actionSetId, requestOptions) {
|
|
215
|
+
var _a, _b;
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
218
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/action-sets/${encodeURIComponent(actionSetId)}`),
|
|
219
|
+
method: "DELETE",
|
|
220
|
+
headers: {
|
|
221
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
222
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
223
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
224
|
+
"X-Fern-Language": "JavaScript",
|
|
225
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
226
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.3",
|
|
227
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
228
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
229
|
+
},
|
|
230
|
+
contentType: "application/json",
|
|
231
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
232
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
233
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
234
|
+
});
|
|
235
|
+
if (_response.ok) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (_response.error.reason === "status-code") {
|
|
239
|
+
switch (_response.error.statusCode) {
|
|
240
|
+
case 404:
|
|
241
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
242
|
+
unrecognizedObjectKeys: "passthrough",
|
|
243
|
+
allowUnrecognizedUnionMembers: true,
|
|
244
|
+
allowUnrecognizedEnumValues: true,
|
|
245
|
+
breadcrumbsPrefix: ["response"],
|
|
246
|
+
}));
|
|
247
|
+
case 400:
|
|
248
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
249
|
+
unrecognizedObjectKeys: "passthrough",
|
|
250
|
+
allowUnrecognizedUnionMembers: true,
|
|
251
|
+
allowUnrecognizedEnumValues: true,
|
|
252
|
+
breadcrumbsPrefix: ["response"],
|
|
253
|
+
}));
|
|
254
|
+
case 500:
|
|
255
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
256
|
+
unrecognizedObjectKeys: "passthrough",
|
|
257
|
+
allowUnrecognizedUnionMembers: true,
|
|
258
|
+
allowUnrecognizedEnumValues: true,
|
|
259
|
+
breadcrumbsPrefix: ["response"],
|
|
260
|
+
}));
|
|
261
|
+
default:
|
|
262
|
+
throw new errors.MavenAGIError({
|
|
263
|
+
statusCode: _response.error.statusCode,
|
|
264
|
+
body: _response.error.body,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
switch (_response.error.reason) {
|
|
269
|
+
case "non-json":
|
|
270
|
+
throw new errors.MavenAGIError({
|
|
271
|
+
statusCode: _response.error.statusCode,
|
|
272
|
+
body: _response.error.rawBody,
|
|
273
|
+
});
|
|
274
|
+
case "timeout":
|
|
275
|
+
throw new errors.MavenAGITimeoutError();
|
|
276
|
+
case "unknown":
|
|
277
|
+
throw new errors.MavenAGIError({
|
|
278
|
+
message: _response.error.errorMessage,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
_getAuthorizationHeader() {
|
|
284
|
+
var _a, _b;
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
const appId = (_a = (yield core.Supplier.get(this._options.appId))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_ID"];
|
|
287
|
+
const appSecret = (_b = (yield core.Supplier.get(this._options.appSecret))) !== null && _b !== void 0 ? _b : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_SECRET"];
|
|
288
|
+
if (appId != null && appSecret != null) {
|
|
289
|
+
return core.BasicAuth.toAuthorizationHeader({
|
|
290
|
+
username: appId,
|
|
291
|
+
password: appSecret,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return undefined;
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as MavenAGI from "../../../index";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class BadRequestError extends errors.MavenAGIError {
|
|
7
7
|
constructor(body: MavenAGI.ErrorMessage);
|
|
8
8
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
|
-
export class
|
|
5
|
+
export class BadRequestError extends errors.MavenAGIError {
|
|
6
6
|
constructor(body) {
|
|
7
7
|
super({
|
|
8
|
-
message: "
|
|
8
|
+
message: "BadRequestError",
|
|
9
9
|
statusCode: 400,
|
|
10
10
|
body: body,
|
|
11
11
|
});
|
|
12
|
-
Object.setPrototypeOf(this,
|
|
12
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as MavenAGI from "../../../index";
|
|
6
|
+
export declare class NotFoundError extends errors.MavenAGIError {
|
|
7
|
+
constructor(body: MavenAGI.ErrorMessage);
|
|
8
|
+
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
|
-
export class
|
|
5
|
+
export class NotFoundError extends errors.MavenAGIError {
|
|
6
6
|
constructor(body) {
|
|
7
7
|
super({
|
|
8
|
-
message: "
|
|
8
|
+
message: "NotFoundError",
|
|
9
9
|
statusCode: 404,
|
|
10
10
|
body: body,
|
|
11
11
|
});
|
|
12
|
-
Object.setPrototypeOf(this,
|
|
12
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as MavenAGI from "../../../index";
|
|
6
|
+
export declare class ServerError extends errors.MavenAGIError {
|
|
7
|
+
constructor(body: MavenAGI.ErrorMessage);
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
export class ServerError extends errors.MavenAGIError {
|
|
6
|
+
constructor(body) {
|
|
7
|
+
super({
|
|
8
|
+
message: "ServerError",
|
|
9
|
+
statusCode: 500,
|
|
10
|
+
body: body,
|
|
11
|
+
});
|
|
12
|
+
Object.setPrototypeOf(this, ServerError.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export interface Feedback {
|
|
6
|
+
/** The ID of the piece of feedback */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The ID of the conversation the feedback is about */
|
|
9
|
+
conversationId: string;
|
|
10
|
+
/** The ID of the conversation message the feedback is about */
|
|
11
|
+
conversationMessageId: string;
|
|
12
|
+
/** The type of feedback */
|
|
13
|
+
type: MavenAGI.FeedbackType;
|
|
14
|
+
/** The feedback text */
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The type of feedback
|
|
6
6
|
*/
|
|
7
|
-
export declare type FeedbackType = "THUMBS_UP" | "THUMBS_DOWN";
|
|
7
|
+
export declare type FeedbackType = "THUMBS_UP" | "THUMBS_DOWN" | "INSERT" | "HANDOFF";
|
|
8
8
|
export declare const FeedbackType: {
|
|
9
9
|
readonly ThumbsUp: "THUMBS_UP";
|
|
10
10
|
readonly ThumbsDown: "THUMBS_DOWN";
|
|
11
|
+
readonly Insert: "INSERT";
|
|
12
|
+
readonly Handoff: "HANDOFF";
|
|
11
13
|
};
|