mavenagi 0.0.0-alpha.3 → 0.0.0-alpha.4
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 +9 -6
- package/Client.js +13 -8
- package/README.md +57 -33
- package/api/resources/actions/client/Client.d.ts +123 -0
- package/api/resources/actions/client/Client.js +564 -0
- package/api/resources/{action → actions}/types/Action.d.ts +2 -2
- package/{dist/api/resources/actionSet → api/resources/actions}/types/ActionSetResponse.d.ts +0 -2
- package/api/resources/{actionSet → actions}/types/index.d.ts +2 -0
- package/{dist/serialization/resources/actionSet → api/resources/actions}/types/index.js +2 -0
- package/api/resources/commons/types/AppUser.d.ts +10 -0
- package/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/api/resources/commons/types/Feedback.d.ts +1 -1
- package/api/resources/commons/types/index.d.ts +4 -0
- package/api/resources/commons/types/index.js +4 -0
- package/api/resources/conversation/client/Client.d.ts +8 -2
- package/api/resources/conversation/client/Client.js +16 -10
- package/api/resources/conversation/types/AskRequest.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +8 -0
- package/api/resources/conversation/types/Capability.js +7 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/api/resources/conversation/types/ResponseLength.js +8 -0
- package/api/resources/conversation/types/index.d.ts +3 -0
- package/api/resources/conversation/types/index.js +3 -0
- package/api/resources/index.d.ts +5 -4
- package/api/resources/index.js +5 -4
- package/api/resources/knowledge/client/Client.d.ts +22 -6
- package/api/resources/knowledge/client/Client.js +103 -14
- package/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
- package/api/resources/knowledge/types/index.d.ts +4 -1
- package/api/resources/knowledge/types/index.js +4 -1
- package/api/resources/{action → triggers}/client/Client.d.ts +23 -29
- package/api/resources/{actionSet → triggers}/client/Client.js +32 -31
- package/api/resources/triggers/types/EventTrigger.d.ts +12 -0
- package/api/resources/triggers/types/EventTrigger.js +4 -0
- package/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/api/resources/triggers/types/index.d.ts +2 -0
- package/api/resources/triggers/types/index.js +2 -0
- package/api/resources/user/client/Client.d.ts +62 -0
- package/api/resources/{action → user}/client/Client.js +29 -113
- package/api/resources/user/index.d.ts +1 -0
- package/api/resources/user/index.js +1 -0
- package/dist/Client.d.ts +9 -6
- package/dist/Client.js +13 -8
- package/dist/api/resources/actions/client/Client.d.ts +123 -0
- package/dist/api/resources/actions/client/Client.js +564 -0
- package/dist/api/resources/{action → actions}/types/Action.d.ts +2 -2
- package/dist/api/resources/actions/types/Action.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionSetBase.js +4 -0
- package/dist/api/resources/actions/types/ActionSetRequest.js +4 -0
- package/{api/resources/actionSet → dist/api/resources/actions}/types/ActionSetResponse.d.ts +0 -2
- package/dist/api/resources/actions/types/ActionSetResponse.js +4 -0
- package/dist/{serialization/resources/actionSet → api/resources/actions}/types/index.d.ts +2 -0
- package/{api/resources/actionSet → dist/api/resources/actions}/types/index.js +2 -0
- package/dist/api/resources/commons/types/AppUser.d.ts +10 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentification.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingProperty.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +1 -1
- package/dist/api/resources/commons/types/index.d.ts +4 -0
- package/dist/api/resources/commons/types/index.js +4 -0
- package/dist/api/resources/conversation/client/Client.d.ts +8 -2
- package/dist/api/resources/conversation/client/Client.js +16 -10
- package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +8 -0
- package/dist/api/resources/conversation/types/Capability.js +7 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
- package/dist/api/resources/conversation/types/index.d.ts +3 -0
- package/dist/api/resources/conversation/types/index.js +3 -0
- package/dist/api/resources/index.d.ts +5 -4
- package/dist/api/resources/index.js +5 -4
- package/dist/api/resources/knowledge/client/Client.d.ts +22 -6
- package/dist/api/resources/knowledge/client/Client.js +103 -14
- package/dist/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +4 -1
- package/dist/api/resources/knowledge/types/index.js +4 -1
- package/dist/api/resources/{action → triggers}/client/Client.d.ts +23 -29
- package/dist/api/resources/{actionSet → triggers}/client/Client.js +32 -31
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/triggers/client/index.js +1 -0
- package/dist/api/resources/triggers/types/EventTrigger.d.ts +12 -0
- package/dist/api/resources/triggers/types/EventTrigger.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/dist/api/resources/triggers/types/index.d.ts +2 -0
- package/dist/api/resources/triggers/types/index.js +2 -0
- package/dist/api/resources/user/client/Client.d.ts +62 -0
- package/dist/api/resources/{action → user}/client/Client.js +29 -113
- package/dist/api/resources/user/client/index.d.ts +1 -0
- package/dist/api/resources/user/client/index.js +1 -0
- package/dist/api/resources/user/index.d.ts +1 -0
- package/dist/api/resources/user/index.js +1 -0
- package/dist/serialization/resources/{actionSet → actions}/types/ActionSetResponse.d.ts +0 -2
- package/dist/serialization/resources/actions/types/ActionSetResponse.js +6 -0
- package/dist/{api/resources/actionSet → serialization/resources/actions}/types/index.d.ts +2 -0
- package/{serialization/resources/actionSet → dist/serialization/resources/actions}/types/index.js +2 -0
- package/dist/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AppUser.js +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/dist/serialization/resources/commons/types/Feedback.d.ts +1 -1
- package/dist/serialization/resources/commons/types/Feedback.js +1 -1
- package/dist/serialization/resources/commons/types/index.d.ts +4 -0
- package/dist/serialization/resources/commons/types/index.js +4 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/AskRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Capability.js +5 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +2 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +3 -0
- package/dist/serialization/resources/conversation/types/index.js +3 -0
- package/dist/serialization/resources/index.d.ts +4 -4
- package/dist/serialization/resources/index.js +4 -4
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.js → BaseKnowledgeDocument.js} +3 -4
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +4 -1
- package/dist/serialization/resources/knowledge/types/index.js +4 -1
- package/dist/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
- package/dist/serialization/resources/triggers/types/EventTrigger.js +10 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +2 -0
- package/dist/serialization/resources/triggers/types/index.js +2 -0
- package/package.json +1 -1
- package/serialization/resources/{actionSet → actions}/types/ActionSetResponse.d.ts +0 -2
- package/serialization/resources/actions/types/ActionSetResponse.js +6 -0
- package/serialization/resources/{actionSet → actions}/types/index.d.ts +2 -0
- package/{dist/api/resources/actionSet → serialization/resources/actions}/types/index.js +2 -0
- package/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/serialization/resources/commons/types/AppUser.js +10 -0
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/serialization/resources/commons/types/Feedback.d.ts +1 -1
- package/serialization/resources/commons/types/Feedback.js +1 -1
- package/serialization/resources/commons/types/index.d.ts +4 -0
- package/serialization/resources/commons/types/index.js +4 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/AskRequest.js +2 -0
- package/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/serialization/resources/conversation/types/Capability.js +5 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationBase.js +2 -0
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/serialization/resources/conversation/types/index.d.ts +3 -0
- package/serialization/resources/conversation/types/index.js +3 -0
- package/serialization/resources/index.d.ts +4 -4
- package/serialization/resources/index.js +4 -4
- package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
- package/serialization/resources/knowledge/types/{KnowledgeDocument.js → BaseKnowledgeDocument.js} +3 -4
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
- package/serialization/resources/knowledge/types/index.d.ts +4 -1
- package/serialization/resources/knowledge/types/index.js +4 -1
- package/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
- package/serialization/resources/triggers/types/EventTrigger.js +10 -0
- package/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/serialization/resources/triggers/types/index.d.ts +2 -0
- package/serialization/resources/triggers/types/index.js +2 -0
- package/api/resources/action/types/index.d.ts +0 -2
- package/api/resources/action/types/index.js +0 -2
- package/api/resources/actionSet/client/Client.d.ts +0 -71
- package/dist/api/resources/action/types/index.d.ts +0 -2
- package/dist/api/resources/action/types/index.js +0 -2
- package/dist/api/resources/actionSet/client/Client.d.ts +0 -71
- package/dist/serialization/resources/action/types/index.d.ts +0 -2
- package/dist/serialization/resources/action/types/index.js +0 -2
- package/dist/serialization/resources/actionSet/types/ActionSetResponse.js +0 -11
- package/serialization/resources/action/types/index.d.ts +0 -2
- package/serialization/resources/action/types/index.js +0 -2
- package/serialization/resources/actionSet/types/ActionSetResponse.js +0 -11
- /package/api/resources/{action → actions}/client/index.d.ts +0 -0
- /package/api/resources/{action → actions}/client/index.js +0 -0
- /package/api/resources/{action → actions}/index.d.ts +0 -0
- /package/api/resources/{action → actions}/index.js +0 -0
- /package/api/resources/{action → actions}/types/Action.js +0 -0
- /package/api/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
- /package/api/resources/{action → actions}/types/ActionParameter.js +0 -0
- /package/api/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
- /package/api/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
- /package/api/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
- /package/api/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
- /package/api/resources/{actionSet → actions}/types/ActionSetResponse.js +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocument.js → commons/types/AppUser.js} +0 -0
- /package/{dist/api/resources/action/types/Action.js → api/resources/commons/types/AppUserIdentification.js} +0 -0
- /package/{dist/api/resources/action/types/ActionParameter.js → api/resources/commons/types/AppUserIdentifyingProperty.js} +0 -0
- /package/{dist/api/resources/actionSet/types/ActionSetBase.js → api/resources/conversation/types/ResponseConfig.js} +0 -0
- /package/{dist/api/resources/actionSet/types/ActionSetRequest.js → api/resources/knowledge/types/BaseKnowledgeDocument.js} +0 -0
- /package/{dist/api/resources/actionSet/types/ActionSetResponse.js → api/resources/knowledge/types/KnowledgeDocumentRequest.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/knowledge/types/KnowledgeDocumentResponse.js} +0 -0
- /package/api/resources/{actionSet → triggers}/client/index.d.ts +0 -0
- /package/api/resources/{actionSet → triggers}/client/index.js +0 -0
- /package/api/resources/{actionSet → triggers}/index.d.ts +0 -0
- /package/api/resources/{actionSet → triggers}/index.js +0 -0
- /package/{dist/api/resources/action → api/resources/user}/client/index.d.ts +0 -0
- /package/{dist/api/resources/action → api/resources/user}/client/index.js +0 -0
- /package/dist/api/resources/{actionSet → actions}/client/index.d.ts +0 -0
- /package/dist/api/resources/{actionSet → actions}/client/index.js +0 -0
- /package/dist/api/resources/{action → actions}/index.d.ts +0 -0
- /package/dist/api/resources/{action → actions}/index.js +0 -0
- /package/dist/api/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
- /package/dist/api/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
- /package/dist/api/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
- /package/dist/api/resources/{actionSet → triggers}/index.d.ts +0 -0
- /package/dist/api/resources/{actionSet → triggers}/index.js +0 -0
- /package/dist/serialization/resources/{action → actions}/index.d.ts +0 -0
- /package/dist/serialization/resources/{action → actions}/index.js +0 -0
- /package/dist/serialization/resources/{action → actions}/types/Action.d.ts +0 -0
- /package/dist/serialization/resources/{action → actions}/types/Action.js +0 -0
- /package/dist/serialization/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
- /package/dist/serialization/resources/{action → actions}/types/ActionParameter.js +0 -0
- /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
- /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
- /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
- /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
- /package/dist/serialization/resources/{actionSet → triggers}/index.d.ts +0 -0
- /package/dist/serialization/resources/{actionSet → triggers}/index.js +0 -0
- /package/serialization/resources/{action → actions}/index.d.ts +0 -0
- /package/serialization/resources/{action → actions}/index.js +0 -0
- /package/serialization/resources/{action → actions}/types/Action.d.ts +0 -0
- /package/serialization/resources/{action → actions}/types/Action.js +0 -0
- /package/serialization/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
- /package/serialization/resources/{action → actions}/types/ActionParameter.js +0 -0
- /package/serialization/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
- /package/serialization/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
- /package/serialization/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
- /package/serialization/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
- /package/serialization/resources/{actionSet → triggers}/index.d.ts +0 -0
- /package/serialization/resources/{actionSet → triggers}/index.js +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
6
|
import * as MavenAGI from "../../../index";
|
|
7
|
-
export declare namespace
|
|
7
|
+
export declare namespace Triggers {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
@@ -19,60 +19,54 @@ export declare namespace Action {
|
|
|
19
19
|
abortSignal?: AbortSignal;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
export declare class
|
|
23
|
-
protected readonly _options:
|
|
24
|
-
constructor(_options:
|
|
22
|
+
export declare class Triggers {
|
|
23
|
+
protected readonly _options: Triggers.Options;
|
|
24
|
+
constructor(_options: Triggers.Options);
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Update an event trigger or create it if it doesn't exist.
|
|
27
27
|
*
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {
|
|
28
|
+
* @param {MavenAGI.EventTrigger} request
|
|
29
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
30
|
*
|
|
31
31
|
* @throws {@link MavenAGI.NotFoundError}
|
|
32
32
|
* @throws {@link MavenAGI.BadRequestError}
|
|
33
33
|
* @throws {@link MavenAGI.ServerError}
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
|
-
* await client.
|
|
36
|
+
* await client.triggers.registerTrigger({
|
|
37
|
+
* id: "string",
|
|
38
|
+
* description: "string",
|
|
39
|
+
* type: MavenAGI.EventTriggerType.ConversationCreated
|
|
40
|
+
* })
|
|
37
41
|
*/
|
|
38
|
-
|
|
42
|
+
registerTrigger(request: MavenAGI.EventTrigger, requestOptions?: Triggers.RequestOptions): Promise<MavenAGI.EventTrigger>;
|
|
39
43
|
/**
|
|
40
|
-
*
|
|
44
|
+
* Get an event trigger by its supplied ID
|
|
41
45
|
*
|
|
42
|
-
* @param {
|
|
43
|
-
* @param {
|
|
46
|
+
* @param {string} triggerId - The ID of the event trigger to get
|
|
47
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
48
|
*
|
|
45
49
|
* @throws {@link MavenAGI.NotFoundError}
|
|
46
50
|
* @throws {@link MavenAGI.BadRequestError}
|
|
47
51
|
* @throws {@link MavenAGI.ServerError}
|
|
48
52
|
*
|
|
49
53
|
* @example
|
|
50
|
-
* await client.
|
|
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
|
-
* })
|
|
54
|
+
* await client.triggers.getTrigger("string")
|
|
61
55
|
*/
|
|
62
|
-
|
|
56
|
+
getTrigger(triggerId: string, requestOptions?: Triggers.RequestOptions): Promise<MavenAGI.EventTrigger>;
|
|
63
57
|
/**
|
|
64
|
-
*
|
|
58
|
+
* Unregister an event trigger
|
|
65
59
|
*
|
|
66
|
-
* @param {string}
|
|
67
|
-
* @param {
|
|
60
|
+
* @param {string} triggerId - The ID of the event trigger to unregister
|
|
61
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
62
|
*
|
|
69
63
|
* @throws {@link MavenAGI.NotFoundError}
|
|
70
64
|
* @throws {@link MavenAGI.BadRequestError}
|
|
71
65
|
* @throws {@link MavenAGI.ServerError}
|
|
72
66
|
*
|
|
73
67
|
* @example
|
|
74
|
-
* await client.
|
|
68
|
+
* await client.triggers.unregisterTrigger("string")
|
|
75
69
|
*/
|
|
76
|
-
|
|
70
|
+
unregisterTrigger(triggerId: string, requestOptions?: Triggers.RequestOptions): Promise<void>;
|
|
77
71
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
78
72
|
}
|
|
@@ -13,49 +13,54 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
import * as environments from "../../../../environments";
|
|
14
14
|
import * as core from "../../../../core";
|
|
15
15
|
import * as MavenAGI from "../../../index";
|
|
16
|
-
import urlJoin from "url-join";
|
|
17
16
|
import * as serializers from "../../../../serialization/index";
|
|
17
|
+
import urlJoin from "url-join";
|
|
18
18
|
import * as errors from "../../../../errors/index";
|
|
19
|
-
export class
|
|
19
|
+
export class Triggers {
|
|
20
20
|
constructor(_options) {
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Update an event trigger or create it if it doesn't exist.
|
|
25
25
|
*
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
26
|
+
* @param {MavenAGI.EventTrigger} request
|
|
27
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
29
|
* @throws {@link MavenAGI.NotFoundError}
|
|
30
30
|
* @throws {@link MavenAGI.BadRequestError}
|
|
31
31
|
* @throws {@link MavenAGI.ServerError}
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
|
-
* await client.
|
|
34
|
+
* await client.triggers.registerTrigger({
|
|
35
|
+
* id: "string",
|
|
36
|
+
* description: "string",
|
|
37
|
+
* type: MavenAGI.EventTriggerType.ConversationCreated
|
|
38
|
+
* })
|
|
35
39
|
*/
|
|
36
|
-
|
|
40
|
+
registerTrigger(request, requestOptions) {
|
|
37
41
|
var _a, _b;
|
|
38
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
43
|
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,
|
|
41
|
-
method: "
|
|
44
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/triggers"),
|
|
45
|
+
method: "PUT",
|
|
42
46
|
headers: {
|
|
43
47
|
Authorization: yield this._getAuthorizationHeader(),
|
|
44
48
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
45
49
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
46
50
|
"X-Fern-Language": "JavaScript",
|
|
47
51
|
"X-Fern-SDK-Name": "mavenagi",
|
|
48
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
52
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
49
53
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
54
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
55
|
},
|
|
52
56
|
contentType: "application/json",
|
|
57
|
+
body: yield serializers.EventTrigger.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
53
58
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
54
59
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
55
60
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
61
|
});
|
|
57
62
|
if (_response.ok) {
|
|
58
|
-
return yield serializers.
|
|
63
|
+
return yield serializers.EventTrigger.parseOrThrow(_response.body, {
|
|
59
64
|
unrecognizedObjectKeys: "passthrough",
|
|
60
65
|
allowUnrecognizedUnionMembers: true,
|
|
61
66
|
allowUnrecognizedEnumValues: true,
|
|
@@ -108,45 +113,41 @@ export class ActionSet {
|
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
115
|
/**
|
|
111
|
-
*
|
|
116
|
+
* Get an event trigger by its supplied ID
|
|
112
117
|
*
|
|
113
|
-
* @param {
|
|
114
|
-
* @param {
|
|
118
|
+
* @param {string} triggerId - The ID of the event trigger to get
|
|
119
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
120
|
*
|
|
116
121
|
* @throws {@link MavenAGI.NotFoundError}
|
|
117
122
|
* @throws {@link MavenAGI.BadRequestError}
|
|
118
123
|
* @throws {@link MavenAGI.ServerError}
|
|
119
124
|
*
|
|
120
125
|
* @example
|
|
121
|
-
* await client.
|
|
122
|
-
* id: "string",
|
|
123
|
-
* name: "string"
|
|
124
|
-
* })
|
|
126
|
+
* await client.triggers.getTrigger("string")
|
|
125
127
|
*/
|
|
126
|
-
|
|
128
|
+
getTrigger(triggerId, requestOptions) {
|
|
127
129
|
var _a, _b;
|
|
128
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
131
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
130
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
131
|
-
method: "
|
|
132
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(triggerId)}`),
|
|
133
|
+
method: "GET",
|
|
132
134
|
headers: {
|
|
133
135
|
Authorization: yield this._getAuthorizationHeader(),
|
|
134
136
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
135
137
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
136
138
|
"X-Fern-Language": "JavaScript",
|
|
137
139
|
"X-Fern-SDK-Name": "mavenagi",
|
|
138
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
140
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
139
141
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
140
142
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
141
143
|
},
|
|
142
144
|
contentType: "application/json",
|
|
143
|
-
body: yield serializers.ActionSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
144
145
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
145
146
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
146
147
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
147
148
|
});
|
|
148
149
|
if (_response.ok) {
|
|
149
|
-
return yield serializers.
|
|
150
|
+
return yield serializers.EventTrigger.parseOrThrow(_response.body, {
|
|
150
151
|
unrecognizedObjectKeys: "passthrough",
|
|
151
152
|
allowUnrecognizedUnionMembers: true,
|
|
152
153
|
allowUnrecognizedEnumValues: true,
|
|
@@ -199,23 +200,23 @@ export class ActionSet {
|
|
|
199
200
|
});
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
202
|
-
*
|
|
203
|
+
* Unregister an event trigger
|
|
203
204
|
*
|
|
204
|
-
* @param {string}
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {string} triggerId - The ID of the event trigger to unregister
|
|
206
|
+
* @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
207
|
*
|
|
207
208
|
* @throws {@link MavenAGI.NotFoundError}
|
|
208
209
|
* @throws {@link MavenAGI.BadRequestError}
|
|
209
210
|
* @throws {@link MavenAGI.ServerError}
|
|
210
211
|
*
|
|
211
212
|
* @example
|
|
212
|
-
* await client.
|
|
213
|
+
* await client.triggers.unregisterTrigger("string")
|
|
213
214
|
*/
|
|
214
|
-
|
|
215
|
+
unregisterTrigger(triggerId, requestOptions) {
|
|
215
216
|
var _a, _b;
|
|
216
217
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
218
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
218
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/
|
|
219
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/triggers/${encodeURIComponent(triggerId)}`),
|
|
219
220
|
method: "DELETE",
|
|
220
221
|
headers: {
|
|
221
222
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -223,7 +224,7 @@ export class ActionSet {
|
|
|
223
224
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
224
225
|
"X-Fern-Language": "JavaScript",
|
|
225
226
|
"X-Fern-SDK-Name": "mavenagi",
|
|
226
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
227
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
227
228
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
228
229
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
229
230
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export interface EventTrigger {
|
|
6
|
+
/** Externally supplied ID to uniquely identify this event trigger */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The description of what the event trigger does, shown in the Maven Dashboard */
|
|
9
|
+
description: string;
|
|
10
|
+
/** The type of event trigger this app wishes to handle */
|
|
11
|
+
type: MavenAGI.EventTriggerType;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type EventTriggerType = "CONVERSATION_CREATED" | "FEEDBACK_CREATED";
|
|
5
|
+
export declare const EventTriggerType: {
|
|
6
|
+
readonly ConversationCreated: "CONVERSATION_CREATED";
|
|
7
|
+
readonly FeedbackCreated: "FEEDBACK_CREATED";
|
|
8
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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 User {
|
|
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 User {
|
|
23
|
+
protected readonly _options: User.Options;
|
|
24
|
+
constructor(_options: User.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Create a new user or update an existing one
|
|
27
|
+
*
|
|
28
|
+
* @param {MavenAGI.AppUser} request
|
|
29
|
+
* @param {User.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.user.upsertAppUser({
|
|
37
|
+
* id: "string",
|
|
38
|
+
* userIdentifiers: {
|
|
39
|
+
* identifiers: new Set([{}])
|
|
40
|
+
* },
|
|
41
|
+
* metadata: {
|
|
42
|
+
* "string": "string"
|
|
43
|
+
* }
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
upsertAppUser(request: MavenAGI.AppUser, requestOptions?: User.RequestOptions): Promise<MavenAGI.AppUser>;
|
|
47
|
+
/**
|
|
48
|
+
* Get a user
|
|
49
|
+
*
|
|
50
|
+
* @param {string} userId - The ID of the user to get
|
|
51
|
+
* @param {User.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
54
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
55
|
+
* @throws {@link MavenAGI.ServerError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.user.getAppUser("string")
|
|
59
|
+
*/
|
|
60
|
+
getAppUser(userId: string, requestOptions?: User.RequestOptions): Promise<MavenAGI.AppUser>;
|
|
61
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
62
|
+
}
|
|
@@ -13,49 +13,58 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
import * as environments from "../../../../environments";
|
|
14
14
|
import * as core from "../../../../core";
|
|
15
15
|
import * as MavenAGI from "../../../index";
|
|
16
|
-
import urlJoin from "url-join";
|
|
17
16
|
import * as serializers from "../../../../serialization/index";
|
|
17
|
+
import urlJoin from "url-join";
|
|
18
18
|
import * as errors from "../../../../errors/index";
|
|
19
|
-
export class
|
|
19
|
+
export class User {
|
|
20
20
|
constructor(_options) {
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Create a new user or update an existing one
|
|
25
25
|
*
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
26
|
+
* @param {MavenAGI.AppUser} request
|
|
27
|
+
* @param {User.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
29
|
* @throws {@link MavenAGI.NotFoundError}
|
|
30
30
|
* @throws {@link MavenAGI.BadRequestError}
|
|
31
31
|
* @throws {@link MavenAGI.ServerError}
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
|
-
* await client.
|
|
34
|
+
* await client.user.upsertAppUser({
|
|
35
|
+
* id: "string",
|
|
36
|
+
* userIdentifiers: {
|
|
37
|
+
* identifiers: new Set([{}])
|
|
38
|
+
* },
|
|
39
|
+
* metadata: {
|
|
40
|
+
* "string": "string"
|
|
41
|
+
* }
|
|
42
|
+
* })
|
|
35
43
|
*/
|
|
36
|
-
|
|
44
|
+
upsertAppUser(request, requestOptions) {
|
|
37
45
|
var _a, _b;
|
|
38
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
47
|
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,
|
|
41
|
-
method: "
|
|
48
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/users"),
|
|
49
|
+
method: "PUT",
|
|
42
50
|
headers: {
|
|
43
51
|
Authorization: yield this._getAuthorizationHeader(),
|
|
44
52
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
45
53
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
46
54
|
"X-Fern-Language": "JavaScript",
|
|
47
55
|
"X-Fern-SDK-Name": "mavenagi",
|
|
48
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
56
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
49
57
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
58
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
59
|
},
|
|
52
60
|
contentType: "application/json",
|
|
61
|
+
body: yield serializers.AppUser.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
53
62
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
54
63
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
55
64
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
65
|
});
|
|
57
66
|
if (_response.ok) {
|
|
58
|
-
return yield serializers.
|
|
67
|
+
return yield serializers.AppUser.parseOrThrow(_response.body, {
|
|
59
68
|
unrecognizedObjectKeys: "passthrough",
|
|
60
69
|
allowUnrecognizedUnionMembers: true,
|
|
61
70
|
allowUnrecognizedEnumValues: true,
|
|
@@ -108,52 +117,41 @@ export class Action {
|
|
|
108
117
|
});
|
|
109
118
|
}
|
|
110
119
|
/**
|
|
111
|
-
*
|
|
120
|
+
* Get a user
|
|
112
121
|
*
|
|
113
|
-
* @param {
|
|
114
|
-
* @param {
|
|
122
|
+
* @param {string} userId - The ID of the user to get
|
|
123
|
+
* @param {User.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
124
|
*
|
|
116
125
|
* @throws {@link MavenAGI.NotFoundError}
|
|
117
126
|
* @throws {@link MavenAGI.BadRequestError}
|
|
118
127
|
* @throws {@link MavenAGI.ServerError}
|
|
119
128
|
*
|
|
120
129
|
* @example
|
|
121
|
-
* await client.
|
|
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
|
-
* })
|
|
130
|
+
* await client.user.getAppUser("string")
|
|
132
131
|
*/
|
|
133
|
-
|
|
132
|
+
getAppUser(userId, requestOptions) {
|
|
134
133
|
var _a, _b;
|
|
135
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
136
135
|
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,
|
|
138
|
-
method: "
|
|
136
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/users/${encodeURIComponent(userId)}`),
|
|
137
|
+
method: "GET",
|
|
139
138
|
headers: {
|
|
140
139
|
Authorization: yield this._getAuthorizationHeader(),
|
|
141
140
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
142
141
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
143
142
|
"X-Fern-Language": "JavaScript",
|
|
144
143
|
"X-Fern-SDK-Name": "mavenagi",
|
|
145
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
144
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
146
145
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
147
146
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
148
147
|
},
|
|
149
148
|
contentType: "application/json",
|
|
150
|
-
body: yield serializers.Action.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
151
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
152
150
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
153
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
154
152
|
});
|
|
155
153
|
if (_response.ok) {
|
|
156
|
-
return yield serializers.
|
|
154
|
+
return yield serializers.AppUser.parseOrThrow(_response.body, {
|
|
157
155
|
unrecognizedObjectKeys: "passthrough",
|
|
158
156
|
allowUnrecognizedUnionMembers: true,
|
|
159
157
|
allowUnrecognizedEnumValues: true,
|
|
@@ -205,88 +203,6 @@ export class Action {
|
|
|
205
203
|
}
|
|
206
204
|
});
|
|
207
205
|
}
|
|
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
206
|
_getAuthorizationHeader() {
|
|
291
207
|
var _a, _b;
|
|
292
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
package/dist/Client.d.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import {
|
|
7
|
-
import { Action } from "./api/resources/action/client/Client";
|
|
6
|
+
import { Actions } from "./api/resources/actions/client/Client";
|
|
8
7
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
9
8
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
9
|
+
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
10
|
+
import { User } from "./api/resources/user/client/Client";
|
|
10
11
|
export declare namespace MavenAGIClient {
|
|
11
12
|
interface Options {
|
|
12
13
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
@@ -25,12 +26,14 @@ export declare namespace MavenAGIClient {
|
|
|
25
26
|
export declare class MavenAGIClient {
|
|
26
27
|
protected readonly _options: MavenAGIClient.Options;
|
|
27
28
|
constructor(_options: MavenAGIClient.Options);
|
|
28
|
-
protected
|
|
29
|
-
get
|
|
30
|
-
protected _action: Action | undefined;
|
|
31
|
-
get action(): Action;
|
|
29
|
+
protected _actions: Actions | undefined;
|
|
30
|
+
get actions(): Actions;
|
|
32
31
|
protected _conversation: Conversation | undefined;
|
|
33
32
|
get conversation(): Conversation;
|
|
34
33
|
protected _knowledge: Knowledge | undefined;
|
|
35
34
|
get knowledge(): Knowledge;
|
|
35
|
+
protected _triggers: Triggers | undefined;
|
|
36
|
+
get triggers(): Triggers;
|
|
37
|
+
protected _user: User | undefined;
|
|
38
|
+
get user(): User;
|
|
36
39
|
}
|