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,304 @@
|
|
|
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 Action {
|
|
20
|
+
constructor(_options) {
|
|
21
|
+
this._options = _options;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get an action by its supplied ID
|
|
25
|
+
*
|
|
26
|
+
* @param {string} actionId - The ID of the action to get
|
|
27
|
+
* @param {Action.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.action.get("string")
|
|
35
|
+
*/
|
|
36
|
+
get(actionId, 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/actions/${encodeURIComponent(actionId)}`),
|
|
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.Action.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
|
+
* Update an action or create it if it doesn't exist
|
|
112
|
+
*
|
|
113
|
+
* @param {MavenAGI.Action} request
|
|
114
|
+
* @param {Action.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.action.register({
|
|
122
|
+
* id: "string",
|
|
123
|
+
* actionSetId: "string",
|
|
124
|
+
* appId: "string",
|
|
125
|
+
* name: "string",
|
|
126
|
+
* description: "string",
|
|
127
|
+
* userInteractionRequired: true,
|
|
128
|
+
* buttonName: "string",
|
|
129
|
+
* requiredUserContextFieldNames: new Set(["string"]),
|
|
130
|
+
* userFormParameters: [{}]
|
|
131
|
+
* })
|
|
132
|
+
*/
|
|
133
|
+
register(request, requestOptions) {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
137
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions"),
|
|
138
|
+
method: "PUT",
|
|
139
|
+
headers: {
|
|
140
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
141
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
142
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
143
|
+
"X-Fern-Language": "JavaScript",
|
|
144
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
145
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.3",
|
|
146
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
147
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
148
|
+
},
|
|
149
|
+
contentType: "application/json",
|
|
150
|
+
body: yield serializers.Action.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
151
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
152
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
153
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
154
|
+
});
|
|
155
|
+
if (_response.ok) {
|
|
156
|
+
return yield serializers.Action.parseOrThrow(_response.body, {
|
|
157
|
+
unrecognizedObjectKeys: "passthrough",
|
|
158
|
+
allowUnrecognizedUnionMembers: true,
|
|
159
|
+
allowUnrecognizedEnumValues: true,
|
|
160
|
+
breadcrumbsPrefix: ["response"],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (_response.error.reason === "status-code") {
|
|
164
|
+
switch (_response.error.statusCode) {
|
|
165
|
+
case 404:
|
|
166
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
167
|
+
unrecognizedObjectKeys: "passthrough",
|
|
168
|
+
allowUnrecognizedUnionMembers: true,
|
|
169
|
+
allowUnrecognizedEnumValues: true,
|
|
170
|
+
breadcrumbsPrefix: ["response"],
|
|
171
|
+
}));
|
|
172
|
+
case 400:
|
|
173
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
breadcrumbsPrefix: ["response"],
|
|
178
|
+
}));
|
|
179
|
+
case 500:
|
|
180
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
181
|
+
unrecognizedObjectKeys: "passthrough",
|
|
182
|
+
allowUnrecognizedUnionMembers: true,
|
|
183
|
+
allowUnrecognizedEnumValues: true,
|
|
184
|
+
breadcrumbsPrefix: ["response"],
|
|
185
|
+
}));
|
|
186
|
+
default:
|
|
187
|
+
throw new errors.MavenAGIError({
|
|
188
|
+
statusCode: _response.error.statusCode,
|
|
189
|
+
body: _response.error.body,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
switch (_response.error.reason) {
|
|
194
|
+
case "non-json":
|
|
195
|
+
throw new errors.MavenAGIError({
|
|
196
|
+
statusCode: _response.error.statusCode,
|
|
197
|
+
body: _response.error.rawBody,
|
|
198
|
+
});
|
|
199
|
+
case "timeout":
|
|
200
|
+
throw new errors.MavenAGITimeoutError();
|
|
201
|
+
case "unknown":
|
|
202
|
+
throw new errors.MavenAGIError({
|
|
203
|
+
message: _response.error.errorMessage,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Delete an action
|
|
210
|
+
*
|
|
211
|
+
* @param {string} actionId - The ID of the action to delete
|
|
212
|
+
* @param {Action.RequestOptions} requestOptions - Request-specific configuration.
|
|
213
|
+
*
|
|
214
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
215
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
216
|
+
* @throws {@link MavenAGI.ServerError}
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* await client.action.delete("string")
|
|
220
|
+
*/
|
|
221
|
+
delete(actionId, requestOptions) {
|
|
222
|
+
var _a, _b;
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
225
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionId)}`),
|
|
226
|
+
method: "DELETE",
|
|
227
|
+
headers: {
|
|
228
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
229
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
230
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
231
|
+
"X-Fern-Language": "JavaScript",
|
|
232
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
233
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.3",
|
|
234
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
235
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
236
|
+
},
|
|
237
|
+
contentType: "application/json",
|
|
238
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
239
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
240
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
241
|
+
});
|
|
242
|
+
if (_response.ok) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (_response.error.reason === "status-code") {
|
|
246
|
+
switch (_response.error.statusCode) {
|
|
247
|
+
case 404:
|
|
248
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
249
|
+
unrecognizedObjectKeys: "passthrough",
|
|
250
|
+
allowUnrecognizedUnionMembers: true,
|
|
251
|
+
allowUnrecognizedEnumValues: true,
|
|
252
|
+
breadcrumbsPrefix: ["response"],
|
|
253
|
+
}));
|
|
254
|
+
case 400:
|
|
255
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
256
|
+
unrecognizedObjectKeys: "passthrough",
|
|
257
|
+
allowUnrecognizedUnionMembers: true,
|
|
258
|
+
allowUnrecognizedEnumValues: true,
|
|
259
|
+
breadcrumbsPrefix: ["response"],
|
|
260
|
+
}));
|
|
261
|
+
case 500:
|
|
262
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
263
|
+
unrecognizedObjectKeys: "passthrough",
|
|
264
|
+
allowUnrecognizedUnionMembers: true,
|
|
265
|
+
allowUnrecognizedEnumValues: true,
|
|
266
|
+
breadcrumbsPrefix: ["response"],
|
|
267
|
+
}));
|
|
268
|
+
default:
|
|
269
|
+
throw new errors.MavenAGIError({
|
|
270
|
+
statusCode: _response.error.statusCode,
|
|
271
|
+
body: _response.error.body,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
switch (_response.error.reason) {
|
|
276
|
+
case "non-json":
|
|
277
|
+
throw new errors.MavenAGIError({
|
|
278
|
+
statusCode: _response.error.statusCode,
|
|
279
|
+
body: _response.error.rawBody,
|
|
280
|
+
});
|
|
281
|
+
case "timeout":
|
|
282
|
+
throw new errors.MavenAGITimeoutError();
|
|
283
|
+
case "unknown":
|
|
284
|
+
throw new errors.MavenAGIError({
|
|
285
|
+
message: _response.error.errorMessage,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
_getAuthorizationHeader() {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
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"];
|
|
294
|
+
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"];
|
|
295
|
+
if (appId != null && appSecret != null) {
|
|
296
|
+
return core.BasicAuth.toAuthorizationHeader({
|
|
297
|
+
username: appId,
|
|
298
|
+
password: appSecret,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
return undefined;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export interface Action {
|
|
6
|
+
/** Externally supplied ID to uniquely identify this action */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The ID of the action set this action belongs to. Must be an existing action set ID. */
|
|
9
|
+
actionSetId: string;
|
|
10
|
+
/** The maven app id of the app that runs this action */
|
|
11
|
+
appId: string;
|
|
12
|
+
/** The name of the action */
|
|
13
|
+
name: string;
|
|
14
|
+
/** The description of the action. This helps Maven decide when to trigger the action and is not displayed directly to the user. */
|
|
15
|
+
description: string;
|
|
16
|
+
/** Whether the action requires user interaction to execute */
|
|
17
|
+
userInteractionRequired: boolean;
|
|
18
|
+
/** The name of the button that submits the action */
|
|
19
|
+
buttonName?: string;
|
|
20
|
+
/** The names of the user context fields required by the action */
|
|
21
|
+
requiredUserContextFieldNames: Set<string>;
|
|
22
|
+
userFormParameters: MavenAGI.ActionParameter[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as MavenAGI from "../../../index";
|
|
7
|
+
export declare namespace ActionSet {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
|
+
appId?: core.Supplier<string | undefined>;
|
|
11
|
+
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
organizationId: core.Supplier<string>;
|
|
13
|
+
agentId: core.Supplier<string>;
|
|
14
|
+
fetcher?: core.FetchFunction;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
maxRetries?: number;
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare class ActionSet {
|
|
23
|
+
protected readonly _options: ActionSet.Options;
|
|
24
|
+
constructor(_options: ActionSet.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Get an action set by its supplied ID
|
|
27
|
+
*
|
|
28
|
+
* @param {string} actionSetId - The ID of the action set to get
|
|
29
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
32
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
33
|
+
* @throws {@link MavenAGI.ServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.actionSet.get("string")
|
|
37
|
+
*/
|
|
38
|
+
get(actionSetId: string, requestOptions?: ActionSet.RequestOptions): Promise<MavenAGI.ActionSetResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Create an action set
|
|
41
|
+
*
|
|
42
|
+
* @param {MavenAGI.ActionSetRequest} request
|
|
43
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
46
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
47
|
+
* @throws {@link MavenAGI.ServerError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.actionSet.create({
|
|
51
|
+
* id: "string",
|
|
52
|
+
* name: "string"
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
create(request: MavenAGI.ActionSetRequest, requestOptions?: ActionSet.RequestOptions): Promise<MavenAGI.ActionSetResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete an action set
|
|
58
|
+
*
|
|
59
|
+
* @param {string} actionSetId - The ID of the action set to delete
|
|
60
|
+
* @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
63
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
64
|
+
* @throws {@link MavenAGI.ServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.actionSet.delete("string")
|
|
68
|
+
*/
|
|
69
|
+
delete(actionSetId: string, requestOptions?: ActionSet.RequestOptions): Promise<void>;
|
|
70
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
71
|
+
}
|