mavenagi 0.0.0-alpha.11 → 0.0.0-alpha.14
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 -0
- package/README.md +49 -5
- package/api/resources/actions/client/Client.d.ts +9 -0
- package/api/resources/actions/client/Client.js +18 -15
- package/api/resources/commons/types/AppUser.d.ts +3 -2
- package/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +19 -1
- package/api/resources/commons/types/AppUserResponse.d.ts +34 -2
- package/api/resources/commons/types/EntityType.d.ts +2 -1
- package/api/resources/commons/types/EntityType.js +1 -0
- package/api/resources/commons/types/Feedback.d.ts +4 -8
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/UserData.d.ts +1 -1
- package/api/resources/commons/types/index.d.ts +4 -2
- package/api/resources/commons/types/index.js +4 -2
- package/api/resources/conversation/client/Client.d.ts +39 -22
- package/api/resources/conversation/client/Client.js +97 -77
- package/api/resources/conversation/types/AskRequest.d.ts +2 -4
- package/api/resources/conversation/types/ConversationBase.d.ts +12 -0
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
- package/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/api/resources/conversation/types/index.d.ts +0 -2
- package/api/resources/conversation/types/index.js +0 -2
- package/api/resources/knowledge/client/Client.d.ts +9 -0
- package/api/resources/knowledge/client/Client.js +44 -37
- package/api/resources/triggers/client/Client.d.ts +9 -0
- package/api/resources/triggers/client/Client.js +18 -15
- package/api/resources/triggers/types/index.d.ts +0 -3
- package/api/resources/triggers/types/index.js +0 -3
- package/api/resources/users/client/Client.d.ts +27 -14
- package/api/resources/users/client/Client.js +32 -26
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +18 -159
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +6 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +32 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +19 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +38 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +28 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +32 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -0
- package/dist/api/resources/actions/client/Client.d.ts +9 -0
- package/dist/api/resources/actions/client/Client.js +18 -15
- package/dist/api/resources/commons/types/AppUser.d.ts +3 -2
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +19 -1
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +34 -2
- package/dist/api/resources/commons/types/EntityType.d.ts +2 -1
- package/dist/api/resources/commons/types/EntityType.js +1 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +4 -8
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.d.ts +1 -1
- package/dist/api/resources/commons/types/index.d.ts +4 -2
- package/dist/api/resources/commons/types/index.js +4 -2
- package/dist/api/resources/conversation/client/Client.d.ts +39 -22
- package/dist/api/resources/conversation/client/Client.js +97 -77
- package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -4
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/dist/api/resources/conversation/types/index.d.ts +0 -2
- package/dist/api/resources/conversation/types/index.js +0 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +9 -0
- package/dist/api/resources/knowledge/client/Client.js +44 -37
- package/dist/api/resources/triggers/client/Client.d.ts +9 -0
- package/dist/api/resources/triggers/client/Client.js +18 -15
- package/dist/api/resources/triggers/types/index.d.ts +0 -3
- package/dist/api/resources/triggers/types/index.js +0 -3
- package/dist/api/resources/users/client/Client.d.ts +27 -14
- package/dist/api/resources/users/client/Client.js +32 -26
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +18 -159
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +32 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +19 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +38 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +28 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +32 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/commons/types/AppUser.d.ts +3 -3
- package/dist/serialization/resources/commons/types/AppUser.js +3 -3
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.js +2 -1
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +1 -0
- package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
- package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
- package/dist/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/dist/serialization/resources/commons/types/Feedback.js +9 -8
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/dist/serialization/resources/commons/types/UserData.d.ts +1 -1
- package/dist/serialization/resources/commons/types/UserData.js +1 -1
- package/dist/serialization/resources/commons/types/index.d.ts +4 -2
- package/dist/serialization/resources/commons/types/index.js +4 -2
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
- package/dist/serialization/resources/conversation/types/AskRequest.js +1 -4
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +6 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +0 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +2 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/index.js +0 -2
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/dist/serialization/resources/triggers/types/index.d.ts +0 -3
- package/dist/serialization/resources/triggers/types/index.js +0 -3
- package/package.json +7 -2
- package/reference.md +1732 -0
- package/serialization/resources/commons/types/AppUser.d.ts +3 -3
- package/serialization/resources/commons/types/AppUser.js +3 -3
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserRequest.js +1 -1
- package/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
- package/serialization/resources/commons/types/AppUserResponse.js +2 -1
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
- package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
- package/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/serialization/resources/commons/types/Feedback.js +9 -8
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/serialization/resources/commons/types/UserData.d.ts +1 -1
- package/serialization/resources/commons/types/UserData.js +1 -1
- package/serialization/resources/commons/types/index.d.ts +4 -2
- package/serialization/resources/commons/types/index.js +4 -2
- package/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
- package/serialization/resources/conversation/types/AskRequest.js +1 -4
- package/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
- package/serialization/resources/conversation/types/ConversationBase.js +6 -0
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.js +0 -2
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +2 -0
- package/serialization/resources/conversation/types/index.d.ts +0 -2
- package/serialization/resources/conversation/types/index.js +0 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/serialization/resources/triggers/types/index.d.ts +0 -3
- package/serialization/resources/triggers/types/index.js +0 -3
- package/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/api/resources/commons/types/User.d.ts +0 -10
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationContext.js +0 -4
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/api/resources/conversation/types/ConversationMessageContext.js +0 -4
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/dist/api/resources/commons/types/AppUserIdentification.js +0 -4
- package/dist/api/resources/commons/types/User.d.ts +0 -10
- package/dist/api/resources/commons/types/User.js +0 -4
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationContext.js +0 -4
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/conversation/types/ConversationMessageContext.js +0 -4
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/dist/serialization/resources/commons/types/User.d.ts +0 -15
- package/dist/serialization/resources/commons/types/User.js +0 -10
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/serialization/resources/commons/types/User.d.ts +0 -15
- package/serialization/resources/commons/types/User.js +0 -10
- package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/api/resources/commons/types/{AppUserIdentification.js → FeedbackBase.js} +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/{api/resources/commons/types/User.js → dist/api/resources/commons/types/FeedbackBase.js} +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
5
|
export interface UserMessageBase extends MavenAGI.ConversationMessageBase {
|
|
6
|
+
/** ID that uniquely identifies the user that created this message */
|
|
7
|
+
userId: MavenAGI.EntityIdBase;
|
|
6
8
|
/** The text of the message. Cannot be empty */
|
|
7
9
|
text: string;
|
|
8
10
|
userMessageType: MavenAGI.UserConversationMessageType;
|
|
@@ -18,8 +18,6 @@ export * from "./BotTextResponse";
|
|
|
18
18
|
export * from "./BotActionFormResponse";
|
|
19
19
|
export * from "./ActionFormField";
|
|
20
20
|
export * from "./SubmitActionFormRequest";
|
|
21
|
-
export * from "./ConversationContext";
|
|
22
|
-
export * from "./ConversationMessageContext";
|
|
23
21
|
export * from "./UserConversationMessageType";
|
|
24
22
|
export * from "./BotConversationMessageType";
|
|
25
23
|
export * from "./FeedbackRequest";
|
|
@@ -18,8 +18,6 @@ export * from "./BotTextResponse";
|
|
|
18
18
|
export * from "./BotActionFormResponse";
|
|
19
19
|
export * from "./ActionFormField";
|
|
20
20
|
export * from "./SubmitActionFormRequest";
|
|
21
|
-
export * from "./ConversationContext";
|
|
22
|
-
export * from "./ConversationMessageContext";
|
|
23
21
|
export * from "./UserConversationMessageType";
|
|
24
22
|
export * from "./BotConversationMessageType";
|
|
25
23
|
export * from "./FeedbackRequest";
|
|
@@ -9,14 +9,23 @@ export declare namespace Knowledge {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Organization-Id header */
|
|
12
13
|
organizationId: core.Supplier<string>;
|
|
14
|
+
/** Override the X-Agent-Id header */
|
|
13
15
|
agentId: core.Supplier<string>;
|
|
14
16
|
fetcher?: core.FetchFunction;
|
|
15
17
|
}
|
|
16
18
|
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
20
|
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
22
|
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
19
24
|
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-Organization-Id header */
|
|
26
|
+
organizationId?: string;
|
|
27
|
+
/** Override the X-Agent-Id header */
|
|
28
|
+
agentId?: string;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
export declare class Knowledge {
|
|
@@ -51,18 +51,19 @@ export class Knowledge {
|
|
|
51
51
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
52
52
|
"X-Fern-Language": "JavaScript",
|
|
53
53
|
"X-Fern-SDK-Name": "mavenagi",
|
|
54
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
54
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
55
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
57
|
},
|
|
58
58
|
contentType: "application/json",
|
|
59
|
-
|
|
59
|
+
requestType: "json",
|
|
60
|
+
body: serializers.KnowledgeBaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
60
61
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
61
62
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
62
63
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
64
|
});
|
|
64
65
|
if (_response.ok) {
|
|
65
|
-
return
|
|
66
|
+
return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
|
|
66
67
|
unrecognizedObjectKeys: "passthrough",
|
|
67
68
|
allowUnrecognizedUnionMembers: true,
|
|
68
69
|
allowUnrecognizedEnumValues: true,
|
|
@@ -72,21 +73,21 @@ export class Knowledge {
|
|
|
72
73
|
if (_response.error.reason === "status-code") {
|
|
73
74
|
switch (_response.error.statusCode) {
|
|
74
75
|
case 404:
|
|
75
|
-
throw new MavenAGI.NotFoundError(
|
|
76
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
76
77
|
unrecognizedObjectKeys: "passthrough",
|
|
77
78
|
allowUnrecognizedUnionMembers: true,
|
|
78
79
|
allowUnrecognizedEnumValues: true,
|
|
79
80
|
breadcrumbsPrefix: ["response"],
|
|
80
81
|
}));
|
|
81
82
|
case 400:
|
|
82
|
-
throw new MavenAGI.BadRequestError(
|
|
83
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
83
84
|
unrecognizedObjectKeys: "passthrough",
|
|
84
85
|
allowUnrecognizedUnionMembers: true,
|
|
85
86
|
allowUnrecognizedEnumValues: true,
|
|
86
87
|
breadcrumbsPrefix: ["response"],
|
|
87
88
|
}));
|
|
88
89
|
case 500:
|
|
89
|
-
throw new MavenAGI.ServerError(
|
|
90
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
90
91
|
unrecognizedObjectKeys: "passthrough",
|
|
91
92
|
allowUnrecognizedUnionMembers: true,
|
|
92
93
|
allowUnrecognizedEnumValues: true,
|
|
@@ -139,17 +140,18 @@ export class Knowledge {
|
|
|
139
140
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
140
141
|
"X-Fern-Language": "JavaScript",
|
|
141
142
|
"X-Fern-SDK-Name": "mavenagi",
|
|
142
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
143
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
143
144
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
144
145
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
145
146
|
},
|
|
146
147
|
contentType: "application/json",
|
|
148
|
+
requestType: "json",
|
|
147
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
148
150
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
149
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
150
152
|
});
|
|
151
153
|
if (_response.ok) {
|
|
152
|
-
return
|
|
154
|
+
return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
|
|
153
155
|
unrecognizedObjectKeys: "passthrough",
|
|
154
156
|
allowUnrecognizedUnionMembers: true,
|
|
155
157
|
allowUnrecognizedEnumValues: true,
|
|
@@ -159,21 +161,21 @@ export class Knowledge {
|
|
|
159
161
|
if (_response.error.reason === "status-code") {
|
|
160
162
|
switch (_response.error.statusCode) {
|
|
161
163
|
case 404:
|
|
162
|
-
throw new MavenAGI.NotFoundError(
|
|
164
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
163
165
|
unrecognizedObjectKeys: "passthrough",
|
|
164
166
|
allowUnrecognizedUnionMembers: true,
|
|
165
167
|
allowUnrecognizedEnumValues: true,
|
|
166
168
|
breadcrumbsPrefix: ["response"],
|
|
167
169
|
}));
|
|
168
170
|
case 400:
|
|
169
|
-
throw new MavenAGI.BadRequestError(
|
|
171
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
170
172
|
unrecognizedObjectKeys: "passthrough",
|
|
171
173
|
allowUnrecognizedUnionMembers: true,
|
|
172
174
|
allowUnrecognizedEnumValues: true,
|
|
173
175
|
breadcrumbsPrefix: ["response"],
|
|
174
176
|
}));
|
|
175
177
|
case 500:
|
|
176
|
-
throw new MavenAGI.ServerError(
|
|
178
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
177
179
|
unrecognizedObjectKeys: "passthrough",
|
|
178
180
|
allowUnrecognizedUnionMembers: true,
|
|
179
181
|
allowUnrecognizedEnumValues: true,
|
|
@@ -229,18 +231,19 @@ export class Knowledge {
|
|
|
229
231
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
230
232
|
"X-Fern-Language": "JavaScript",
|
|
231
233
|
"X-Fern-SDK-Name": "mavenagi",
|
|
232
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
234
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
233
235
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
234
236
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
235
237
|
},
|
|
236
238
|
contentType: "application/json",
|
|
237
|
-
|
|
239
|
+
requestType: "json",
|
|
240
|
+
body: serializers.KnowledgeBaseVersion.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
238
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
239
242
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
240
243
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
241
244
|
});
|
|
242
245
|
if (_response.ok) {
|
|
243
|
-
return
|
|
246
|
+
return serializers.KnowledgeBaseVersion.parseOrThrow(_response.body, {
|
|
244
247
|
unrecognizedObjectKeys: "passthrough",
|
|
245
248
|
allowUnrecognizedUnionMembers: true,
|
|
246
249
|
allowUnrecognizedEnumValues: true,
|
|
@@ -250,21 +253,21 @@ export class Knowledge {
|
|
|
250
253
|
if (_response.error.reason === "status-code") {
|
|
251
254
|
switch (_response.error.statusCode) {
|
|
252
255
|
case 404:
|
|
253
|
-
throw new MavenAGI.NotFoundError(
|
|
256
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
254
257
|
unrecognizedObjectKeys: "passthrough",
|
|
255
258
|
allowUnrecognizedUnionMembers: true,
|
|
256
259
|
allowUnrecognizedEnumValues: true,
|
|
257
260
|
breadcrumbsPrefix: ["response"],
|
|
258
261
|
}));
|
|
259
262
|
case 400:
|
|
260
|
-
throw new MavenAGI.BadRequestError(
|
|
263
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
261
264
|
unrecognizedObjectKeys: "passthrough",
|
|
262
265
|
allowUnrecognizedUnionMembers: true,
|
|
263
266
|
allowUnrecognizedEnumValues: true,
|
|
264
267
|
breadcrumbsPrefix: ["response"],
|
|
265
268
|
}));
|
|
266
269
|
case 500:
|
|
267
|
-
throw new MavenAGI.ServerError(
|
|
270
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
268
271
|
unrecognizedObjectKeys: "passthrough",
|
|
269
272
|
allowUnrecognizedUnionMembers: true,
|
|
270
273
|
allowUnrecognizedEnumValues: true,
|
|
@@ -317,11 +320,12 @@ export class Knowledge {
|
|
|
317
320
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
318
321
|
"X-Fern-Language": "JavaScript",
|
|
319
322
|
"X-Fern-SDK-Name": "mavenagi",
|
|
320
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
323
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
321
324
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
322
325
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
323
326
|
},
|
|
324
327
|
contentType: "application/json",
|
|
328
|
+
requestType: "json",
|
|
325
329
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
326
330
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
327
331
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -332,21 +336,21 @@ export class Knowledge {
|
|
|
332
336
|
if (_response.error.reason === "status-code") {
|
|
333
337
|
switch (_response.error.statusCode) {
|
|
334
338
|
case 404:
|
|
335
|
-
throw new MavenAGI.NotFoundError(
|
|
339
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
336
340
|
unrecognizedObjectKeys: "passthrough",
|
|
337
341
|
allowUnrecognizedUnionMembers: true,
|
|
338
342
|
allowUnrecognizedEnumValues: true,
|
|
339
343
|
breadcrumbsPrefix: ["response"],
|
|
340
344
|
}));
|
|
341
345
|
case 400:
|
|
342
|
-
throw new MavenAGI.BadRequestError(
|
|
346
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
343
347
|
unrecognizedObjectKeys: "passthrough",
|
|
344
348
|
allowUnrecognizedUnionMembers: true,
|
|
345
349
|
allowUnrecognizedEnumValues: true,
|
|
346
350
|
breadcrumbsPrefix: ["response"],
|
|
347
351
|
}));
|
|
348
352
|
case 500:
|
|
349
|
-
throw new MavenAGI.ServerError(
|
|
353
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
350
354
|
unrecognizedObjectKeys: "passthrough",
|
|
351
355
|
allowUnrecognizedUnionMembers: true,
|
|
352
356
|
allowUnrecognizedEnumValues: true,
|
|
@@ -407,18 +411,19 @@ export class Knowledge {
|
|
|
407
411
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
408
412
|
"X-Fern-Language": "JavaScript",
|
|
409
413
|
"X-Fern-SDK-Name": "mavenagi",
|
|
410
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
414
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
411
415
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
412
416
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
413
417
|
},
|
|
414
418
|
contentType: "application/json",
|
|
415
|
-
|
|
419
|
+
requestType: "json",
|
|
420
|
+
body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
416
421
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
417
422
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
418
423
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
419
424
|
});
|
|
420
425
|
if (_response.ok) {
|
|
421
|
-
return
|
|
426
|
+
return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
422
427
|
unrecognizedObjectKeys: "passthrough",
|
|
423
428
|
allowUnrecognizedUnionMembers: true,
|
|
424
429
|
allowUnrecognizedEnumValues: true,
|
|
@@ -428,21 +433,21 @@ export class Knowledge {
|
|
|
428
433
|
if (_response.error.reason === "status-code") {
|
|
429
434
|
switch (_response.error.statusCode) {
|
|
430
435
|
case 404:
|
|
431
|
-
throw new MavenAGI.NotFoundError(
|
|
436
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
432
437
|
unrecognizedObjectKeys: "passthrough",
|
|
433
438
|
allowUnrecognizedUnionMembers: true,
|
|
434
439
|
allowUnrecognizedEnumValues: true,
|
|
435
440
|
breadcrumbsPrefix: ["response"],
|
|
436
441
|
}));
|
|
437
442
|
case 400:
|
|
438
|
-
throw new MavenAGI.BadRequestError(
|
|
443
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
439
444
|
unrecognizedObjectKeys: "passthrough",
|
|
440
445
|
allowUnrecognizedUnionMembers: true,
|
|
441
446
|
allowUnrecognizedEnumValues: true,
|
|
442
447
|
breadcrumbsPrefix: ["response"],
|
|
443
448
|
}));
|
|
444
449
|
case 500:
|
|
445
|
-
throw new MavenAGI.ServerError(
|
|
450
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
446
451
|
unrecognizedObjectKeys: "passthrough",
|
|
447
452
|
allowUnrecognizedUnionMembers: true,
|
|
448
453
|
allowUnrecognizedEnumValues: true,
|
|
@@ -503,18 +508,19 @@ export class Knowledge {
|
|
|
503
508
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
504
509
|
"X-Fern-Language": "JavaScript",
|
|
505
510
|
"X-Fern-SDK-Name": "mavenagi",
|
|
506
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
511
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
507
512
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
508
513
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
509
514
|
},
|
|
510
515
|
contentType: "application/json",
|
|
511
|
-
|
|
516
|
+
requestType: "json",
|
|
517
|
+
body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
512
518
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
513
519
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
514
520
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
515
521
|
});
|
|
516
522
|
if (_response.ok) {
|
|
517
|
-
return
|
|
523
|
+
return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
518
524
|
unrecognizedObjectKeys: "passthrough",
|
|
519
525
|
allowUnrecognizedUnionMembers: true,
|
|
520
526
|
allowUnrecognizedEnumValues: true,
|
|
@@ -524,21 +530,21 @@ export class Knowledge {
|
|
|
524
530
|
if (_response.error.reason === "status-code") {
|
|
525
531
|
switch (_response.error.statusCode) {
|
|
526
532
|
case 404:
|
|
527
|
-
throw new MavenAGI.NotFoundError(
|
|
533
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
528
534
|
unrecognizedObjectKeys: "passthrough",
|
|
529
535
|
allowUnrecognizedUnionMembers: true,
|
|
530
536
|
allowUnrecognizedEnumValues: true,
|
|
531
537
|
breadcrumbsPrefix: ["response"],
|
|
532
538
|
}));
|
|
533
539
|
case 400:
|
|
534
|
-
throw new MavenAGI.BadRequestError(
|
|
540
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
535
541
|
unrecognizedObjectKeys: "passthrough",
|
|
536
542
|
allowUnrecognizedUnionMembers: true,
|
|
537
543
|
allowUnrecognizedEnumValues: true,
|
|
538
544
|
breadcrumbsPrefix: ["response"],
|
|
539
545
|
}));
|
|
540
546
|
case 500:
|
|
541
|
-
throw new MavenAGI.ServerError(
|
|
547
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
542
548
|
unrecognizedObjectKeys: "passthrough",
|
|
543
549
|
allowUnrecognizedUnionMembers: true,
|
|
544
550
|
allowUnrecognizedEnumValues: true,
|
|
@@ -592,11 +598,12 @@ export class Knowledge {
|
|
|
592
598
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
593
599
|
"X-Fern-Language": "JavaScript",
|
|
594
600
|
"X-Fern-SDK-Name": "mavenagi",
|
|
595
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
601
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
596
602
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
597
603
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
598
604
|
},
|
|
599
605
|
contentType: "application/json",
|
|
606
|
+
requestType: "json",
|
|
600
607
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
601
608
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
602
609
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -607,21 +614,21 @@ export class Knowledge {
|
|
|
607
614
|
if (_response.error.reason === "status-code") {
|
|
608
615
|
switch (_response.error.statusCode) {
|
|
609
616
|
case 404:
|
|
610
|
-
throw new MavenAGI.NotFoundError(
|
|
617
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
611
618
|
unrecognizedObjectKeys: "passthrough",
|
|
612
619
|
allowUnrecognizedUnionMembers: true,
|
|
613
620
|
allowUnrecognizedEnumValues: true,
|
|
614
621
|
breadcrumbsPrefix: ["response"],
|
|
615
622
|
}));
|
|
616
623
|
case 400:
|
|
617
|
-
throw new MavenAGI.BadRequestError(
|
|
624
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
618
625
|
unrecognizedObjectKeys: "passthrough",
|
|
619
626
|
allowUnrecognizedUnionMembers: true,
|
|
620
627
|
allowUnrecognizedEnumValues: true,
|
|
621
628
|
breadcrumbsPrefix: ["response"],
|
|
622
629
|
}));
|
|
623
630
|
case 500:
|
|
624
|
-
throw new MavenAGI.ServerError(
|
|
631
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
625
632
|
unrecognizedObjectKeys: "passthrough",
|
|
626
633
|
allowUnrecognizedUnionMembers: true,
|
|
627
634
|
allowUnrecognizedEnumValues: true,
|
|
@@ -9,14 +9,23 @@ export declare namespace Triggers {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Organization-Id header */
|
|
12
13
|
organizationId: core.Supplier<string>;
|
|
14
|
+
/** Override the X-Agent-Id header */
|
|
13
15
|
agentId: core.Supplier<string>;
|
|
14
16
|
fetcher?: core.FetchFunction;
|
|
15
17
|
}
|
|
16
18
|
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
20
|
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
22
|
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
19
24
|
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-Organization-Id header */
|
|
26
|
+
organizationId?: string;
|
|
27
|
+
/** Override the X-Agent-Id header */
|
|
28
|
+
agentId?: string;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
export declare class Triggers {
|
|
@@ -51,18 +51,19 @@ export class Triggers {
|
|
|
51
51
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
52
52
|
"X-Fern-Language": "JavaScript",
|
|
53
53
|
"X-Fern-SDK-Name": "mavenagi",
|
|
54
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
54
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
55
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
57
|
},
|
|
58
58
|
contentType: "application/json",
|
|
59
|
-
|
|
59
|
+
requestType: "json",
|
|
60
|
+
body: serializers.EventTriggerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
60
61
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
61
62
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
62
63
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
64
|
});
|
|
64
65
|
if (_response.ok) {
|
|
65
|
-
return
|
|
66
|
+
return serializers.EventTriggerResponse.parseOrThrow(_response.body, {
|
|
66
67
|
unrecognizedObjectKeys: "passthrough",
|
|
67
68
|
allowUnrecognizedUnionMembers: true,
|
|
68
69
|
allowUnrecognizedEnumValues: true,
|
|
@@ -72,21 +73,21 @@ export class Triggers {
|
|
|
72
73
|
if (_response.error.reason === "status-code") {
|
|
73
74
|
switch (_response.error.statusCode) {
|
|
74
75
|
case 404:
|
|
75
|
-
throw new MavenAGI.NotFoundError(
|
|
76
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
76
77
|
unrecognizedObjectKeys: "passthrough",
|
|
77
78
|
allowUnrecognizedUnionMembers: true,
|
|
78
79
|
allowUnrecognizedEnumValues: true,
|
|
79
80
|
breadcrumbsPrefix: ["response"],
|
|
80
81
|
}));
|
|
81
82
|
case 400:
|
|
82
|
-
throw new MavenAGI.BadRequestError(
|
|
83
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
83
84
|
unrecognizedObjectKeys: "passthrough",
|
|
84
85
|
allowUnrecognizedUnionMembers: true,
|
|
85
86
|
allowUnrecognizedEnumValues: true,
|
|
86
87
|
breadcrumbsPrefix: ["response"],
|
|
87
88
|
}));
|
|
88
89
|
case 500:
|
|
89
|
-
throw new MavenAGI.ServerError(
|
|
90
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
90
91
|
unrecognizedObjectKeys: "passthrough",
|
|
91
92
|
allowUnrecognizedUnionMembers: true,
|
|
92
93
|
allowUnrecognizedEnumValues: true,
|
|
@@ -139,17 +140,18 @@ export class Triggers {
|
|
|
139
140
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
140
141
|
"X-Fern-Language": "JavaScript",
|
|
141
142
|
"X-Fern-SDK-Name": "mavenagi",
|
|
142
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
143
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
143
144
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
144
145
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
145
146
|
},
|
|
146
147
|
contentType: "application/json",
|
|
148
|
+
requestType: "json",
|
|
147
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
148
150
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
149
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
150
152
|
});
|
|
151
153
|
if (_response.ok) {
|
|
152
|
-
return
|
|
154
|
+
return serializers.EventTriggerResponse.parseOrThrow(_response.body, {
|
|
153
155
|
unrecognizedObjectKeys: "passthrough",
|
|
154
156
|
allowUnrecognizedUnionMembers: true,
|
|
155
157
|
allowUnrecognizedEnumValues: true,
|
|
@@ -159,21 +161,21 @@ export class Triggers {
|
|
|
159
161
|
if (_response.error.reason === "status-code") {
|
|
160
162
|
switch (_response.error.statusCode) {
|
|
161
163
|
case 404:
|
|
162
|
-
throw new MavenAGI.NotFoundError(
|
|
164
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
163
165
|
unrecognizedObjectKeys: "passthrough",
|
|
164
166
|
allowUnrecognizedUnionMembers: true,
|
|
165
167
|
allowUnrecognizedEnumValues: true,
|
|
166
168
|
breadcrumbsPrefix: ["response"],
|
|
167
169
|
}));
|
|
168
170
|
case 400:
|
|
169
|
-
throw new MavenAGI.BadRequestError(
|
|
171
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
170
172
|
unrecognizedObjectKeys: "passthrough",
|
|
171
173
|
allowUnrecognizedUnionMembers: true,
|
|
172
174
|
allowUnrecognizedEnumValues: true,
|
|
173
175
|
breadcrumbsPrefix: ["response"],
|
|
174
176
|
}));
|
|
175
177
|
case 500:
|
|
176
|
-
throw new MavenAGI.ServerError(
|
|
178
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
177
179
|
unrecognizedObjectKeys: "passthrough",
|
|
178
180
|
allowUnrecognizedUnionMembers: true,
|
|
179
181
|
allowUnrecognizedEnumValues: true,
|
|
@@ -226,11 +228,12 @@ export class Triggers {
|
|
|
226
228
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
227
229
|
"X-Fern-Language": "JavaScript",
|
|
228
230
|
"X-Fern-SDK-Name": "mavenagi",
|
|
229
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
231
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
230
232
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
231
233
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
232
234
|
},
|
|
233
235
|
contentType: "application/json",
|
|
236
|
+
requestType: "json",
|
|
234
237
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
235
238
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
236
239
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -241,21 +244,21 @@ export class Triggers {
|
|
|
241
244
|
if (_response.error.reason === "status-code") {
|
|
242
245
|
switch (_response.error.statusCode) {
|
|
243
246
|
case 404:
|
|
244
|
-
throw new MavenAGI.NotFoundError(
|
|
247
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
245
248
|
unrecognizedObjectKeys: "passthrough",
|
|
246
249
|
allowUnrecognizedUnionMembers: true,
|
|
247
250
|
allowUnrecognizedEnumValues: true,
|
|
248
251
|
breadcrumbsPrefix: ["response"],
|
|
249
252
|
}));
|
|
250
253
|
case 400:
|
|
251
|
-
throw new MavenAGI.BadRequestError(
|
|
254
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
252
255
|
unrecognizedObjectKeys: "passthrough",
|
|
253
256
|
allowUnrecognizedUnionMembers: true,
|
|
254
257
|
allowUnrecognizedEnumValues: true,
|
|
255
258
|
breadcrumbsPrefix: ["response"],
|
|
256
259
|
}));
|
|
257
260
|
case 500:
|
|
258
|
-
throw new MavenAGI.ServerError(
|
|
261
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
259
262
|
unrecognizedObjectKeys: "passthrough",
|
|
260
263
|
allowUnrecognizedUnionMembers: true,
|
|
261
264
|
allowUnrecognizedEnumValues: true,
|
|
@@ -9,21 +9,30 @@ export declare namespace Users {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Organization-Id header */
|
|
12
13
|
organizationId: core.Supplier<string>;
|
|
14
|
+
/** Override the X-Agent-Id header */
|
|
13
15
|
agentId: core.Supplier<string>;
|
|
14
16
|
fetcher?: core.FetchFunction;
|
|
15
17
|
}
|
|
16
18
|
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
20
|
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
22
|
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
19
24
|
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-Organization-Id header */
|
|
26
|
+
organizationId?: string;
|
|
27
|
+
/** Override the X-Agent-Id header */
|
|
28
|
+
agentId?: string;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
export declare class Users {
|
|
23
32
|
protected readonly _options: Users.Options;
|
|
24
33
|
constructor(_options: Users.Options);
|
|
25
34
|
/**
|
|
26
|
-
*
|
|
35
|
+
* Update a user or create it if it doesn't exist.
|
|
27
36
|
*
|
|
28
37
|
* @param {MavenAGI.AppUserRequest} request
|
|
29
38
|
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -33,23 +42,27 @@ export declare class Users {
|
|
|
33
42
|
* @throws {@link MavenAGI.ServerError}
|
|
34
43
|
*
|
|
35
44
|
* @example
|
|
36
|
-
* await client.users.
|
|
37
|
-
*
|
|
38
|
-
* referenceId: "
|
|
45
|
+
* await client.users.createOrUpdate({
|
|
46
|
+
* userId: {
|
|
47
|
+
* referenceId: "user-0"
|
|
39
48
|
* },
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
49
|
+
* identifiers: new Set([{
|
|
50
|
+
* value: "joe@myapp.com",
|
|
51
|
+
* type: MavenAGI.AppUserIdentifyingPropertyType.Email
|
|
52
|
+
* }]),
|
|
53
|
+
* data: {
|
|
54
|
+
* "name": {
|
|
55
|
+
* value: "Joe",
|
|
56
|
+
* visibility: MavenAGI.VisibilityType.Visible
|
|
57
|
+
* }
|
|
45
58
|
* }
|
|
46
59
|
* })
|
|
47
60
|
*/
|
|
48
|
-
|
|
61
|
+
createOrUpdate(request: MavenAGI.AppUserRequest, requestOptions?: Users.RequestOptions): Promise<MavenAGI.AppUserResponse>;
|
|
49
62
|
/**
|
|
50
|
-
* Get a user
|
|
63
|
+
* Get a user by its supplied ID
|
|
51
64
|
*
|
|
52
|
-
* @param {string} userId -
|
|
65
|
+
* @param {string} userId - The reference ID of the user to get. All other entity ID fields are inferred from the request.
|
|
53
66
|
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
67
|
*
|
|
55
68
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -57,8 +70,8 @@ export declare class Users {
|
|
|
57
70
|
* @throws {@link MavenAGI.ServerError}
|
|
58
71
|
*
|
|
59
72
|
* @example
|
|
60
|
-
* await client.users.
|
|
73
|
+
* await client.users.get("user-0")
|
|
61
74
|
*/
|
|
62
|
-
|
|
75
|
+
get(userId: string, requestOptions?: Users.RequestOptions): Promise<MavenAGI.AppUserResponse>;
|
|
63
76
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
64
77
|
}
|