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
package/Client.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
+
import { ActionSet } from "./api/resources/actionSet/client/Client";
|
|
7
|
+
import { Action } from "./api/resources/action/client/Client";
|
|
6
8
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
7
9
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
8
10
|
export declare namespace MavenAGIClient {
|
|
@@ -23,6 +25,10 @@ export declare namespace MavenAGIClient {
|
|
|
23
25
|
export declare class MavenAGIClient {
|
|
24
26
|
protected readonly _options: MavenAGIClient.Options;
|
|
25
27
|
constructor(_options: MavenAGIClient.Options);
|
|
28
|
+
protected _actionSet: ActionSet | undefined;
|
|
29
|
+
get actionSet(): ActionSet;
|
|
30
|
+
protected _action: Action | undefined;
|
|
31
|
+
get action(): Action;
|
|
26
32
|
protected _conversation: Conversation | undefined;
|
|
27
33
|
get conversation(): Conversation;
|
|
28
34
|
protected _knowledge: Knowledge | undefined;
|
package/Client.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import { ActionSet } from "./api/resources/actionSet/client/Client";
|
|
5
|
+
import { Action } from "./api/resources/action/client/Client";
|
|
4
6
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
5
7
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
6
8
|
export class MavenAGIClient {
|
|
7
9
|
constructor(_options) {
|
|
8
10
|
this._options = _options;
|
|
9
11
|
}
|
|
12
|
+
get actionSet() {
|
|
13
|
+
var _a;
|
|
14
|
+
return ((_a = this._actionSet) !== null && _a !== void 0 ? _a : (this._actionSet = new ActionSet(this._options)));
|
|
15
|
+
}
|
|
16
|
+
get action() {
|
|
17
|
+
var _a;
|
|
18
|
+
return ((_a = this._action) !== null && _a !== void 0 ? _a : (this._action = new Action(this._options)));
|
|
19
|
+
}
|
|
10
20
|
get conversation() {
|
|
11
21
|
var _a;
|
|
12
22
|
return ((_a = this._conversation) !== null && _a !== void 0 ? _a : (this._conversation = new Conversation(this._options)));
|
package/README.md
CHANGED
|
@@ -16,18 +16,18 @@ npm i -s mavenagi
|
|
|
16
16
|
Instantiate and use the client with the following:
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
|
+
import * as environments from "../src/environments";
|
|
19
20
|
import { MavenAGIClient } from "mavenagi";
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const client = new MavenAGIClient({
|
|
22
23
|
appId: "YOUR_APP_ID",
|
|
23
24
|
appSecret: "YOUR_APP_SECRET",
|
|
24
25
|
organizationId: "YOUR_ORGANIZATION_ID",
|
|
25
26
|
agentId: "YOUR_AGENT_ID",
|
|
26
27
|
});
|
|
27
|
-
await
|
|
28
|
-
messages: [{}],
|
|
28
|
+
await client.actionSet.create({
|
|
29
29
|
id: "string",
|
|
30
|
-
|
|
30
|
+
name: "string",
|
|
31
31
|
});
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -37,10 +37,10 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
|
|
|
37
37
|
will be thrown.
|
|
38
38
|
|
|
39
39
|
```typescript
|
|
40
|
-
import { MavenAGIError } from
|
|
40
|
+
import { MavenAGIError } from "mavenagi";
|
|
41
41
|
|
|
42
42
|
try {
|
|
43
|
-
await
|
|
43
|
+
await client.create(...);
|
|
44
44
|
} catch (err) {
|
|
45
45
|
if (err instanceof MavenAGIError) {
|
|
46
46
|
console.log(err.statusCode);
|
|
@@ -65,7 +65,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
|
|
|
65
65
|
Use the `maxRetries` request option to configure this behavior.
|
|
66
66
|
|
|
67
67
|
```typescript
|
|
68
|
-
const response = await
|
|
68
|
+
const response = await client.create(..., {
|
|
69
69
|
maxRetries: 0 // override maxRetries at the request level
|
|
70
70
|
});
|
|
71
71
|
```
|
|
@@ -75,7 +75,7 @@ const response = await mavenAgi.initialize(..., {
|
|
|
75
75
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
76
76
|
|
|
77
77
|
```typescript
|
|
78
|
-
const response = await
|
|
78
|
+
const response = await client.create(..., {
|
|
79
79
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
80
80
|
});
|
|
81
81
|
```
|
|
@@ -86,7 +86,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
86
86
|
|
|
87
87
|
```typescript
|
|
88
88
|
const controller = new AbortController();
|
|
89
|
-
const response = await
|
|
89
|
+
const response = await client.create(..., {
|
|
90
90
|
abortSignal: controller.signal
|
|
91
91
|
});
|
|
92
92
|
controller.abort(); // aborts the request
|
|
@@ -110,9 +110,9 @@ The SDK provides a way for your to customize the underlying HTTP client / Fetch
|
|
|
110
110
|
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
-
import { MavenAGIClient } from
|
|
113
|
+
import { MavenAGIClient } from "mavenagi";
|
|
114
114
|
|
|
115
|
-
const
|
|
115
|
+
const client = new MavenAGIClient({
|
|
116
116
|
...
|
|
117
117
|
fetcher: // provide your implementation here
|
|
118
118
|
});
|
|
@@ -0,0 +1,78 @@
|
|
|
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 Action {
|
|
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 Action {
|
|
23
|
+
protected readonly _options: Action.Options;
|
|
24
|
+
constructor(_options: Action.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Get an action by its supplied ID
|
|
27
|
+
*
|
|
28
|
+
* @param {string} actionId - The ID of the action to get
|
|
29
|
+
* @param {Action.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.action.get("string")
|
|
37
|
+
*/
|
|
38
|
+
get(actionId: string, requestOptions?: Action.RequestOptions): Promise<MavenAGI.Action>;
|
|
39
|
+
/**
|
|
40
|
+
* Update an action or create it if it doesn't exist
|
|
41
|
+
*
|
|
42
|
+
* @param {MavenAGI.Action} request
|
|
43
|
+
* @param {Action.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.action.register({
|
|
51
|
+
* id: "string",
|
|
52
|
+
* actionSetId: "string",
|
|
53
|
+
* appId: "string",
|
|
54
|
+
* name: "string",
|
|
55
|
+
* description: "string",
|
|
56
|
+
* userInteractionRequired: true,
|
|
57
|
+
* buttonName: "string",
|
|
58
|
+
* requiredUserContextFieldNames: new Set(["string"]),
|
|
59
|
+
* userFormParameters: [{}]
|
|
60
|
+
* })
|
|
61
|
+
*/
|
|
62
|
+
register(request: MavenAGI.Action, requestOptions?: Action.RequestOptions): Promise<MavenAGI.Action>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete an action
|
|
65
|
+
*
|
|
66
|
+
* @param {string} actionId - The ID of the action to delete
|
|
67
|
+
* @param {Action.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
70
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
71
|
+
* @throws {@link MavenAGI.ServerError}
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await client.action.delete("string")
|
|
75
|
+
*/
|
|
76
|
+
delete(actionId: string, requestOptions?: Action.RequestOptions): Promise<void>;
|
|
77
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
78
|
+
}
|
|
@@ -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
|
+
}
|