mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.21
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 +21 -0
- package/Client.js +20 -0
- package/README.md +83 -16
- package/api/resources/actions/client/Client.d.ts +96 -0
- package/api/resources/actions/client/Client.js +319 -0
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +1 -0
- package/api/resources/actions/index.d.ts +2 -0
- package/api/resources/actions/index.js +2 -0
- package/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/api/resources/actions/types/Precondition.d.ts +31 -0
- package/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/api/resources/{knowledge/types/IdBody.d.ts → actions/types/PreconditionOperator.js} +3 -3
- package/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/api/resources/actions/types/index.d.ts +13 -0
- package/api/resources/actions/types/index.js +13 -0
- package/api/resources/appSettings/client/Client.d.ts +47 -0
- package/api/resources/appSettings/client/Client.js +125 -0
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/appSettings/client/index.js +1 -0
- package/api/resources/appSettings/index.d.ts +1 -0
- package/api/resources/appSettings/index.js +1 -0
- package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
- package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
- package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
- package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
- package/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/ServerError.d.ts} +1 -1
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -1
- package/api/resources/commons/errors/index.js +3 -1
- package/api/resources/commons/types/AppUser.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifier.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/AppUserRequest.d.ts +26 -0
- package/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityIdBase.js +4 -0
- package/api/resources/commons/types/EntityType.d.ts +16 -0
- package/api/resources/commons/types/EntityType.js +15 -0
- package/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/api/resources/commons/types/EventTriggerType.js +7 -0
- package/api/resources/commons/types/Feedback.d.ts +12 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/FeedbackBase.js +4 -0
- package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
- package/api/resources/commons/types/UserData.d.ts +10 -0
- package/api/resources/commons/types/UserData.js +4 -0
- package/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/api/resources/commons/types/VisibilityType.js +8 -0
- package/api/resources/commons/types/index.d.ts +16 -1
- package/api/resources/commons/types/index.js +16 -1
- package/api/resources/conversation/client/Client.d.ts +149 -44
- package/api/resources/conversation/client/Client.js +474 -132
- package/api/resources/conversation/index.d.ts +0 -1
- package/api/resources/conversation/index.js +0 -1
- package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +18 -0
- package/api/resources/conversation/types/Capability.js +8 -0
- package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/conversation/types/CategorizationResponse.d.ts} +2 -2
- package/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseConfig.js +4 -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/Sentiment.d.ts +14 -0
- package/api/resources/conversation/types/Sentiment.js +10 -0
- package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/api/resources/conversation/types/index.d.ts +9 -3
- package/api/resources/conversation/types/index.js +9 -3
- package/api/resources/index.d.ts +6 -2
- package/api/resources/index.js +6 -2
- package/api/resources/knowledge/client/Client.d.ts +86 -74
- package/api/resources/knowledge/client/Client.js +240 -175
- package/api/resources/knowledge/index.d.ts +0 -1
- package/api/resources/knowledge/index.js +0 -1
- package/{dist/api/resources/knowledge/types/KnowledgeDocument.d.ts → api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- 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 +22 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +7 -5
- package/api/resources/knowledge/types/index.js +7 -5
- package/api/resources/triggers/client/Client.d.ts +83 -0
- package/api/resources/triggers/client/Client.js +306 -0
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/triggers/client/index.js +1 -0
- package/api/resources/triggers/index.d.ts +2 -0
- package/api/resources/triggers/index.js +2 -0
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/api/resources/triggers/types/index.d.ts +1 -0
- package/api/resources/triggers/types/index.js +1 -0
- package/api/resources/users/client/Client.d.ts +77 -0
- package/api/resources/users/client/Client.js +230 -0
- package/api/resources/users/client/index.d.ts +1 -0
- package/api/resources/users/client/index.js +1 -0
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -0
- 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 +243 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +8 -4
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +46 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +1 -0
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- 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/getErrorMessageForIncorrectType.js +4 -0
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +21 -0
- package/dist/Client.js +20 -0
- package/dist/api/resources/actions/client/Client.d.ts +96 -0
- package/dist/api/resources/actions/client/Client.js +319 -0
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +1 -0
- package/dist/api/resources/actions/index.d.ts +2 -0
- package/dist/api/resources/actions/index.js +2 -0
- package/dist/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/api/resources/actions/types/ActionBase.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/dist/api/resources/actions/types/ActionRequest.js +4 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.js +4 -0
- package/dist/api/resources/actions/types/Precondition.d.ts +31 -0
- package/dist/api/resources/actions/types/Precondition.js +4 -0
- package/dist/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionBase.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroup.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.js +6 -0
- package/dist/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/dist/api/resources/actions/types/TagsPrecondition.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +13 -0
- package/dist/api/resources/actions/types/index.js +13 -0
- package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
- package/dist/api/resources/appSettings/client/Client.js +125 -0
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/appSettings/client/index.js +1 -0
- package/dist/api/resources/appSettings/index.d.ts +1 -0
- package/dist/api/resources/appSettings/index.js +1 -0
- package/dist/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/BadRequestError.d.ts} +1 -1
- package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -1
- package/dist/api/resources/commons/errors/index.js +3 -1
- package/dist/api/resources/commons/types/AppUser.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.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/AppUserRequest.d.ts +26 -0
- package/dist/api/resources/commons/types/AppUserRequest.js +4 -0
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/dist/api/resources/commons/types/AppUserResponse.js +4 -0
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +16 -0
- package/dist/api/resources/commons/types/EntityType.js +15 -0
- package/dist/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/commons/types/EventTriggerType.js +7 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +12 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/FeedbackBase.js +4 -0
- package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
- package/dist/api/resources/commons/types/UserData.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.js +4 -0
- package/dist/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/dist/api/resources/commons/types/VisibilityType.js +8 -0
- package/dist/api/resources/commons/types/index.d.ts +16 -1
- package/dist/api/resources/commons/types/index.js +16 -1
- package/dist/api/resources/conversation/client/Client.d.ts +149 -44
- package/dist/api/resources/conversation/client/Client.js +474 -132
- package/dist/api/resources/conversation/index.d.ts +0 -1
- package/dist/api/resources/conversation/index.js +0 -1
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/dist/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +18 -0
- package/dist/api/resources/conversation/types/Capability.js +8 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- 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/Sentiment.d.ts +14 -0
- package/dist/api/resources/conversation/types/Sentiment.js +10 -0
- package/dist/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/dist/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +9 -3
- package/dist/api/resources/conversation/types/index.js +9 -3
- package/dist/api/resources/index.d.ts +6 -2
- package/dist/api/resources/index.js +6 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +86 -74
- package/dist/api/resources/knowledge/client/Client.js +240 -175
- package/dist/api/resources/knowledge/index.d.ts +0 -1
- package/dist/api/resources/knowledge/index.js +0 -1
- package/{api/resources/knowledge/types/KnowledgeDocument.d.ts → dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- 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 +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +7 -5
- package/dist/api/resources/knowledge/types/index.js +7 -5
- package/dist/api/resources/triggers/client/Client.d.ts +83 -0
- package/dist/api/resources/triggers/client/Client.js +306 -0
- 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/index.d.ts +2 -0
- package/dist/api/resources/triggers/index.js +2 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +1 -0
- package/dist/api/resources/triggers/types/index.js +1 -0
- package/dist/api/resources/users/client/Client.d.ts +77 -0
- package/dist/api/resources/users/client/Client.js +230 -0
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/index.js +1 -0
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- 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 +243 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +8 -4
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +46 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +1 -0
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- 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/getErrorMessageForIncorrectType.js +4 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/actions/index.d.ts +1 -0
- package/dist/serialization/resources/actions/index.js +1 -0
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/serialization/resources/actions/types/ActionBase.js +14 -0
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/Precondition.js +19 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/index.d.ts +13 -0
- package/dist/serialization/resources/actions/types/index.js +13 -0
- package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/dist/serialization/resources/appSettings/client/get.js +5 -0
- package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/client/index.js +1 -0
- package/dist/serialization/resources/appSettings/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/index.js +1 -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/AppUserIdentifier.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.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/AppUserRequest.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/knowledge/types/IdBody.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/dist/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +16 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/dist/serialization/resources/commons/types/Feedback.js +13 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{serialization/resources/conversation → dist/serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/dist/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/dist/serialization/resources/commons/types/UserData.js +9 -0
- package/dist/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/dist/serialization/resources/commons/types/index.d.ts +16 -1
- package/dist/serialization/resources/commons/types/index.js +16 -1
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/dist/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/dist/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/BotMessage.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/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/dist/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- 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/Sentiment.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/dist/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +9 -3
- package/dist/serialization/resources/conversation/types/index.js +9 -3
- package/dist/serialization/resources/index.d.ts +5 -0
- package/dist/serialization/resources/index.js +5 -0
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{serialization/resources/knowledge/types/KnowledgeDocument.js → dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{serialization/resources/knowledge/types/KnowledgeBase.d.ts → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/dist/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- 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 +17 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/dist/serialization/resources/knowledge/types/index.js +7 -5
- package/dist/serialization/resources/triggers/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/index.js +1 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/types/index.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -2
- package/reference.md +1876 -0
- package/serialization/resources/actions/index.d.ts +1 -0
- package/serialization/resources/actions/index.js +1 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/serialization/resources/actions/types/ActionBase.js +14 -0
- package/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/serialization/resources/actions/types/Precondition.js +19 -0
- package/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/serialization/resources/actions/types/index.d.ts +13 -0
- package/serialization/resources/actions/types/index.js +13 -0
- package/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/serialization/resources/appSettings/client/get.js +5 -0
- package/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/serialization/resources/appSettings/client/index.js +1 -0
- package/serialization/resources/appSettings/index.d.ts +1 -0
- package/serialization/resources/appSettings/index.js +1 -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/AppUserIdentifier.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifier.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/AppUserRequest.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/knowledge/types/IdBody.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +16 -0
- package/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/serialization/resources/commons/types/Feedback.js +13 -0
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{dist/serialization/resources/conversation → serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/serialization/resources/commons/types/UserData.js +9 -0
- package/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/serialization/resources/commons/types/index.d.ts +16 -1
- package/serialization/resources/commons/types/index.js +16 -1
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/serialization/resources/conversation/types/BotMessage.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/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- 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/Sentiment.d.ts +10 -0
- package/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/serialization/resources/conversation/types/index.d.ts +9 -3
- package/serialization/resources/conversation/types/index.js +9 -3
- package/serialization/resources/index.d.ts +5 -0
- package/serialization/resources/index.js +5 -0
- package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{dist/serialization/resources/knowledge/types/KnowledgeDocument.js → serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts → serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- 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 +17 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/serialization/resources/knowledge/types/index.js +7 -5
- package/serialization/resources/triggers/index.d.ts +1 -0
- package/serialization/resources/triggers/index.js +1 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +1 -0
- package/serialization/resources/triggers/types/index.js +1 -0
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/api/resources/commons/types/User.d.ts +0 -9
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/api/resources/conversation/errors/index.d.ts +0 -7
- package/api/resources/conversation/errors/index.js +0 -7
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/api/resources/knowledge/errors/index.d.ts +0 -6
- package/api/resources/knowledge/errors/index.js +0 -6
- package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/api/resources/commons/types/User.d.ts +0 -9
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/dist/api/resources/conversation/errors/index.d.ts +0 -7
- package/dist/api/resources/conversation/errors/index.js +0 -7
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
- package/dist/api/resources/knowledge/errors/index.js +0 -6
- package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/serialization/resources/commons/types/User.js +0 -9
- 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/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- package/serialization/resources/commons/types/User.js +0 -9
- 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/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- /package/api/resources/{commons/types/User.js → actions/types/ActionBase.js} +0 -0
- /package/api/resources/{conversation/types/ConversationContext.js → actions/types/ActionParameter.js} +0 -0
- /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/ActionRequest.js} +0 -0
- /package/api/resources/{knowledge/types/IdBody.js → actions/types/ActionResponse.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBase.js → actions/types/ConversationExecutedActionPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBaseId.js → actions/types/ConversationPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocument.js → actions/types/MetadataPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocumentId.js → actions/types/Precondition.js} +0 -0
- /package/{dist/api/resources/commons/types/User.js → api/resources/actions/types/PreconditionBase.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/actions/types/PreconditionGroup.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/actions/types/TagsPrecondition.js} +0 -0
- /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/commons/types/AppUser.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBase.js → api/resources/commons/types/AppUserIdentifier.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBaseId.js → api/resources/commons/types/AppUserRequest.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/commons/types/AppUserResponse.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocumentId.js → api/resources/commons/types/EntityId.js} +0 -0
|
@@ -21,26 +21,49 @@ export class Conversation {
|
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Initialize a new conversation. Only required if the ask request wishes to supply conversation level data or when syncing to external systems.
|
|
25
25
|
*
|
|
26
26
|
* @param {MavenAGI.ConversationRequest} request
|
|
27
27
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
|
-
* @throws {@link MavenAGI.
|
|
30
|
-
* @throws {@link MavenAGI.
|
|
31
|
-
* @throws {@link MavenAGI.
|
|
32
|
-
* @throws {@link MavenAGI.EmptyConversationError}
|
|
33
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
29
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
+
* @throws {@link MavenAGI.ServerError}
|
|
34
32
|
*
|
|
35
33
|
* @example
|
|
36
|
-
* await
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
34
|
+
* await client.conversation.initialize({
|
|
35
|
+
* conversationId: {
|
|
36
|
+
* referenceId: "string"
|
|
37
|
+
* },
|
|
38
|
+
* messages: [{
|
|
39
|
+
* conversationMessageId: {
|
|
40
|
+
* referenceId: "string"
|
|
41
|
+
* },
|
|
42
|
+
* userId: {
|
|
43
|
+
* referenceId: "string"
|
|
44
|
+
* },
|
|
45
|
+
* text: "string",
|
|
46
|
+
* userMessageType: "USER",
|
|
47
|
+
* createdAt: "2024-01-15T09:30:00Z",
|
|
48
|
+
* updatedAt: "2024-01-15T09:30:00Z"
|
|
49
|
+
* }],
|
|
50
|
+
* responseConfig: {
|
|
51
|
+
* capabilities: ["MARKDOWN"],
|
|
52
|
+
* isCopilot: true,
|
|
53
|
+
* responseLength: "SHORT"
|
|
54
|
+
* },
|
|
55
|
+
* subject: "string",
|
|
56
|
+
* url: "string",
|
|
57
|
+
* createdAt: "2024-01-15T09:30:00Z",
|
|
58
|
+
* updatedAt: "2024-01-15T09:30:00Z",
|
|
59
|
+
* tags: new Set(["string"]),
|
|
60
|
+
* metadata: {
|
|
61
|
+
* "string": "string"
|
|
62
|
+
* }
|
|
40
63
|
* })
|
|
41
64
|
*/
|
|
42
65
|
initialize(request, requestOptions) {
|
|
43
|
-
var _a, _b
|
|
66
|
+
var _a, _b;
|
|
44
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
68
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
46
69
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations"),
|
|
@@ -51,18 +74,20 @@ export class Conversation {
|
|
|
51
74
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
52
75
|
"X-Fern-Language": "JavaScript",
|
|
53
76
|
"X-Fern-SDK-Name": "mavenagi",
|
|
54
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
77
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
78
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
55
79
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
80
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
81
|
},
|
|
58
82
|
contentType: "application/json",
|
|
59
|
-
|
|
83
|
+
requestType: "json",
|
|
84
|
+
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
60
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
61
86
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
62
87
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
88
|
});
|
|
64
89
|
if (_response.ok) {
|
|
65
|
-
return
|
|
90
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
66
91
|
unrecognizedObjectKeys: "passthrough",
|
|
67
92
|
allowUnrecognizedUnionMembers: true,
|
|
68
93
|
allowUnrecognizedEnumValues: true,
|
|
@@ -70,37 +95,23 @@ export class Conversation {
|
|
|
70
95
|
});
|
|
71
96
|
}
|
|
72
97
|
if (_response.error.reason === "status-code") {
|
|
73
|
-
switch (
|
|
74
|
-
case
|
|
75
|
-
throw new MavenAGI.
|
|
76
|
-
unrecognizedObjectKeys: "passthrough",
|
|
77
|
-
allowUnrecognizedUnionMembers: true,
|
|
78
|
-
allowUnrecognizedEnumValues: true,
|
|
79
|
-
breadcrumbsPrefix: ["response"],
|
|
80
|
-
}));
|
|
81
|
-
case "InvalidConversationIdError":
|
|
82
|
-
throw new MavenAGI.InvalidConversationIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
83
|
-
unrecognizedObjectKeys: "passthrough",
|
|
84
|
-
allowUnrecognizedUnionMembers: true,
|
|
85
|
-
allowUnrecognizedEnumValues: true,
|
|
86
|
-
breadcrumbsPrefix: ["response"],
|
|
87
|
-
}));
|
|
88
|
-
case "InvalidConversationMessageIdError":
|
|
89
|
-
throw new MavenAGI.InvalidConversationMessageIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
98
|
+
switch (_response.error.statusCode) {
|
|
99
|
+
case 404:
|
|
100
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
90
101
|
unrecognizedObjectKeys: "passthrough",
|
|
91
102
|
allowUnrecognizedUnionMembers: true,
|
|
92
103
|
allowUnrecognizedEnumValues: true,
|
|
93
104
|
breadcrumbsPrefix: ["response"],
|
|
94
105
|
}));
|
|
95
|
-
case
|
|
96
|
-
throw new MavenAGI.
|
|
106
|
+
case 400:
|
|
107
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
97
108
|
unrecognizedObjectKeys: "passthrough",
|
|
98
109
|
allowUnrecognizedUnionMembers: true,
|
|
99
110
|
allowUnrecognizedEnumValues: true,
|
|
100
111
|
breadcrumbsPrefix: ["response"],
|
|
101
112
|
}));
|
|
102
|
-
case
|
|
103
|
-
throw new MavenAGI.
|
|
113
|
+
case 500:
|
|
114
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
104
115
|
unrecognizedObjectKeys: "passthrough",
|
|
105
116
|
allowUnrecognizedUnionMembers: true,
|
|
106
117
|
allowUnrecognizedEnumValues: true,
|
|
@@ -131,17 +142,18 @@ export class Conversation {
|
|
|
131
142
|
/**
|
|
132
143
|
* Get a conversation
|
|
133
144
|
*
|
|
134
|
-
* @param {string} conversationId - The ID of
|
|
145
|
+
* @param {string} conversationId - The ID of the conversation to get
|
|
135
146
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
147
|
*
|
|
137
|
-
* @throws {@link MavenAGI.
|
|
138
|
-
* @throws {@link MavenAGI.
|
|
148
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
149
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
150
|
+
* @throws {@link MavenAGI.ServerError}
|
|
139
151
|
*
|
|
140
152
|
* @example
|
|
141
|
-
* await
|
|
153
|
+
* await client.conversation.get("string")
|
|
142
154
|
*/
|
|
143
155
|
get(conversationId, requestOptions) {
|
|
144
|
-
var _a, _b
|
|
156
|
+
var _a, _b;
|
|
145
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
158
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
147
159
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
@@ -152,17 +164,19 @@ export class Conversation {
|
|
|
152
164
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
153
165
|
"X-Fern-Language": "JavaScript",
|
|
154
166
|
"X-Fern-SDK-Name": "mavenagi",
|
|
155
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
167
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
168
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
156
169
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
157
170
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
158
171
|
},
|
|
159
172
|
contentType: "application/json",
|
|
173
|
+
requestType: "json",
|
|
160
174
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
161
175
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
162
176
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
177
|
});
|
|
164
178
|
if (_response.ok) {
|
|
165
|
-
return
|
|
179
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
166
180
|
unrecognizedObjectKeys: "passthrough",
|
|
167
181
|
allowUnrecognizedUnionMembers: true,
|
|
168
182
|
allowUnrecognizedEnumValues: true,
|
|
@@ -170,16 +184,23 @@ export class Conversation {
|
|
|
170
184
|
});
|
|
171
185
|
}
|
|
172
186
|
if (_response.error.reason === "status-code") {
|
|
173
|
-
switch (
|
|
174
|
-
case
|
|
175
|
-
throw new MavenAGI.
|
|
187
|
+
switch (_response.error.statusCode) {
|
|
188
|
+
case 404:
|
|
189
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
190
|
+
unrecognizedObjectKeys: "passthrough",
|
|
191
|
+
allowUnrecognizedUnionMembers: true,
|
|
192
|
+
allowUnrecognizedEnumValues: true,
|
|
193
|
+
breadcrumbsPrefix: ["response"],
|
|
194
|
+
}));
|
|
195
|
+
case 400:
|
|
196
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
176
197
|
unrecognizedObjectKeys: "passthrough",
|
|
177
198
|
allowUnrecognizedUnionMembers: true,
|
|
178
199
|
allowUnrecognizedEnumValues: true,
|
|
179
200
|
breadcrumbsPrefix: ["response"],
|
|
180
201
|
}));
|
|
181
|
-
case
|
|
182
|
-
throw new MavenAGI.
|
|
202
|
+
case 500:
|
|
203
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
183
204
|
unrecognizedObjectKeys: "passthrough",
|
|
184
205
|
allowUnrecognizedUnionMembers: true,
|
|
185
206
|
allowUnrecognizedEnumValues: true,
|
|
@@ -214,20 +235,26 @@ export class Conversation {
|
|
|
214
235
|
* @param {MavenAGI.ConversationMessageRequest[]} request
|
|
215
236
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
237
|
*
|
|
217
|
-
* @throws {@link MavenAGI.
|
|
218
|
-
* @throws {@link MavenAGI.
|
|
219
|
-
* @throws {@link MavenAGI.
|
|
238
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
239
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
240
|
+
* @throws {@link MavenAGI.ServerError}
|
|
220
241
|
*
|
|
221
242
|
* @example
|
|
222
|
-
* await
|
|
243
|
+
* await client.conversation.appendNewMessages("string", [{
|
|
244
|
+
* conversationMessageId: {
|
|
245
|
+
* referenceId: "string"
|
|
246
|
+
* },
|
|
247
|
+
* userId: {
|
|
248
|
+
* referenceId: "string"
|
|
249
|
+
* },
|
|
223
250
|
* text: "string",
|
|
224
|
-
* userMessageType:
|
|
225
|
-
*
|
|
226
|
-
*
|
|
251
|
+
* userMessageType: "USER",
|
|
252
|
+
* createdAt: "2024-01-15T09:30:00Z",
|
|
253
|
+
* updatedAt: "2024-01-15T09:30:00Z"
|
|
227
254
|
* }])
|
|
228
255
|
*/
|
|
229
256
|
appendNewMessages(conversationId, request, requestOptions) {
|
|
230
|
-
var _a, _b
|
|
257
|
+
var _a, _b;
|
|
231
258
|
return __awaiter(this, void 0, void 0, function* () {
|
|
232
259
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
233
260
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/messages`),
|
|
@@ -238,12 +265,14 @@ export class Conversation {
|
|
|
238
265
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
239
266
|
"X-Fern-Language": "JavaScript",
|
|
240
267
|
"X-Fern-SDK-Name": "mavenagi",
|
|
241
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
268
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
269
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
242
270
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
243
271
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
244
272
|
},
|
|
245
273
|
contentType: "application/json",
|
|
246
|
-
|
|
274
|
+
requestType: "json",
|
|
275
|
+
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
247
276
|
unrecognizedObjectKeys: "strip",
|
|
248
277
|
}),
|
|
249
278
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -251,7 +280,7 @@ export class Conversation {
|
|
|
251
280
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
281
|
});
|
|
253
282
|
if (_response.ok) {
|
|
254
|
-
return
|
|
283
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
255
284
|
unrecognizedObjectKeys: "passthrough",
|
|
256
285
|
allowUnrecognizedUnionMembers: true,
|
|
257
286
|
allowUnrecognizedEnumValues: true,
|
|
@@ -259,23 +288,23 @@ export class Conversation {
|
|
|
259
288
|
});
|
|
260
289
|
}
|
|
261
290
|
if (_response.error.reason === "status-code") {
|
|
262
|
-
switch (
|
|
263
|
-
case
|
|
264
|
-
throw new MavenAGI.
|
|
291
|
+
switch (_response.error.statusCode) {
|
|
292
|
+
case 404:
|
|
293
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
294
|
unrecognizedObjectKeys: "passthrough",
|
|
266
295
|
allowUnrecognizedUnionMembers: true,
|
|
267
296
|
allowUnrecognizedEnumValues: true,
|
|
268
297
|
breadcrumbsPrefix: ["response"],
|
|
269
298
|
}));
|
|
270
|
-
case
|
|
271
|
-
throw new MavenAGI.
|
|
299
|
+
case 400:
|
|
300
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
272
301
|
unrecognizedObjectKeys: "passthrough",
|
|
273
302
|
allowUnrecognizedUnionMembers: true,
|
|
274
303
|
allowUnrecognizedEnumValues: true,
|
|
275
304
|
breadcrumbsPrefix: ["response"],
|
|
276
305
|
}));
|
|
277
|
-
case
|
|
278
|
-
throw new MavenAGI.
|
|
306
|
+
case 500:
|
|
307
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
279
308
|
unrecognizedObjectKeys: "passthrough",
|
|
280
309
|
allowUnrecognizedUnionMembers: true,
|
|
281
310
|
allowUnrecognizedEnumValues: true,
|
|
@@ -304,24 +333,29 @@ export class Conversation {
|
|
|
304
333
|
});
|
|
305
334
|
}
|
|
306
335
|
/**
|
|
307
|
-
* Ask a question
|
|
336
|
+
* Ask a question
|
|
308
337
|
*
|
|
309
338
|
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
|
|
310
339
|
* @param {MavenAGI.AskRequest} request
|
|
311
340
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
312
341
|
*
|
|
313
|
-
* @throws {@link MavenAGI.
|
|
314
|
-
* @throws {@link MavenAGI.
|
|
342
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
343
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
344
|
+
* @throws {@link MavenAGI.ServerError}
|
|
315
345
|
*
|
|
316
346
|
* @example
|
|
317
|
-
* await
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
347
|
+
* await client.conversation.ask("string", {
|
|
348
|
+
* conversationMessageId: {
|
|
349
|
+
* referenceId: "message-1"
|
|
350
|
+
* },
|
|
351
|
+
* userId: {
|
|
352
|
+
* referenceId: "user-1"
|
|
353
|
+
* },
|
|
354
|
+
* text: "How do I reset my password?"
|
|
321
355
|
* })
|
|
322
356
|
*/
|
|
323
357
|
ask(conversationId, request, requestOptions) {
|
|
324
|
-
var _a, _b
|
|
358
|
+
var _a, _b;
|
|
325
359
|
return __awaiter(this, void 0, void 0, function* () {
|
|
326
360
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
327
361
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask`),
|
|
@@ -332,18 +366,20 @@ export class Conversation {
|
|
|
332
366
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
333
367
|
"X-Fern-Language": "JavaScript",
|
|
334
368
|
"X-Fern-SDK-Name": "mavenagi",
|
|
335
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
369
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
370
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
336
371
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
337
372
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
338
373
|
},
|
|
339
374
|
contentType: "application/json",
|
|
340
|
-
|
|
375
|
+
requestType: "json",
|
|
376
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
341
377
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
342
378
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
343
379
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
344
380
|
});
|
|
345
381
|
if (_response.ok) {
|
|
346
|
-
return
|
|
382
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
347
383
|
unrecognizedObjectKeys: "passthrough",
|
|
348
384
|
allowUnrecognizedUnionMembers: true,
|
|
349
385
|
allowUnrecognizedEnumValues: true,
|
|
@@ -351,16 +387,23 @@ export class Conversation {
|
|
|
351
387
|
});
|
|
352
388
|
}
|
|
353
389
|
if (_response.error.reason === "status-code") {
|
|
354
|
-
switch (
|
|
355
|
-
case
|
|
356
|
-
throw new MavenAGI.
|
|
390
|
+
switch (_response.error.statusCode) {
|
|
391
|
+
case 404:
|
|
392
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
393
|
+
unrecognizedObjectKeys: "passthrough",
|
|
394
|
+
allowUnrecognizedUnionMembers: true,
|
|
395
|
+
allowUnrecognizedEnumValues: true,
|
|
396
|
+
breadcrumbsPrefix: ["response"],
|
|
397
|
+
}));
|
|
398
|
+
case 400:
|
|
399
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
357
400
|
unrecognizedObjectKeys: "passthrough",
|
|
358
401
|
allowUnrecognizedUnionMembers: true,
|
|
359
402
|
allowUnrecognizedEnumValues: true,
|
|
360
403
|
breadcrumbsPrefix: ["response"],
|
|
361
404
|
}));
|
|
362
|
-
case
|
|
363
|
-
throw new MavenAGI.
|
|
405
|
+
case 500:
|
|
406
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
364
407
|
unrecognizedObjectKeys: "passthrough",
|
|
365
408
|
allowUnrecognizedUnionMembers: true,
|
|
366
409
|
allowUnrecognizedEnumValues: true,
|
|
@@ -389,10 +432,10 @@ export class Conversation {
|
|
|
389
432
|
});
|
|
390
433
|
}
|
|
391
434
|
/**
|
|
392
|
-
* Ask a question
|
|
435
|
+
* Ask a question with a streaming response. The response will be sent as a stream of events. The text portions of stream responses should be concatenated to form the full response text. Action and metadata events should overwrite past data and do not need concatenation.
|
|
393
436
|
*/
|
|
394
437
|
askStream(conversationId, request, requestOptions) {
|
|
395
|
-
var _a, _b
|
|
438
|
+
var _a, _b;
|
|
396
439
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
440
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
398
441
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask_stream`),
|
|
@@ -403,13 +446,15 @@ export class Conversation {
|
|
|
403
446
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
404
447
|
"X-Fern-Language": "JavaScript",
|
|
405
448
|
"X-Fern-SDK-Name": "mavenagi",
|
|
406
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
449
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
450
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
407
451
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
408
452
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
409
453
|
},
|
|
410
454
|
contentType: "application/json",
|
|
411
|
-
|
|
412
|
-
|
|
455
|
+
requestType: "json",
|
|
456
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
457
|
+
responseType: "sse",
|
|
413
458
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
414
459
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
415
460
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -418,7 +463,7 @@ export class Conversation {
|
|
|
418
463
|
return new core.Stream({
|
|
419
464
|
stream: _response.body,
|
|
420
465
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
421
|
-
return
|
|
466
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
422
467
|
unrecognizedObjectKeys: "passthrough",
|
|
423
468
|
allowUnrecognizedUnionMembers: true,
|
|
424
469
|
allowUnrecognizedEnumValues: true,
|
|
@@ -433,9 +478,23 @@ export class Conversation {
|
|
|
433
478
|
});
|
|
434
479
|
}
|
|
435
480
|
if (_response.error.reason === "status-code") {
|
|
436
|
-
switch (
|
|
437
|
-
case
|
|
438
|
-
throw new MavenAGI.
|
|
481
|
+
switch (_response.error.statusCode) {
|
|
482
|
+
case 404:
|
|
483
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
484
|
+
unrecognizedObjectKeys: "passthrough",
|
|
485
|
+
allowUnrecognizedUnionMembers: true,
|
|
486
|
+
allowUnrecognizedEnumValues: true,
|
|
487
|
+
breadcrumbsPrefix: ["response"],
|
|
488
|
+
}));
|
|
489
|
+
case 400:
|
|
490
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
491
|
+
unrecognizedObjectKeys: "passthrough",
|
|
492
|
+
allowUnrecognizedUnionMembers: true,
|
|
493
|
+
allowUnrecognizedEnumValues: true,
|
|
494
|
+
breadcrumbsPrefix: ["response"],
|
|
495
|
+
}));
|
|
496
|
+
case 500:
|
|
497
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
439
498
|
unrecognizedObjectKeys: "passthrough",
|
|
440
499
|
allowUnrecognizedUnionMembers: true,
|
|
441
500
|
allowUnrecognizedEnumValues: true,
|
|
@@ -470,19 +529,19 @@ export class Conversation {
|
|
|
470
529
|
* @param {MavenAGI.GenerateMavenSuggestionsRequest} request
|
|
471
530
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
472
531
|
*
|
|
473
|
-
* @throws {@link MavenAGI.
|
|
474
|
-
* @throws {@link MavenAGI.
|
|
475
|
-
* @throws {@link MavenAGI.
|
|
476
|
-
* @throws {@link MavenAGI.InvalidConversationMessageIdError}
|
|
477
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
532
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
533
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
534
|
+
* @throws {@link MavenAGI.ServerError}
|
|
478
535
|
*
|
|
479
536
|
* @example
|
|
480
|
-
* await
|
|
481
|
-
*
|
|
537
|
+
* await client.conversation.generateMavenSuggestions("string", {
|
|
538
|
+
* conversationMessageIds: [{
|
|
539
|
+
* referenceId: "string"
|
|
540
|
+
* }]
|
|
482
541
|
* })
|
|
483
542
|
*/
|
|
484
543
|
generateMavenSuggestions(conversationId, request, requestOptions) {
|
|
485
|
-
var _a, _b
|
|
544
|
+
var _a, _b;
|
|
486
545
|
return __awaiter(this, void 0, void 0, function* () {
|
|
487
546
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
488
547
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/generate_maven_suggestions`),
|
|
@@ -493,20 +552,20 @@ export class Conversation {
|
|
|
493
552
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
494
553
|
"X-Fern-Language": "JavaScript",
|
|
495
554
|
"X-Fern-SDK-Name": "mavenagi",
|
|
496
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
555
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
556
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
497
557
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
498
558
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
499
559
|
},
|
|
500
560
|
contentType: "application/json",
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}),
|
|
561
|
+
requestType: "json",
|
|
562
|
+
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
504
563
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
505
564
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
506
565
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
507
566
|
});
|
|
508
567
|
if (_response.ok) {
|
|
509
|
-
return
|
|
568
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
510
569
|
unrecognizedObjectKeys: "passthrough",
|
|
511
570
|
allowUnrecognizedUnionMembers: true,
|
|
512
571
|
allowUnrecognizedEnumValues: true,
|
|
@@ -514,37 +573,112 @@ export class Conversation {
|
|
|
514
573
|
});
|
|
515
574
|
}
|
|
516
575
|
if (_response.error.reason === "status-code") {
|
|
517
|
-
switch (
|
|
518
|
-
case
|
|
519
|
-
throw new MavenAGI.
|
|
576
|
+
switch (_response.error.statusCode) {
|
|
577
|
+
case 404:
|
|
578
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
520
579
|
unrecognizedObjectKeys: "passthrough",
|
|
521
580
|
allowUnrecognizedUnionMembers: true,
|
|
522
581
|
allowUnrecognizedEnumValues: true,
|
|
523
582
|
breadcrumbsPrefix: ["response"],
|
|
524
583
|
}));
|
|
525
|
-
case
|
|
526
|
-
throw new MavenAGI.
|
|
584
|
+
case 400:
|
|
585
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
527
586
|
unrecognizedObjectKeys: "passthrough",
|
|
528
587
|
allowUnrecognizedUnionMembers: true,
|
|
529
588
|
allowUnrecognizedEnumValues: true,
|
|
530
589
|
breadcrumbsPrefix: ["response"],
|
|
531
590
|
}));
|
|
532
|
-
case
|
|
533
|
-
throw new MavenAGI.
|
|
591
|
+
case 500:
|
|
592
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
534
593
|
unrecognizedObjectKeys: "passthrough",
|
|
535
594
|
allowUnrecognizedUnionMembers: true,
|
|
536
595
|
allowUnrecognizedEnumValues: true,
|
|
537
596
|
breadcrumbsPrefix: ["response"],
|
|
538
597
|
}));
|
|
539
|
-
|
|
540
|
-
throw new
|
|
598
|
+
default:
|
|
599
|
+
throw new errors.MavenAGIError({
|
|
600
|
+
statusCode: _response.error.statusCode,
|
|
601
|
+
body: _response.error.body,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
switch (_response.error.reason) {
|
|
606
|
+
case "non-json":
|
|
607
|
+
throw new errors.MavenAGIError({
|
|
608
|
+
statusCode: _response.error.statusCode,
|
|
609
|
+
body: _response.error.rawBody,
|
|
610
|
+
});
|
|
611
|
+
case "timeout":
|
|
612
|
+
throw new errors.MavenAGITimeoutError();
|
|
613
|
+
case "unknown":
|
|
614
|
+
throw new errors.MavenAGIError({
|
|
615
|
+
message: _response.error.errorMessage,
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Uses an LLM flow to categorize the conversation. Experimental.
|
|
622
|
+
*
|
|
623
|
+
* @param {string} conversationId - The ID of the conversation to categorize
|
|
624
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
625
|
+
*
|
|
626
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
627
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
628
|
+
* @throws {@link MavenAGI.ServerError}
|
|
629
|
+
*
|
|
630
|
+
* @example
|
|
631
|
+
* await client.conversation.categorize("string")
|
|
632
|
+
*/
|
|
633
|
+
categorize(conversationId, requestOptions) {
|
|
634
|
+
var _a, _b;
|
|
635
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
636
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
637
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/categorize`),
|
|
638
|
+
method: "POST",
|
|
639
|
+
headers: {
|
|
640
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
641
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
642
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
643
|
+
"X-Fern-Language": "JavaScript",
|
|
644
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
645
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
646
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
647
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
648
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
649
|
+
},
|
|
650
|
+
contentType: "application/json",
|
|
651
|
+
requestType: "json",
|
|
652
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
653
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
654
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
655
|
+
});
|
|
656
|
+
if (_response.ok) {
|
|
657
|
+
return serializers.CategorizationResponse.parseOrThrow(_response.body, {
|
|
658
|
+
unrecognizedObjectKeys: "passthrough",
|
|
659
|
+
allowUnrecognizedUnionMembers: true,
|
|
660
|
+
allowUnrecognizedEnumValues: true,
|
|
661
|
+
breadcrumbsPrefix: ["response"],
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
if (_response.error.reason === "status-code") {
|
|
665
|
+
switch (_response.error.statusCode) {
|
|
666
|
+
case 404:
|
|
667
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
668
|
+
unrecognizedObjectKeys: "passthrough",
|
|
669
|
+
allowUnrecognizedUnionMembers: true,
|
|
670
|
+
allowUnrecognizedEnumValues: true,
|
|
671
|
+
breadcrumbsPrefix: ["response"],
|
|
672
|
+
}));
|
|
673
|
+
case 400:
|
|
674
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
541
675
|
unrecognizedObjectKeys: "passthrough",
|
|
542
676
|
allowUnrecognizedUnionMembers: true,
|
|
543
677
|
allowUnrecognizedEnumValues: true,
|
|
544
678
|
breadcrumbsPrefix: ["response"],
|
|
545
679
|
}));
|
|
546
|
-
case
|
|
547
|
-
throw new MavenAGI.
|
|
680
|
+
case 500:
|
|
681
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
548
682
|
unrecognizedObjectKeys: "passthrough",
|
|
549
683
|
allowUnrecognizedUnionMembers: true,
|
|
550
684
|
allowUnrecognizedEnumValues: true,
|
|
@@ -578,19 +712,27 @@ export class Conversation {
|
|
|
578
712
|
* @param {MavenAGI.FeedbackRequest} request
|
|
579
713
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
580
714
|
*
|
|
581
|
-
* @throws {@link MavenAGI.
|
|
582
|
-
* @throws {@link MavenAGI.
|
|
583
|
-
* @throws {@link MavenAGI.
|
|
715
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
716
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
717
|
+
* @throws {@link MavenAGI.ServerError}
|
|
584
718
|
*
|
|
585
719
|
* @example
|
|
586
|
-
* await
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
720
|
+
* await client.conversation.createFeedback({
|
|
721
|
+
* feedbackId: {
|
|
722
|
+
* referenceId: "string"
|
|
723
|
+
* },
|
|
724
|
+
* conversationId: {
|
|
725
|
+
* referenceId: "string"
|
|
726
|
+
* },
|
|
727
|
+
* conversationMessageId: {
|
|
728
|
+
* referenceId: "string"
|
|
729
|
+
* },
|
|
730
|
+
* type: "THUMBS_UP",
|
|
731
|
+
* text: "string"
|
|
590
732
|
* })
|
|
591
733
|
*/
|
|
592
734
|
createFeedback(request, requestOptions) {
|
|
593
|
-
var _a, _b
|
|
735
|
+
var _a, _b;
|
|
594
736
|
return __awaiter(this, void 0, void 0, function* () {
|
|
595
737
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
596
738
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations/feedback"),
|
|
@@ -601,37 +743,237 @@ export class Conversation {
|
|
|
601
743
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
602
744
|
"X-Fern-Language": "JavaScript",
|
|
603
745
|
"X-Fern-SDK-Name": "mavenagi",
|
|
604
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
746
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
747
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
748
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
749
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
750
|
+
},
|
|
751
|
+
contentType: "application/json",
|
|
752
|
+
requestType: "json",
|
|
753
|
+
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
754
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
755
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
756
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
757
|
+
});
|
|
758
|
+
if (_response.ok) {
|
|
759
|
+
return serializers.Feedback.parseOrThrow(_response.body, {
|
|
760
|
+
unrecognizedObjectKeys: "passthrough",
|
|
761
|
+
allowUnrecognizedUnionMembers: true,
|
|
762
|
+
allowUnrecognizedEnumValues: true,
|
|
763
|
+
breadcrumbsPrefix: ["response"],
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
if (_response.error.reason === "status-code") {
|
|
767
|
+
switch (_response.error.statusCode) {
|
|
768
|
+
case 404:
|
|
769
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
770
|
+
unrecognizedObjectKeys: "passthrough",
|
|
771
|
+
allowUnrecognizedUnionMembers: true,
|
|
772
|
+
allowUnrecognizedEnumValues: true,
|
|
773
|
+
breadcrumbsPrefix: ["response"],
|
|
774
|
+
}));
|
|
775
|
+
case 400:
|
|
776
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
777
|
+
unrecognizedObjectKeys: "passthrough",
|
|
778
|
+
allowUnrecognizedUnionMembers: true,
|
|
779
|
+
allowUnrecognizedEnumValues: true,
|
|
780
|
+
breadcrumbsPrefix: ["response"],
|
|
781
|
+
}));
|
|
782
|
+
case 500:
|
|
783
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
784
|
+
unrecognizedObjectKeys: "passthrough",
|
|
785
|
+
allowUnrecognizedUnionMembers: true,
|
|
786
|
+
allowUnrecognizedEnumValues: true,
|
|
787
|
+
breadcrumbsPrefix: ["response"],
|
|
788
|
+
}));
|
|
789
|
+
default:
|
|
790
|
+
throw new errors.MavenAGIError({
|
|
791
|
+
statusCode: _response.error.statusCode,
|
|
792
|
+
body: _response.error.body,
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
switch (_response.error.reason) {
|
|
797
|
+
case "non-json":
|
|
798
|
+
throw new errors.MavenAGIError({
|
|
799
|
+
statusCode: _response.error.statusCode,
|
|
800
|
+
body: _response.error.rawBody,
|
|
801
|
+
});
|
|
802
|
+
case "timeout":
|
|
803
|
+
throw new errors.MavenAGITimeoutError();
|
|
804
|
+
case "unknown":
|
|
805
|
+
throw new errors.MavenAGIError({
|
|
806
|
+
message: _response.error.errorMessage,
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Submit a filled out action form
|
|
813
|
+
*
|
|
814
|
+
* @param {string} conversationId - The ID of a conversation the form being submitted belongs to
|
|
815
|
+
* @param {MavenAGI.SubmitActionFormRequest} request
|
|
816
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
817
|
+
*
|
|
818
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
819
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
820
|
+
* @throws {@link MavenAGI.ServerError}
|
|
821
|
+
*
|
|
822
|
+
* @example
|
|
823
|
+
* await client.conversation.submitActionForm("string", {
|
|
824
|
+
* actionFormId: "string",
|
|
825
|
+
* parameters: {
|
|
826
|
+
* "string": {
|
|
827
|
+
* "key": "value"
|
|
828
|
+
* }
|
|
829
|
+
* }
|
|
830
|
+
* })
|
|
831
|
+
*/
|
|
832
|
+
submitActionForm(conversationId, request, requestOptions) {
|
|
833
|
+
var _a, _b;
|
|
834
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
835
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
836
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/submit-form`),
|
|
837
|
+
method: "POST",
|
|
838
|
+
headers: {
|
|
839
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
840
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
841
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
842
|
+
"X-Fern-Language": "JavaScript",
|
|
843
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
844
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
845
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
605
846
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
606
847
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
607
848
|
},
|
|
608
849
|
contentType: "application/json",
|
|
609
|
-
|
|
850
|
+
requestType: "json",
|
|
851
|
+
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
610
852
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
611
853
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
612
854
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
613
855
|
});
|
|
614
856
|
if (_response.ok) {
|
|
615
|
-
return
|
|
857
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
858
|
+
unrecognizedObjectKeys: "passthrough",
|
|
859
|
+
allowUnrecognizedUnionMembers: true,
|
|
860
|
+
allowUnrecognizedEnumValues: true,
|
|
861
|
+
breadcrumbsPrefix: ["response"],
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
if (_response.error.reason === "status-code") {
|
|
865
|
+
switch (_response.error.statusCode) {
|
|
866
|
+
case 404:
|
|
867
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
868
|
+
unrecognizedObjectKeys: "passthrough",
|
|
869
|
+
allowUnrecognizedUnionMembers: true,
|
|
870
|
+
allowUnrecognizedEnumValues: true,
|
|
871
|
+
breadcrumbsPrefix: ["response"],
|
|
872
|
+
}));
|
|
873
|
+
case 400:
|
|
874
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
875
|
+
unrecognizedObjectKeys: "passthrough",
|
|
876
|
+
allowUnrecognizedUnionMembers: true,
|
|
877
|
+
allowUnrecognizedEnumValues: true,
|
|
878
|
+
breadcrumbsPrefix: ["response"],
|
|
879
|
+
}));
|
|
880
|
+
case 500:
|
|
881
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
882
|
+
unrecognizedObjectKeys: "passthrough",
|
|
883
|
+
allowUnrecognizedUnionMembers: true,
|
|
884
|
+
allowUnrecognizedEnumValues: true,
|
|
885
|
+
breadcrumbsPrefix: ["response"],
|
|
886
|
+
}));
|
|
887
|
+
default:
|
|
888
|
+
throw new errors.MavenAGIError({
|
|
889
|
+
statusCode: _response.error.statusCode,
|
|
890
|
+
body: _response.error.body,
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
switch (_response.error.reason) {
|
|
895
|
+
case "non-json":
|
|
896
|
+
throw new errors.MavenAGIError({
|
|
897
|
+
statusCode: _response.error.statusCode,
|
|
898
|
+
body: _response.error.rawBody,
|
|
899
|
+
});
|
|
900
|
+
case "timeout":
|
|
901
|
+
throw new errors.MavenAGITimeoutError();
|
|
902
|
+
case "unknown":
|
|
903
|
+
throw new errors.MavenAGIError({
|
|
904
|
+
message: _response.error.errorMessage,
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
|
|
911
|
+
*
|
|
912
|
+
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
913
|
+
* @param {Record<string, string>} request
|
|
914
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
915
|
+
*
|
|
916
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
917
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
918
|
+
* @throws {@link MavenAGI.ServerError}
|
|
919
|
+
*
|
|
920
|
+
* @example
|
|
921
|
+
* await client.conversation.addConversationMetadata("string", {
|
|
922
|
+
* "string": "string"
|
|
923
|
+
* })
|
|
924
|
+
*/
|
|
925
|
+
addConversationMetadata(conversationId, request, requestOptions) {
|
|
926
|
+
var _a, _b;
|
|
927
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
928
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
929
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/metadata`),
|
|
930
|
+
method: "POST",
|
|
931
|
+
headers: {
|
|
932
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
933
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
934
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
935
|
+
"X-Fern-Language": "JavaScript",
|
|
936
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
937
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
938
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
939
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
940
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
941
|
+
},
|
|
942
|
+
contentType: "application/json",
|
|
943
|
+
requestType: "json",
|
|
944
|
+
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
945
|
+
unrecognizedObjectKeys: "strip",
|
|
946
|
+
}),
|
|
947
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
948
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
949
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
950
|
+
});
|
|
951
|
+
if (_response.ok) {
|
|
952
|
+
return serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
953
|
+
unrecognizedObjectKeys: "passthrough",
|
|
954
|
+
allowUnrecognizedUnionMembers: true,
|
|
955
|
+
allowUnrecognizedEnumValues: true,
|
|
956
|
+
breadcrumbsPrefix: ["response"],
|
|
957
|
+
});
|
|
616
958
|
}
|
|
617
959
|
if (_response.error.reason === "status-code") {
|
|
618
|
-
switch (
|
|
619
|
-
case
|
|
620
|
-
throw new MavenAGI.
|
|
960
|
+
switch (_response.error.statusCode) {
|
|
961
|
+
case 404:
|
|
962
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
621
963
|
unrecognizedObjectKeys: "passthrough",
|
|
622
964
|
allowUnrecognizedUnionMembers: true,
|
|
623
965
|
allowUnrecognizedEnumValues: true,
|
|
624
966
|
breadcrumbsPrefix: ["response"],
|
|
625
967
|
}));
|
|
626
|
-
case
|
|
627
|
-
throw new MavenAGI.
|
|
968
|
+
case 400:
|
|
969
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
628
970
|
unrecognizedObjectKeys: "passthrough",
|
|
629
971
|
allowUnrecognizedUnionMembers: true,
|
|
630
972
|
allowUnrecognizedEnumValues: true,
|
|
631
973
|
breadcrumbsPrefix: ["response"],
|
|
632
974
|
}));
|
|
633
|
-
case
|
|
634
|
-
throw new MavenAGI.
|
|
975
|
+
case 500:
|
|
976
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
635
977
|
unrecognizedObjectKeys: "passthrough",
|
|
636
978
|
allowUnrecognizedUnionMembers: true,
|
|
637
979
|
allowUnrecognizedEnumValues: true,
|