mavenagi 0.0.0-alpha.4 → 0.0.0-alpha.6
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 +5 -5
- package/Client.js +3 -3
- package/README.md +15 -31
- package/api/resources/actions/client/Client.d.ts +19 -65
- package/api/resources/actions/client/Client.js +31 -292
- package/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/api/resources/actions/types/index.d.ts +3 -4
- package/api/resources/actions/types/index.js +3 -4
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityType.d.ts +14 -0
- package/api/resources/commons/types/EntityType.js +13 -0
- package/api/resources/commons/types/index.d.ts +3 -0
- package/api/resources/commons/types/index.js +3 -0
- package/api/resources/conversation/client/Client.d.ts +20 -3
- package/api/resources/conversation/client/Client.js +118 -25
- package/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +1 -1
- package/api/resources/knowledge/client/Client.d.ts +2 -2
- package/api/resources/knowledge/client/Client.js +21 -21
- package/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/api/resources/triggers/client/Client.d.ts +14 -12
- package/api/resources/triggers/client/Client.js +25 -23
- package/{dist/api/resources/triggers/types/EventTrigger.d.ts → api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/triggers/types/index.d.ts +3 -1
- package/api/resources/triggers/types/index.js +3 -1
- package/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/Client.d.ts +5 -5
- package/dist/Client.js +3 -3
- package/dist/api/resources/actions/client/Client.d.ts +19 -65
- package/dist/api/resources/actions/client/Client.js +31 -292
- package/dist/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/dist/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +3 -4
- package/dist/api/resources/actions/types/index.js +3 -4
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityType.js +13 -0
- package/dist/api/resources/commons/types/index.d.ts +3 -0
- package/dist/api/resources/commons/types/index.js +3 -0
- package/dist/api/resources/conversation/client/Client.d.ts +20 -3
- package/dist/api/resources/conversation/client/Client.js +118 -25
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +1 -1
- package/dist/api/resources/knowledge/client/Client.d.ts +2 -2
- package/dist/api/resources/knowledge/client/Client.js +21 -21
- package/dist/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/dist/api/resources/triggers/client/Client.d.ts +14 -12
- package/dist/api/resources/triggers/client/Client.js +25 -23
- package/{api/resources/triggers/types/EventTrigger.d.ts → dist/api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/dist/api/resources/triggers/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +3 -1
- package/dist/api/resources/triggers/types/index.js +3 -1
- package/dist/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/dist/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{serialization/resources/actions/types/Action.js → dist/serialization/resources/actions/types/ActionBase.js} +1 -4
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/index.d.ts +3 -4
- package/dist/serialization/resources/actions/types/index.js +3 -4
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/actions/types/ActionSetBase.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/dist/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +14 -0
- package/dist/serialization/resources/commons/types/index.d.ts +3 -0
- package/dist/serialization/resources/commons/types/index.js +3 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/dist/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/dist/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +3 -1
- package/dist/serialization/resources/triggers/types/index.js +3 -1
- package/package.json +1 -1
- package/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{dist/serialization/resources/actions/types/Action.js → serialization/resources/actions/types/ActionBase.js} +1 -4
- package/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/index.d.ts +3 -4
- package/serialization/resources/actions/types/index.js +3 -4
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/actions/types/ActionSetBase.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +14 -0
- package/serialization/resources/commons/types/index.d.ts +3 -0
- package/serialization/resources/commons/types/index.js +3 -0
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +3 -1
- package/serialization/resources/triggers/types/index.js +3 -1
- package/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/dist/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/dist/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/dist/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- package/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- /package/api/resources/actions/types/{Action.js → ActionBase.js} +0 -0
- /package/api/resources/actions/types/{ActionSetBase.js → ActionRequest.js} +0 -0
- /package/api/resources/actions/types/{ActionSetRequest.js → ActionResponse.js} +0 -0
- /package/api/resources/{actions/types/ActionSetResponse.js → commons/types/EntityId.js} +0 -0
- /package/api/resources/{triggers/types/EventTrigger.js → commons/types/EntityIdBase.js} +0 -0
- /package/{dist/api/resources/actions/types/Action.js → api/resources/triggers/types/EventTriggerBase.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetBase.js → api/resources/triggers/types/EventTriggerRequest.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetRequest.js → api/resources/triggers/types/EventTriggerResponse.js} +0 -0
- /package/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/api/resources/{user → users}/client/index.js +0 -0
- /package/api/resources/{user → users}/index.d.ts +0 -0
- /package/api/resources/{user → users}/index.js +0 -0
- /package/dist/api/resources/actions/types/{ActionSetResponse.js → ActionBase.js} +0 -0
- /package/dist/api/resources/{triggers/types/EventTrigger.js → actions/types/ActionRequest.js} +0 -0
- /package/dist/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/client/index.js +0 -0
- /package/dist/api/resources/{user → users}/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/index.js +0 -0
package/Client.d.ts
CHANGED
|
@@ -7,14 +7,14 @@ import { Actions } from "./api/resources/actions/client/Client";
|
|
|
7
7
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
8
8
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
9
9
|
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
10
|
-
import {
|
|
10
|
+
import { Users } from "./api/resources/users/client/Client";
|
|
11
11
|
export declare namespace MavenAGIClient {
|
|
12
12
|
interface Options {
|
|
13
13
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
14
14
|
appId?: core.Supplier<string | undefined>;
|
|
15
15
|
appSecret?: core.Supplier<string | undefined>;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
xOrganizationId: core.Supplier<string>;
|
|
17
|
+
xAgentId: core.Supplier<string>;
|
|
18
18
|
fetcher?: core.FetchFunction;
|
|
19
19
|
}
|
|
20
20
|
interface RequestOptions {
|
|
@@ -34,6 +34,6 @@ export declare class MavenAGIClient {
|
|
|
34
34
|
get knowledge(): Knowledge;
|
|
35
35
|
protected _triggers: Triggers | undefined;
|
|
36
36
|
get triggers(): Triggers;
|
|
37
|
-
protected
|
|
38
|
-
get
|
|
37
|
+
protected _users: Users | undefined;
|
|
38
|
+
get users(): Users;
|
|
39
39
|
}
|
package/Client.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Actions } from "./api/resources/actions/client/Client";
|
|
|
5
5
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
6
6
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
7
7
|
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
8
|
-
import {
|
|
8
|
+
import { Users } from "./api/resources/users/client/Client";
|
|
9
9
|
export class MavenAGIClient {
|
|
10
10
|
constructor(_options) {
|
|
11
11
|
this._options = _options;
|
|
@@ -26,8 +26,8 @@ export class MavenAGIClient {
|
|
|
26
26
|
var _a;
|
|
27
27
|
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
28
28
|
}
|
|
29
|
-
get
|
|
29
|
+
get users() {
|
|
30
30
|
var _a;
|
|
31
|
-
return ((_a = this.
|
|
31
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Users(this._options)));
|
|
32
32
|
}
|
|
33
33
|
}
|
package/README.md
CHANGED
|
@@ -17,17 +17,23 @@ Instantiate and use the client with the following:
|
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
import * as environments from "../src/environments";
|
|
20
|
-
import { MavenAGIClient } from "mavenagi";
|
|
20
|
+
import { MavenAGIClient, MavenAGI } from "mavenagi";
|
|
21
21
|
|
|
22
22
|
const client = new MavenAGIClient({
|
|
23
23
|
appId: "YOUR_APP_ID",
|
|
24
24
|
appSecret: "YOUR_APP_SECRET",
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
xOrganizationId: "YOUR_X_ORGANIZATION_ID",
|
|
26
|
+
xAgentId: "YOUR_X_AGENT_ID",
|
|
27
27
|
});
|
|
28
|
-
await client.
|
|
28
|
+
await client.conversation.initialize({
|
|
29
|
+
messages: [{}],
|
|
30
|
+
context: {},
|
|
29
31
|
id: "string",
|
|
30
|
-
|
|
32
|
+
responseConfig: {
|
|
33
|
+
capabilities: [MavenAGI.Capability.Markdown],
|
|
34
|
+
isCopilot: true,
|
|
35
|
+
responseLength: MavenAGI.ResponseLength.Short,
|
|
36
|
+
},
|
|
31
37
|
});
|
|
32
38
|
```
|
|
33
39
|
|
|
@@ -40,7 +46,7 @@ will be thrown.
|
|
|
40
46
|
import { MavenAGIError } from "mavenagi";
|
|
41
47
|
|
|
42
48
|
try {
|
|
43
|
-
await client.
|
|
49
|
+
await client.initialize(...);
|
|
44
50
|
} catch (err) {
|
|
45
51
|
if (err instanceof MavenAGIError) {
|
|
46
52
|
console.log(err.statusCode);
|
|
@@ -56,7 +62,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
56
62
|
|
|
57
63
|
```typescript
|
|
58
64
|
const controller = new AbortController();
|
|
59
|
-
const response = await client.
|
|
65
|
+
const response = await client.initialize(..., {
|
|
60
66
|
abortSignal: controller.signal
|
|
61
67
|
});
|
|
62
68
|
controller.abort(); // aborts the request
|
|
@@ -105,29 +111,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
|
|
|
105
111
|
Use the `maxRetries` request option to configure this behavior.
|
|
106
112
|
|
|
107
113
|
```typescript
|
|
108
|
-
const response = await client.
|
|
109
|
-
maxRetries: 0 // override maxRetries at the request level
|
|
110
|
-
});
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Advanced
|
|
114
|
-
|
|
115
|
-
### Retries
|
|
116
|
-
|
|
117
|
-
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
118
|
-
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
|
|
119
|
-
retry limit (default: 2).
|
|
120
|
-
|
|
121
|
-
A request is deemed retriable when any of the following HTTP status codes is returned:
|
|
122
|
-
|
|
123
|
-
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
124
|
-
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
125
|
-
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
126
|
-
|
|
127
|
-
Use the `maxRetries` request option to configure this behavior.
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
const response = await client.createActionSet(..., {
|
|
114
|
+
const response = await client.initialize(..., {
|
|
131
115
|
maxRetries: 0 // override maxRetries at the request level
|
|
132
116
|
});
|
|
133
117
|
```
|
|
@@ -137,7 +121,7 @@ const response = await client.createActionSet(..., {
|
|
|
137
121
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
138
122
|
|
|
139
123
|
```typescript
|
|
140
|
-
const response = await client.
|
|
124
|
+
const response = await client.initialize(..., {
|
|
141
125
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
142
126
|
});
|
|
143
127
|
```
|
|
@@ -9,8 +9,8 @@ export declare namespace Actions {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
xOrganizationId: core.Supplier<string>;
|
|
13
|
+
xAgentId: core.Supplier<string>;
|
|
14
14
|
fetcher?: core.FetchFunction;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
@@ -22,55 +22,10 @@ export declare namespace Actions {
|
|
|
22
22
|
export declare class Actions {
|
|
23
23
|
protected readonly _options: Actions.Options;
|
|
24
24
|
constructor(_options: Actions.Options);
|
|
25
|
-
/**
|
|
26
|
-
* Update an action set or create it if it doesn't exist
|
|
27
|
-
*
|
|
28
|
-
* @param {MavenAGI.ActionSetRequest} request
|
|
29
|
-
* @param {Actions.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.actions.createActionSet({
|
|
37
|
-
* id: "string",
|
|
38
|
-
* name: "string"
|
|
39
|
-
* })
|
|
40
|
-
*/
|
|
41
|
-
createActionSet(request: MavenAGI.ActionSetRequest, requestOptions?: Actions.RequestOptions): Promise<MavenAGI.ActionSetResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Get an action set by its supplied ID
|
|
44
|
-
*
|
|
45
|
-
* @param {string} actionSetId - The ID of the action set to get
|
|
46
|
-
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
-
*
|
|
48
|
-
* @throws {@link MavenAGI.NotFoundError}
|
|
49
|
-
* @throws {@link MavenAGI.BadRequestError}
|
|
50
|
-
* @throws {@link MavenAGI.ServerError}
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* await client.actions.getActionSet("string")
|
|
54
|
-
*/
|
|
55
|
-
getActionSet(actionSetId: string, requestOptions?: Actions.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 {Actions.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.actions.deleteActionSet("string")
|
|
68
|
-
*/
|
|
69
|
-
deleteActionSet(actionSetId: string, requestOptions?: Actions.RequestOptions): Promise<void>;
|
|
70
25
|
/**
|
|
71
26
|
* Update an action or create it if it doesn't exist
|
|
72
27
|
*
|
|
73
|
-
* @param {MavenAGI.
|
|
28
|
+
* @param {MavenAGI.ActionRequest} request
|
|
74
29
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
30
|
*
|
|
76
31
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -78,23 +33,22 @@ export declare class Actions {
|
|
|
78
33
|
* @throws {@link MavenAGI.ServerError}
|
|
79
34
|
*
|
|
80
35
|
* @example
|
|
81
|
-
* await client.actions.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* name: "
|
|
86
|
-
* description: "
|
|
87
|
-
* userInteractionRequired:
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* userFormParameters: [{}]
|
|
36
|
+
* await client.actions.createOrUpdateAction({
|
|
37
|
+
* entityId: {
|
|
38
|
+
* referenceId: "get-balance"
|
|
39
|
+
* },
|
|
40
|
+
* name: "Get the user's balance",
|
|
41
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
42
|
+
* userInteractionRequired: false,
|
|
43
|
+
* requiredUserContextFieldNames: new Set(["my-billing-system.userId"]),
|
|
44
|
+
* userFormParameters: []
|
|
91
45
|
* })
|
|
92
46
|
*/
|
|
93
|
-
|
|
47
|
+
createOrUpdateAction(request: MavenAGI.ActionRequest, requestOptions?: Actions.RequestOptions): Promise<MavenAGI.ActionResponse>;
|
|
94
48
|
/**
|
|
95
49
|
* Get an action by its supplied ID
|
|
96
50
|
*
|
|
97
|
-
* @param {string}
|
|
51
|
+
* @param {string} referenceId - The reference ID of the action to get. All other entity ID fields are inferred from the request.
|
|
98
52
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
99
53
|
*
|
|
100
54
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -102,13 +56,13 @@ export declare class Actions {
|
|
|
102
56
|
* @throws {@link MavenAGI.ServerError}
|
|
103
57
|
*
|
|
104
58
|
* @example
|
|
105
|
-
* await client.actions.getAction("
|
|
59
|
+
* await client.actions.getAction("get-balance")
|
|
106
60
|
*/
|
|
107
|
-
getAction(
|
|
61
|
+
getAction(referenceId: string, requestOptions?: Actions.RequestOptions): Promise<MavenAGI.ActionResponse>;
|
|
108
62
|
/**
|
|
109
63
|
* Delete an action
|
|
110
64
|
*
|
|
111
|
-
* @param {string}
|
|
65
|
+
* @param {string} referenceId - The reference ID of the action to unregister. All other entity ID fields are inferred from the request.
|
|
112
66
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
113
67
|
*
|
|
114
68
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -116,8 +70,8 @@ export declare class Actions {
|
|
|
116
70
|
* @throws {@link MavenAGI.ServerError}
|
|
117
71
|
*
|
|
118
72
|
* @example
|
|
119
|
-
* await client.actions.deleteAction("
|
|
73
|
+
* await client.actions.deleteAction("get-balance")
|
|
120
74
|
*/
|
|
121
|
-
deleteAction(
|
|
75
|
+
deleteAction(referenceId: string, requestOptions?: Actions.RequestOptions): Promise<void>;
|
|
122
76
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
123
77
|
}
|