mavenagi 1.0.15 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -4
- package/Client.js +69 -20
- package/README.md +21 -8
- package/api/resources/actions/client/Client.d.ts +42 -4
- package/api/resources/actions/client/Client.js +264 -40
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +15 -0
- package/api/resources/actions/client/requests/ActionGetRequest.d.ts +13 -0
- package/api/resources/actions/client/requests/index.d.ts +1 -0
- package/api/resources/actions/types/ActionField.d.ts +11 -0
- package/api/resources/actions/types/ActionField.js +13 -0
- package/api/resources/actions/types/ActionFilter.d.ts +14 -0
- package/api/resources/actions/types/ActionPatchRequest.d.ts +12 -0
- package/api/resources/actions/types/ActionsResponse.d.ts +8 -0
- package/api/resources/actions/types/ActionsSearchRequest.d.ts +8 -0
- package/api/resources/actions/types/index.d.ts +5 -0
- package/api/resources/actions/types/index.js +5 -0
- package/api/resources/agents/client/Client.d.ts +75 -4
- package/api/resources/agents/client/Client.js +363 -42
- package/api/resources/agents/types/Agent.d.ts +10 -0
- package/api/resources/agents/types/AgentPatchRequest.d.ts +12 -0
- package/api/resources/agents/types/CreateAgentRequest.d.ts +10 -0
- package/api/resources/agents/types/PiiCategory.d.ts +63 -0
- package/api/resources/agents/types/PiiCategory.js +65 -0
- package/api/resources/agents/types/index.d.ts +3 -0
- package/api/resources/agents/types/index.js +3 -0
- package/api/resources/analytics/client/Client.d.ts +9 -4
- package/api/resources/analytics/client/Client.js +76 -40
- package/api/resources/analytics/types/ConversationTableResponse.d.ts +3 -3
- package/api/resources/appSettings/client/Client.d.ts +9 -4
- package/api/resources/appSettings/client/Client.js +76 -44
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/assets/client/Client.d.ts +76 -0
- package/api/resources/assets/client/Client.js +257 -0
- package/api/resources/assets/types/CommitAssetUploadRequest.d.ts +7 -0
- package/api/resources/assets/types/InitiateAssetUploadRequest.d.ts +6 -0
- package/api/resources/assets/types/InitiateAssetUploadResponse.d.ts +12 -0
- package/api/resources/assets/types/index.d.ts +3 -0
- package/api/resources/assets/types/index.js +19 -0
- package/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/api/resources/commons/errors/BadRequestError.js +2 -1
- package/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/api/resources/commons/errors/NotFoundError.js +2 -1
- package/api/resources/commons/errors/ServerError.d.ts +2 -1
- package/api/resources/commons/errors/ServerError.js +2 -1
- package/api/resources/commons/types/ActionResponse.d.ts +27 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +2 -2
- package/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- package/api/resources/commons/types/AttachmentRequest.d.ts +22 -0
- package/api/resources/commons/types/AttachmentResponse.d.ts +12 -0
- package/api/resources/commons/types/AttachmentStatus.d.ts +10 -0
- package/api/resources/commons/types/AttachmentStatus.js +12 -0
- package/api/resources/commons/types/BaseAttachment.d.ts +32 -0
- package/api/resources/commons/types/BaseConversationResponse.d.ts +11 -0
- package/api/resources/commons/types/BotLogic.d.ts +7 -0
- package/api/resources/commons/types/BotLogicActionExecutedDetail.d.ts +9 -0
- package/api/resources/commons/types/BotLogicActionItem.d.ts +8 -0
- package/api/resources/commons/types/BotLogicActionReviewedDetail.d.ts +8 -0
- package/api/resources/commons/types/BotLogicFormSubmissionItem.d.ts +6 -0
- package/api/resources/commons/types/BotLogicItem.d.ts +25 -0
- package/{dist/api/resources/commons/types/KnowledgeBaseInformation.d.ts → api/resources/commons/types/BotLogicKnowledgeDetail.d.ts} +4 -2
- package/api/resources/commons/types/BotLogicKnowledgeItem.d.ts +8 -0
- package/api/resources/{realtime/types/AudioPublishEvent.d.ts → commons/types/BotLogicSafetyItem.d.ts} +2 -2
- package/api/resources/commons/types/BotLogicSegmentsItem.d.ts +7 -0
- package/api/resources/{realtime/types/HangUpPublishEvent.d.ts → commons/types/BotLogicUserItem.d.ts} +2 -2
- package/api/resources/commons/types/BotMessage.d.ts +3 -1
- package/api/resources/commons/types/Capability.d.ts +2 -1
- package/api/resources/commons/types/Capability.js +1 -0
- package/api/resources/commons/types/ConversationResponse.d.ts +15 -2
- package/api/resources/commons/types/DocumentInformation.d.ts +2 -0
- package/api/resources/commons/types/EntityType.d.ts +2 -1
- package/api/resources/commons/types/EntityType.js +1 -0
- package/api/resources/commons/types/InboxItem.d.ts +1 -7
- package/api/resources/commons/types/InboxItemBase.d.ts +2 -0
- package/api/resources/commons/types/InboxItemDuplicateDocuments.d.ts +1 -1
- package/api/resources/commons/types/InboxItemFix.d.ts +1 -4
- package/api/resources/commons/types/InboxItemSeverity.d.ts +9 -0
- package/api/resources/commons/types/InboxItemSeverity.js +11 -0
- package/api/resources/commons/types/InboxItemType.d.ts +1 -9
- package/api/resources/commons/types/InboxItemType.js +0 -2
- package/api/resources/commons/types/LlmInclusionStatus.d.ts +9 -0
- package/api/resources/commons/types/LlmInclusionStatus.js +11 -0
- package/api/resources/commons/types/{BotMessageStatus.d.ts → MessageStatus.d.ts} +3 -3
- package/{dist/api/resources/commons/types/BotMessageStatus.js → api/resources/commons/types/MessageStatus.js} +2 -2
- package/api/resources/commons/types/ResponseConfig.d.ts +6 -8
- package/api/resources/commons/types/UserMessage.d.ts +21 -1
- package/api/resources/commons/types/UserMessageResponseState.d.ts +9 -0
- package/api/resources/commons/types/UserMessageResponseState.js +11 -0
- package/api/resources/commons/types/index.d.ts +19 -6
- package/api/resources/commons/types/index.js +19 -6
- package/api/resources/conversation/client/Client.d.ts +111 -51
- package/api/resources/conversation/client/Client.js +603 -222
- package/api/resources/conversation/client/index.d.ts +1 -0
- package/{dist/api/resources/conversation/types/GenerateObjectRequest.d.ts → api/resources/conversation/types/AskObjectRequest.d.ts} +1 -1
- package/api/resources/conversation/types/AskRequest.d.ts +5 -2
- package/api/resources/conversation/types/ConversationField.d.ts +5 -1
- package/api/resources/conversation/types/ConversationField.js +4 -0
- package/api/resources/conversation/types/ConversationFilter.d.ts +23 -1
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationPatchRequest.d.ts +20 -0
- package/api/resources/conversation/types/DeliverConversationMessageRequest.d.ts +10 -0
- package/api/resources/conversation/types/DeliverMessageRequest.d.ts +13 -0
- package/api/resources/conversation/types/DeliverMessageResponse.d.ts +7 -0
- package/api/resources/conversation/types/DeliverUserMessageRequest.d.ts +10 -0
- package/api/resources/conversation/types/DeliveryStatus.d.ts +9 -0
- package/api/resources/conversation/types/DeliveryStatus.js +11 -0
- package/api/resources/conversation/types/NumericConversationField.d.ts +2 -1
- package/api/resources/conversation/types/NumericConversationField.js +1 -0
- package/api/resources/conversation/types/ObjectStreamResponse.d.ts +16 -0
- package/api/resources/conversation/types/index.d.ts +8 -2
- package/api/resources/conversation/types/index.js +8 -2
- package/api/resources/events/client/Client.d.ts +5 -2
- package/api/resources/events/client/Client.js +26 -16
- package/api/resources/inbox/client/Client.d.ts +19 -11
- package/api/resources/inbox/client/Client.js +119 -68
- package/api/resources/inbox/client/index.d.ts +1 -0
- package/api/resources/inbox/types/AddDocumentFixRequest.d.ts +4 -1
- package/api/resources/inbox/types/ApplyFixesRequest.d.ts +12 -0
- package/api/resources/inbox/types/InboxFilter.d.ts +14 -0
- package/api/resources/inbox/types/InboxFilter.js +5 -0
- package/api/resources/inbox/types/InboxSearchRequest.d.ts +2 -9
- package/api/resources/inbox/types/InboxSearchResponse.d.ts +1 -1
- package/api/resources/inbox/types/index.d.ts +2 -2
- package/api/resources/inbox/types/index.js +2 -2
- package/api/resources/index.d.ts +9 -3
- package/api/resources/index.js +10 -4
- package/api/resources/knowledge/client/Client.d.ts +67 -8
- package/api/resources/knowledge/client/Client.js +459 -88
- package/api/resources/knowledge/client/index.d.ts +1 -0
- package/api/resources/knowledge/client/index.js +15 -0
- package/api/resources/knowledge/client/requests/KnowledgeBaseGetRequest.d.ts +13 -0
- package/api/resources/knowledge/client/requests/KnowledgeBaseGetRequest.js +5 -0
- package/api/resources/knowledge/client/requests/index.d.ts +1 -0
- package/api/resources/knowledge/client/requests/index.js +2 -0
- package/api/resources/knowledge/types/KnowledgeBaseField.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeBaseField.js +10 -0
- package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +26 -0
- package/api/resources/knowledge/types/KnowledgeBaseFilter.js +5 -0
- package/api/resources/knowledge/types/KnowledgeBasePatchRequest.d.ts +16 -0
- package/api/resources/knowledge/types/KnowledgeBasePatchRequest.js +5 -0
- package/api/resources/knowledge/types/KnowledgeBaseProperties.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseRefreshFrequency.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeBaseRefreshFrequency.js +12 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +15 -1
- package/api/resources/knowledge/types/KnowledgeBaseSearchRequest.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeBaseSearchRequest.js +5 -0
- package/api/resources/knowledge/types/KnowledgeBasesResponse.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeBasesResponse.js +5 -0
- package/api/resources/knowledge/types/KnowledgeDocumentField.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeDocumentField.js +12 -0
- package/api/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +26 -0
- package/api/resources/knowledge/types/KnowledgeDocumentFilter.js +5 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchRequest.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchRequest.js +5 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +5 -0
- package/api/resources/knowledge/types/KnowledgeDocumentsResponse.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeDocumentsResponse.js +5 -0
- package/api/resources/knowledge/types/index.d.ts +11 -0
- package/api/resources/knowledge/types/index.js +11 -0
- package/api/resources/organizations/client/Client.d.ts +7 -3
- package/api/resources/organizations/client/Client.js +51 -28
- package/api/resources/segments/client/Client.d.ts +120 -0
- package/api/resources/segments/client/Client.js +468 -0
- package/api/resources/segments/client/index.d.ts +2 -0
- package/{core/websocket → api/resources/segments/client}/index.js +1 -1
- package/api/resources/segments/client/requests/SegmentGetRequest.d.ts +13 -0
- package/api/resources/segments/client/requests/SegmentGetRequest.js +5 -0
- package/api/resources/segments/client/requests/index.d.ts +1 -0
- package/api/resources/segments/client/requests/index.js +2 -0
- package/api/resources/segments/types/SegmentBase.d.ts +10 -0
- package/api/resources/segments/types/SegmentBase.js +5 -0
- package/api/resources/segments/types/SegmentField.d.ts +8 -0
- package/api/resources/{realtime/types/AudioFormat.js → segments/types/SegmentField.js} +4 -4
- package/api/resources/segments/types/SegmentPatchRequest.d.ts +14 -0
- package/api/resources/segments/types/SegmentPatchRequest.js +5 -0
- package/api/resources/segments/types/SegmentRequest.d.ts +28 -0
- package/api/resources/segments/types/SegmentRequest.js +5 -0
- package/api/resources/segments/types/SegmentResponse.d.ts +39 -0
- package/api/resources/segments/types/SegmentResponse.js +5 -0
- package/api/resources/segments/types/SegmentStatus.d.ts +8 -0
- package/api/resources/segments/types/SegmentStatus.js +10 -0
- package/api/resources/segments/types/SegmentsSearchRequest.d.ts +8 -0
- package/api/resources/segments/types/SegmentsSearchRequest.js +5 -0
- package/api/resources/segments/types/SegmentsSearchResponse.d.ts +7 -0
- package/api/resources/segments/types/SegmentsSearchResponse.js +5 -0
- package/api/resources/segments/types/index.d.ts +8 -0
- package/api/resources/{realtime → segments}/types/index.js +8 -8
- package/api/resources/translations/client/Client.d.ts +5 -2
- package/api/resources/translations/client/Client.js +26 -16
- package/api/resources/triggers/client/Client.d.ts +13 -6
- package/api/resources/triggers/client/Client.js +118 -63
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/users/client/Client.d.ts +49 -10
- package/api/resources/users/client/Client.js +263 -47
- package/api/resources/users/client/index.d.ts +1 -0
- package/api/resources/users/client/requests/UserDeleteRequest.d.ts +1 -1
- package/api/resources/users/client/requests/UserGetRequest.d.ts +1 -1
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -0
- package/api/resources/users/types/AgentUser.d.ts +24 -0
- package/api/resources/users/types/AgentUser.js +5 -0
- package/api/resources/users/types/AgentUserField.d.ts +8 -0
- package/api/resources/users/types/AgentUserField.js +10 -0
- package/api/resources/users/types/AgentUserFilter.d.ts +12 -0
- package/api/resources/users/types/AgentUserFilter.js +5 -0
- package/api/resources/users/types/AgentUserSearchRequest.d.ts +8 -0
- package/api/resources/users/types/AgentUserSearchRequest.js +5 -0
- package/api/resources/users/types/AgentUserSearchResponse.d.ts +8 -0
- package/api/resources/users/types/AgentUserSearchResponse.js +5 -0
- package/api/resources/users/types/AppUserSummary.d.ts +12 -0
- package/api/resources/users/types/AppUserSummary.js +5 -0
- package/api/resources/users/types/index.d.ts +6 -0
- package/api/resources/users/types/index.js +22 -0
- package/core/auth/BasicAuth.js +3 -3
- package/core/base64.d.ts +2 -0
- package/core/base64.js +26 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/BinaryResponse.d.ts +20 -0
- package/core/fetcher/BinaryResponse.js +17 -0
- package/core/fetcher/Fetcher.d.ts +3 -2
- package/core/fetcher/Fetcher.js +32 -12
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/core/fetcher/ResponseWithBody.js +6 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +3 -7
- package/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/core/fetcher/getErrorResponseBody.js +44 -0
- package/core/fetcher/getFetchFn.d.ts +1 -4
- package/core/fetcher/getFetchFn.js +1 -52
- package/core/fetcher/getResponseBody.js +34 -33
- package/core/fetcher/index.d.ts +4 -0
- package/core/fetcher/index.js +7 -1
- package/core/headers.d.ts +3 -0
- package/core/headers.js +29 -0
- package/core/index.d.ts +3 -2
- package/core/index.js +4 -3
- package/core/runtime/runtime.js +0 -1
- package/core/{streaming-fetcher → stream}/Stream.d.ts +1 -2
- package/core/url/index.d.ts +2 -0
- package/core/url/index.js +7 -0
- package/core/url/join.d.ts +1 -0
- package/core/url/join.js +49 -0
- package/core/url/qs.d.ts +6 -0
- package/core/url/qs.js +64 -0
- package/dist/Client.d.ts +9 -4
- package/dist/Client.js +69 -20
- package/dist/api/resources/actions/client/Client.d.ts +42 -4
- package/dist/api/resources/actions/client/Client.js +264 -40
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +15 -0
- package/dist/api/resources/actions/client/requests/ActionGetRequest.d.ts +13 -0
- package/dist/api/resources/actions/client/requests/ActionGetRequest.js +5 -0
- package/dist/api/resources/actions/client/requests/index.d.ts +1 -0
- package/dist/api/resources/actions/client/requests/index.js +2 -0
- package/dist/api/resources/actions/types/ActionField.d.ts +11 -0
- package/dist/api/resources/actions/types/ActionField.js +13 -0
- package/dist/api/resources/actions/types/ActionFilter.d.ts +14 -0
- package/dist/api/resources/actions/types/ActionFilter.js +5 -0
- package/dist/api/resources/actions/types/ActionPatchRequest.d.ts +12 -0
- package/dist/api/resources/actions/types/ActionPatchRequest.js +5 -0
- package/dist/api/resources/actions/types/ActionsResponse.d.ts +8 -0
- package/dist/api/resources/actions/types/ActionsResponse.js +5 -0
- package/dist/api/resources/actions/types/ActionsSearchRequest.d.ts +8 -0
- package/dist/api/resources/actions/types/ActionsSearchRequest.js +5 -0
- package/dist/api/resources/actions/types/index.d.ts +5 -0
- package/dist/api/resources/actions/types/index.js +5 -0
- package/dist/api/resources/agents/client/Client.d.ts +75 -4
- package/dist/api/resources/agents/client/Client.js +363 -42
- package/dist/api/resources/agents/types/Agent.d.ts +10 -0
- package/dist/api/resources/agents/types/AgentPatchRequest.d.ts +12 -0
- package/dist/api/resources/agents/types/AgentPatchRequest.js +5 -0
- package/dist/api/resources/agents/types/CreateAgentRequest.d.ts +10 -0
- package/dist/api/resources/agents/types/CreateAgentRequest.js +5 -0
- package/dist/api/resources/agents/types/PiiCategory.d.ts +63 -0
- package/dist/api/resources/agents/types/PiiCategory.js +65 -0
- package/dist/api/resources/agents/types/index.d.ts +3 -0
- package/dist/api/resources/agents/types/index.js +3 -0
- package/dist/api/resources/analytics/client/Client.d.ts +9 -4
- package/dist/api/resources/analytics/client/Client.js +76 -40
- package/dist/api/resources/analytics/types/ConversationTableResponse.d.ts +3 -3
- package/dist/api/resources/appSettings/client/Client.d.ts +9 -4
- package/dist/api/resources/appSettings/client/Client.js +76 -44
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/assets/client/Client.d.ts +76 -0
- package/dist/api/resources/assets/client/Client.js +257 -0
- package/dist/api/resources/assets/client/index.js +2 -0
- package/dist/api/resources/assets/index.d.ts +2 -0
- package/dist/api/resources/assets/index.js +18 -0
- package/dist/api/resources/assets/types/CommitAssetUploadRequest.d.ts +7 -0
- package/dist/api/resources/assets/types/CommitAssetUploadRequest.js +5 -0
- package/dist/api/resources/assets/types/InitiateAssetUploadRequest.d.ts +6 -0
- package/dist/api/resources/assets/types/InitiateAssetUploadRequest.js +5 -0
- package/dist/api/resources/assets/types/InitiateAssetUploadResponse.d.ts +12 -0
- package/dist/api/resources/assets/types/InitiateAssetUploadResponse.js +5 -0
- package/dist/api/resources/assets/types/index.d.ts +3 -0
- package/dist/api/resources/assets/types/index.js +19 -0
- package/dist/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/commons/errors/BadRequestError.js +2 -1
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/dist/api/resources/commons/errors/NotFoundError.js +2 -1
- package/dist/api/resources/commons/errors/ServerError.d.ts +2 -1
- package/dist/api/resources/commons/errors/ServerError.js +2 -1
- package/dist/api/resources/commons/types/ActionResponse.d.ts +27 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +2 -2
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- package/dist/api/resources/commons/types/AttachmentRequest.d.ts +22 -0
- package/dist/api/resources/commons/types/AttachmentRequest.js +5 -0
- package/dist/api/resources/commons/types/AttachmentResponse.d.ts +12 -0
- package/dist/api/resources/commons/types/AttachmentResponse.js +5 -0
- package/dist/api/resources/commons/types/AttachmentStatus.d.ts +10 -0
- package/dist/api/resources/commons/types/AttachmentStatus.js +12 -0
- package/dist/api/resources/commons/types/BaseAttachment.d.ts +32 -0
- package/dist/api/resources/commons/types/BaseAttachment.js +5 -0
- package/dist/api/resources/commons/types/BaseConversationResponse.d.ts +11 -0
- package/dist/api/resources/commons/types/BotLogic.d.ts +7 -0
- package/dist/api/resources/commons/types/BotLogic.js +5 -0
- package/dist/api/resources/commons/types/BotLogicActionExecutedDetail.d.ts +9 -0
- package/dist/api/resources/commons/types/BotLogicActionExecutedDetail.js +5 -0
- package/dist/api/resources/commons/types/BotLogicActionItem.d.ts +8 -0
- package/dist/api/resources/commons/types/BotLogicActionItem.js +5 -0
- package/dist/api/resources/commons/types/BotLogicActionReviewedDetail.d.ts +8 -0
- package/dist/api/resources/commons/types/BotLogicActionReviewedDetail.js +5 -0
- package/dist/api/resources/commons/types/BotLogicFormSubmissionItem.d.ts +6 -0
- package/dist/api/resources/commons/types/BotLogicFormSubmissionItem.js +5 -0
- package/dist/api/resources/commons/types/BotLogicItem.d.ts +25 -0
- package/dist/api/resources/commons/types/BotLogicItem.js +5 -0
- package/{api/resources/commons/types/KnowledgeBaseInformation.d.ts → dist/api/resources/commons/types/BotLogicKnowledgeDetail.d.ts} +4 -2
- package/dist/api/resources/commons/types/BotLogicKnowledgeDetail.js +5 -0
- package/dist/api/resources/commons/types/BotLogicKnowledgeItem.d.ts +8 -0
- package/dist/api/resources/commons/types/BotLogicKnowledgeItem.js +5 -0
- package/{api/resources/realtime/types/AudioSubscribeEvent.d.ts → dist/api/resources/commons/types/BotLogicSafetyItem.d.ts} +2 -2
- package/dist/api/resources/commons/types/BotLogicSafetyItem.js +5 -0
- package/dist/api/resources/commons/types/BotLogicSegmentsItem.d.ts +7 -0
- package/dist/api/resources/commons/types/BotLogicSegmentsItem.js +5 -0
- package/{api/resources/realtime/types/MessageBase.d.ts → dist/api/resources/commons/types/BotLogicUserItem.d.ts} +2 -2
- package/dist/api/resources/commons/types/BotLogicUserItem.js +5 -0
- package/dist/api/resources/commons/types/BotMessage.d.ts +3 -1
- package/dist/api/resources/commons/types/Capability.d.ts +2 -1
- package/dist/api/resources/commons/types/Capability.js +1 -0
- package/dist/api/resources/commons/types/ConversationResponse.d.ts +15 -2
- package/dist/api/resources/commons/types/DocumentInformation.d.ts +2 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +2 -1
- package/dist/api/resources/commons/types/EntityType.js +1 -0
- package/dist/api/resources/commons/types/InboxItem.d.ts +1 -7
- package/dist/api/resources/commons/types/InboxItemBase.d.ts +2 -0
- package/dist/api/resources/commons/types/InboxItemDuplicateDocuments.d.ts +1 -1
- package/dist/api/resources/commons/types/InboxItemFix.d.ts +1 -4
- package/dist/api/resources/commons/types/InboxItemSeverity.d.ts +9 -0
- package/dist/api/resources/commons/types/InboxItemSeverity.js +11 -0
- package/dist/api/resources/commons/types/InboxItemType.d.ts +1 -9
- package/dist/api/resources/commons/types/InboxItemType.js +0 -2
- package/dist/api/resources/commons/types/LlmInclusionStatus.d.ts +9 -0
- package/dist/api/resources/commons/types/LlmInclusionStatus.js +11 -0
- package/dist/api/resources/commons/types/{BotMessageStatus.d.ts → MessageStatus.d.ts} +3 -3
- package/{api/resources/commons/types/BotMessageStatus.js → dist/api/resources/commons/types/MessageStatus.js} +2 -2
- package/dist/api/resources/commons/types/ResponseConfig.d.ts +6 -8
- package/dist/api/resources/commons/types/UserMessage.d.ts +21 -1
- package/dist/api/resources/commons/types/UserMessageResponseState.d.ts +9 -0
- package/dist/api/resources/commons/types/UserMessageResponseState.js +11 -0
- package/dist/api/resources/commons/types/index.d.ts +19 -6
- package/dist/api/resources/commons/types/index.js +19 -6
- package/dist/api/resources/conversation/client/Client.d.ts +111 -51
- package/dist/api/resources/conversation/client/Client.js +603 -222
- package/dist/api/resources/conversation/client/index.d.ts +1 -0
- package/{api/resources/conversation/types/GenerateObjectRequest.d.ts → dist/api/resources/conversation/types/AskObjectRequest.d.ts} +1 -1
- package/dist/api/resources/conversation/types/AskObjectRequest.js +5 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +5 -2
- package/dist/api/resources/conversation/types/ConversationField.d.ts +5 -1
- package/dist/api/resources/conversation/types/ConversationField.js +4 -0
- package/dist/api/resources/conversation/types/ConversationFilter.d.ts +23 -1
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationPatchRequest.d.ts +20 -0
- package/dist/api/resources/conversation/types/ConversationPatchRequest.js +5 -0
- package/dist/api/resources/conversation/types/DeliverConversationMessageRequest.d.ts +10 -0
- package/dist/api/resources/conversation/types/DeliverConversationMessageRequest.js +5 -0
- package/dist/api/resources/conversation/types/DeliverMessageRequest.d.ts +13 -0
- package/dist/api/resources/conversation/types/DeliverMessageRequest.js +5 -0
- package/dist/api/resources/conversation/types/DeliverMessageResponse.d.ts +7 -0
- package/dist/api/resources/conversation/types/DeliverMessageResponse.js +5 -0
- package/dist/api/resources/conversation/types/DeliverUserMessageRequest.d.ts +10 -0
- package/dist/api/resources/conversation/types/DeliverUserMessageRequest.js +5 -0
- package/dist/api/resources/conversation/types/DeliveryStatus.d.ts +9 -0
- package/dist/api/resources/conversation/types/DeliveryStatus.js +11 -0
- package/dist/api/resources/conversation/types/NumericConversationField.d.ts +2 -1
- package/dist/api/resources/conversation/types/NumericConversationField.js +1 -0
- package/dist/api/resources/conversation/types/ObjectStreamResponse.d.ts +16 -0
- package/dist/api/resources/conversation/types/ObjectStreamResponse.js +5 -0
- package/dist/api/resources/conversation/types/index.d.ts +8 -2
- package/dist/api/resources/conversation/types/index.js +8 -2
- package/dist/api/resources/events/client/Client.d.ts +5 -2
- package/dist/api/resources/events/client/Client.js +26 -16
- package/dist/api/resources/inbox/client/Client.d.ts +19 -11
- package/dist/api/resources/inbox/client/Client.js +119 -68
- package/dist/api/resources/inbox/client/index.d.ts +1 -0
- package/dist/api/resources/inbox/types/AddDocumentFixRequest.d.ts +4 -1
- package/dist/api/resources/inbox/types/ApplyFixesRequest.d.ts +12 -0
- package/dist/api/resources/inbox/types/ApplyFixesRequest.js +5 -0
- package/dist/api/resources/inbox/types/InboxFilter.d.ts +14 -0
- package/dist/api/resources/inbox/types/InboxFilter.js +5 -0
- package/dist/api/resources/inbox/types/InboxSearchRequest.d.ts +2 -9
- package/dist/api/resources/inbox/types/InboxSearchResponse.d.ts +1 -1
- package/dist/api/resources/inbox/types/index.d.ts +2 -2
- package/dist/api/resources/inbox/types/index.js +2 -2
- package/dist/api/resources/index.d.ts +9 -3
- package/dist/api/resources/index.js +10 -4
- package/dist/api/resources/knowledge/client/Client.d.ts +67 -8
- package/dist/api/resources/knowledge/client/Client.js +459 -88
- package/dist/api/resources/knowledge/client/index.d.ts +1 -0
- package/dist/api/resources/knowledge/client/index.js +15 -0
- package/dist/api/resources/knowledge/client/requests/KnowledgeBaseGetRequest.d.ts +13 -0
- package/dist/api/resources/knowledge/client/requests/KnowledgeBaseGetRequest.js +5 -0
- package/dist/api/resources/knowledge/client/requests/index.d.ts +1 -0
- package/dist/api/resources/knowledge/client/requests/index.js +2 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.js +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +26 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeBasePatchRequest.d.ts +16 -0
- package/dist/api/resources/knowledge/types/KnowledgeBasePatchRequest.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshFrequency.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshFrequency.js +12 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +15 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseSearchRequest.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseSearchRequest.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeBasesResponse.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeBasesResponse.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentField.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentField.js +12 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +26 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentFilter.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchRequest.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchRequest.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentsResponse.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentsResponse.js +5 -0
- package/dist/api/resources/knowledge/types/index.d.ts +11 -0
- package/dist/api/resources/knowledge/types/index.js +11 -0
- package/dist/api/resources/organizations/client/Client.d.ts +7 -3
- package/dist/api/resources/organizations/client/Client.js +51 -28
- package/dist/api/resources/segments/client/Client.d.ts +120 -0
- package/dist/api/resources/segments/client/Client.js +468 -0
- package/dist/api/resources/segments/client/index.d.ts +2 -0
- package/dist/{core/websocket → api/resources/segments/client}/index.js +1 -1
- package/dist/api/resources/segments/client/requests/SegmentGetRequest.d.ts +13 -0
- package/dist/api/resources/segments/client/requests/SegmentGetRequest.js +5 -0
- package/dist/api/resources/segments/client/requests/index.d.ts +1 -0
- package/dist/api/resources/segments/client/requests/index.js +2 -0
- package/dist/api/resources/segments/index.d.ts +2 -0
- package/dist/api/resources/segments/index.js +18 -0
- package/dist/api/resources/segments/types/SegmentBase.d.ts +10 -0
- package/dist/api/resources/segments/types/SegmentBase.js +5 -0
- package/dist/api/resources/segments/types/SegmentField.d.ts +8 -0
- package/dist/api/resources/{realtime/types/AudioFormat.js → segments/types/SegmentField.js} +4 -4
- package/dist/api/resources/segments/types/SegmentPatchRequest.d.ts +14 -0
- package/dist/api/resources/segments/types/SegmentPatchRequest.js +5 -0
- package/dist/api/resources/segments/types/SegmentRequest.d.ts +28 -0
- package/dist/api/resources/segments/types/SegmentRequest.js +5 -0
- package/dist/api/resources/segments/types/SegmentResponse.d.ts +39 -0
- package/dist/api/resources/segments/types/SegmentResponse.js +5 -0
- package/dist/api/resources/segments/types/SegmentStatus.d.ts +8 -0
- package/dist/api/resources/segments/types/SegmentStatus.js +10 -0
- package/dist/api/resources/segments/types/SegmentsSearchRequest.d.ts +8 -0
- package/dist/api/resources/segments/types/SegmentsSearchRequest.js +5 -0
- package/dist/api/resources/segments/types/SegmentsSearchResponse.d.ts +7 -0
- package/dist/api/resources/segments/types/SegmentsSearchResponse.js +5 -0
- package/dist/api/resources/segments/types/index.d.ts +8 -0
- package/dist/api/resources/segments/types/index.js +24 -0
- package/dist/api/resources/translations/client/Client.d.ts +5 -2
- package/dist/api/resources/translations/client/Client.js +26 -16
- package/dist/api/resources/triggers/client/Client.d.ts +13 -6
- package/dist/api/resources/triggers/client/Client.js +118 -63
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/Client.d.ts +49 -10
- package/dist/api/resources/users/client/Client.js +263 -47
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/requests/UserDeleteRequest.d.ts +1 -1
- package/dist/api/resources/users/client/requests/UserGetRequest.d.ts +1 -1
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- package/dist/api/resources/users/types/AgentUser.d.ts +24 -0
- package/dist/api/resources/users/types/AgentUser.js +5 -0
- package/dist/api/resources/users/types/AgentUserField.d.ts +8 -0
- package/dist/api/resources/users/types/AgentUserField.js +10 -0
- package/dist/api/resources/users/types/AgentUserFilter.d.ts +12 -0
- package/dist/api/resources/users/types/AgentUserFilter.js +5 -0
- package/dist/api/resources/users/types/AgentUserSearchRequest.d.ts +8 -0
- package/dist/api/resources/users/types/AgentUserSearchRequest.js +5 -0
- package/dist/api/resources/users/types/AgentUserSearchResponse.d.ts +8 -0
- package/dist/api/resources/users/types/AgentUserSearchResponse.js +5 -0
- package/dist/api/resources/users/types/AppUserSummary.d.ts +12 -0
- package/dist/api/resources/users/types/AppUserSummary.js +5 -0
- package/dist/api/resources/users/types/index.d.ts +6 -0
- package/dist/api/resources/users/types/index.js +22 -0
- package/dist/core/auth/BasicAuth.js +3 -3
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/base64.js +26 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
- package/dist/core/fetcher/BinaryResponse.js +17 -0
- package/dist/core/fetcher/Fetcher.d.ts +3 -2
- package/dist/core/fetcher/Fetcher.js +32 -12
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +3 -7
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +44 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -4
- package/dist/core/fetcher/getFetchFn.js +1 -52
- package/dist/core/fetcher/getResponseBody.js +34 -33
- package/dist/core/fetcher/index.d.ts +4 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.js +29 -0
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +4 -3
- package/dist/core/runtime/runtime.js +0 -1
- package/dist/core/{streaming-fetcher → stream}/Stream.d.ts +1 -2
- package/dist/core/url/index.d.ts +2 -0
- package/dist/core/url/index.js +7 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +49 -0
- package/dist/core/url/qs.d.ts +6 -0
- package/dist/core/url/qs.js +64 -0
- package/dist/errors/MavenAGIError.d.ts +4 -1
- package/dist/errors/MavenAGIError.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/serialization/resources/actions/types/ActionField.d.ts +10 -0
- package/dist/serialization/resources/actions/types/ActionField.js +41 -0
- package/dist/serialization/resources/actions/types/ActionFilter.d.ts +16 -0
- package/dist/serialization/resources/actions/types/ActionFilter.js +47 -0
- package/dist/serialization/resources/actions/types/ActionPatchRequest.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ActionPatchRequest.js +46 -0
- package/dist/serialization/resources/actions/types/ActionsResponse.d.ts +14 -0
- package/dist/serialization/resources/{realtime/types/ControlEvent.js → actions/types/ActionsResponse.js} +6 -7
- package/dist/serialization/resources/actions/types/ActionsSearchRequest.d.ts +16 -0
- package/dist/serialization/resources/actions/types/ActionsSearchRequest.js +49 -0
- package/dist/serialization/resources/actions/types/index.d.ts +5 -0
- package/dist/serialization/resources/actions/types/index.js +5 -0
- package/dist/serialization/resources/agents/types/Agent.d.ts +2 -0
- package/dist/serialization/resources/agents/types/Agent.js +2 -0
- package/dist/serialization/resources/agents/types/AgentPatchRequest.d.ts +16 -0
- package/dist/serialization/resources/agents/types/AgentPatchRequest.js +47 -0
- package/dist/serialization/resources/agents/types/CreateAgentRequest.d.ts +14 -0
- package/dist/serialization/resources/agents/types/CreateAgentRequest.js +45 -0
- package/dist/serialization/resources/agents/types/PiiCategory.d.ts +10 -0
- package/dist/serialization/resources/agents/types/PiiCategory.js +99 -0
- package/dist/serialization/resources/agents/types/index.d.ts +3 -0
- package/dist/serialization/resources/agents/types/index.js +3 -0
- package/dist/serialization/resources/assets/types/CommitAssetUploadRequest.d.ts +12 -0
- package/dist/serialization/resources/assets/types/CommitAssetUploadRequest.js +43 -0
- package/dist/serialization/resources/assets/types/InitiateAssetUploadRequest.d.ts +12 -0
- package/dist/serialization/resources/assets/types/InitiateAssetUploadRequest.js +42 -0
- package/dist/serialization/resources/assets/types/InitiateAssetUploadResponse.d.ts +15 -0
- package/dist/serialization/resources/assets/types/InitiateAssetUploadResponse.js +46 -0
- package/dist/serialization/resources/assets/types/index.d.ts +3 -0
- package/dist/serialization/resources/assets/types/index.js +19 -0
- package/dist/serialization/resources/commons/types/ActionResponse.d.ts +6 -0
- package/dist/serialization/resources/commons/types/ActionResponse.js +6 -0
- package/dist/serialization/resources/commons/types/AttachmentRequest.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AttachmentRequest.js +48 -0
- package/dist/serialization/resources/commons/types/AttachmentResponse.d.ts +16 -0
- package/dist/serialization/resources/commons/types/AttachmentResponse.js +49 -0
- package/dist/serialization/resources/commons/types/AttachmentStatus.d.ts +10 -0
- package/dist/serialization/resources/commons/types/AttachmentStatus.js +41 -0
- package/{serialization/resources/conversation/types/Attachment.d.ts → dist/serialization/resources/commons/types/BaseAttachment.d.ts} +3 -3
- package/dist/serialization/resources/{conversation/types/Attachment.js → commons/types/BaseAttachment.js} +3 -3
- package/dist/serialization/resources/commons/types/BaseConversationResponse.d.ts +2 -0
- package/dist/serialization/resources/commons/types/BaseConversationResponse.js +2 -0
- package/dist/serialization/resources/commons/types/BotLogic.d.ts +13 -0
- package/dist/serialization/resources/commons/types/BotLogic.js +44 -0
- package/dist/serialization/resources/commons/types/BotLogicActionExecutedDetail.d.ts +15 -0
- package/dist/serialization/resources/commons/types/BotLogicActionExecutedDetail.js +48 -0
- package/dist/serialization/resources/commons/types/BotLogicActionItem.d.ts +15 -0
- package/dist/serialization/resources/commons/types/BotLogicActionItem.js +46 -0
- package/dist/serialization/resources/commons/types/BotLogicActionReviewedDetail.d.ts +14 -0
- package/{serialization/resources/commons/types/KnowledgeBaseInformation.js → dist/serialization/resources/commons/types/BotLogicActionReviewedDetail.js} +4 -3
- package/dist/serialization/resources/commons/types/BotLogicFormSubmissionItem.d.ts +12 -0
- package/dist/serialization/resources/commons/types/BotLogicFormSubmissionItem.js +42 -0
- package/dist/serialization/resources/commons/types/BotLogicItem.d.ts +34 -0
- package/dist/serialization/resources/commons/types/BotLogicItem.js +59 -0
- package/{serialization/resources/commons/types/KnowledgeBaseInformation.d.ts → dist/serialization/resources/commons/types/BotLogicKnowledgeDetail.d.ts} +5 -2
- package/dist/serialization/resources/commons/types/BotLogicKnowledgeDetail.js +47 -0
- package/dist/serialization/resources/commons/types/BotLogicKnowledgeItem.d.ts +14 -0
- package/dist/serialization/resources/commons/types/BotLogicKnowledgeItem.js +45 -0
- package/dist/serialization/resources/commons/types/{UserMessageAttachment.d.ts → BotLogicSafetyItem.d.ts} +3 -3
- package/dist/serialization/resources/{realtime/types/AudioPublishEvent.js → commons/types/BotLogicSafetyItem.js} +3 -3
- package/dist/serialization/resources/commons/types/BotLogicSegmentsItem.d.ts +13 -0
- package/dist/serialization/resources/{inbox/types/BaseInboxSearchRequest.js → commons/types/BotLogicSegmentsItem.js} +4 -4
- package/dist/serialization/resources/{realtime/types/AudioPublishEvent.d.ts → commons/types/BotLogicUserItem.d.ts} +3 -3
- package/dist/serialization/resources/commons/types/BotLogicUserItem.js +43 -0
- package/dist/serialization/resources/commons/types/BotMessage.d.ts +4 -2
- package/dist/serialization/resources/commons/types/BotMessage.js +4 -2
- package/dist/serialization/resources/commons/types/Capability.d.ts +1 -1
- package/dist/serialization/resources/commons/types/Capability.js +1 -1
- package/dist/serialization/resources/commons/types/ConversationResponse.d.ts +2 -0
- package/dist/serialization/resources/commons/types/ConversationResponse.js +2 -0
- package/dist/serialization/resources/commons/types/DocumentInformation.d.ts +1 -0
- package/dist/serialization/resources/commons/types/DocumentInformation.js +1 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +1 -0
- package/dist/serialization/resources/commons/types/InboxItem.d.ts +1 -9
- package/dist/serialization/resources/commons/types/InboxItem.js +0 -4
- package/dist/serialization/resources/commons/types/InboxItemBase.d.ts +2 -0
- package/dist/serialization/resources/commons/types/InboxItemBase.js +2 -0
- package/dist/serialization/resources/commons/types/InboxItemDuplicateDocuments.d.ts +1 -1
- package/dist/serialization/resources/commons/types/InboxItemDuplicateDocuments.js +1 -1
- package/dist/serialization/resources/commons/types/InboxItemFix.d.ts +1 -5
- package/dist/serialization/resources/commons/types/InboxItemFix.js +0 -2
- package/dist/serialization/resources/commons/types/InboxItemSeverity.d.ts +10 -0
- package/dist/serialization/resources/{realtime/types/MessageBase.js → commons/types/InboxItemSeverity.js} +2 -4
- package/dist/serialization/resources/commons/types/InboxItemType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/InboxItemType.js +1 -6
- package/dist/serialization/resources/commons/types/LlmInclusionStatus.d.ts +10 -0
- package/{serialization/resources/realtime/types/MessageBase.js → dist/serialization/resources/commons/types/LlmInclusionStatus.js} +2 -4
- package/dist/serialization/resources/commons/types/{BotMessageStatus.d.ts → MessageStatus.d.ts} +2 -2
- package/dist/serialization/resources/commons/types/{UserMessageAttachment.js → MessageStatus.js} +2 -4
- package/dist/serialization/resources/commons/types/UserMessage.d.ts +7 -2
- package/dist/serialization/resources/commons/types/UserMessage.js +7 -2
- package/dist/serialization/resources/commons/types/UserMessageResponseState.d.ts +10 -0
- package/dist/serialization/resources/commons/types/UserMessageResponseState.js +41 -0
- package/dist/serialization/resources/commons/types/index.d.ts +19 -6
- package/dist/serialization/resources/commons/types/index.js +19 -6
- package/{serialization/resources/conversation/types/GenerateObjectRequest.d.ts → dist/serialization/resources/conversation/types/AskObjectRequest.d.ts} +2 -2
- package/{serialization/resources/conversation/types/GenerateObjectRequest.js → dist/serialization/resources/conversation/types/AskObjectRequest.js} +2 -2
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +2 -2
- package/dist/serialization/resources/conversation/types/AskRequest.js +2 -2
- package/dist/serialization/resources/conversation/types/ConversationField.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/ConversationField.js +4 -0
- package/dist/serialization/resources/conversation/types/ConversationFilter.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/ConversationFilter.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationPatchRequest.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ConversationPatchRequest.js +47 -0
- package/dist/serialization/resources/conversation/types/DeliverConversationMessageRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/DeliverConversationMessageRequest.js +46 -0
- package/dist/serialization/resources/conversation/types/DeliverMessageRequest.d.ts +18 -0
- package/dist/serialization/resources/{realtime/types/PublishEvent.js → conversation/types/DeliverMessageRequest.js} +7 -7
- package/dist/serialization/resources/conversation/types/DeliverMessageResponse.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/DeliverMessageResponse.js +44 -0
- package/dist/serialization/resources/conversation/types/DeliverUserMessageRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/DeliverUserMessageRequest.js +46 -0
- package/{serialization/resources/realtime/types/MessageBase.d.ts → dist/serialization/resources/conversation/types/DeliveryStatus.d.ts} +3 -5
- package/dist/serialization/resources/conversation/types/DeliveryStatus.js +41 -0
- package/dist/serialization/resources/conversation/types/NumericConversationField.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/NumericConversationField.js +1 -0
- package/dist/serialization/resources/conversation/types/ObjectStreamResponse.d.ts +22 -0
- package/dist/serialization/resources/{realtime/types/SubscribeEvent.js → conversation/types/ObjectStreamResponse.js} +9 -10
- package/dist/serialization/resources/conversation/types/index.d.ts +8 -2
- package/dist/serialization/resources/conversation/types/index.js +8 -2
- package/dist/serialization/resources/inbox/types/{ApplyInboxItemFixRequest.d.ts → ApplyFixesRequest.d.ts} +3 -2
- package/{serialization/resources/inbox/types/ApplyInboxItemFixRequest.js → dist/serialization/resources/inbox/types/ApplyFixesRequest.js} +3 -2
- package/dist/serialization/resources/inbox/types/InboxFilter.d.ts +17 -0
- package/dist/serialization/resources/inbox/types/InboxFilter.js +48 -0
- package/dist/serialization/resources/inbox/types/InboxSearchRequest.d.ts +4 -8
- package/dist/serialization/resources/inbox/types/InboxSearchRequest.js +4 -8
- package/dist/serialization/resources/inbox/types/InboxSearchResponse.d.ts +1 -1
- package/dist/serialization/resources/inbox/types/InboxSearchResponse.js +1 -1
- package/dist/serialization/resources/inbox/types/index.d.ts +2 -2
- package/dist/serialization/resources/inbox/types/index.js +2 -2
- package/dist/serialization/resources/index.d.ts +6 -2
- package/dist/serialization/resources/index.js +7 -3
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.js +41 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +46 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBasePatchRequest.d.ts +18 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBasePatchRequest.js +49 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRefreshFrequency.d.ts +10 -0
- package/dist/serialization/resources/{commons/types/BotMessageStatus.js → knowledge/types/KnowledgeBaseRefreshFrequency.js} +2 -2
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +6 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +6 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseSearchRequest.d.ts +16 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseSearchRequest.js +49 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBasesResponse.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBasesResponse.js +47 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentField.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentField.js +41 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentFilter.js +46 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchRequest.d.ts +16 -0
- package/dist/serialization/resources/{commons/types/InboxItemKnowledgeBaseAlert.js → knowledge/types/KnowledgeDocumentSearchRequest.js} +8 -8
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +48 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentsResponse.d.ts +14 -0
- package/dist/serialization/resources/{commons/types/InboxItemFixDeactivateKnowledgeBase.js → knowledge/types/KnowledgeDocumentsResponse.js} +6 -6
- package/dist/serialization/resources/knowledge/types/index.d.ts +11 -0
- package/dist/serialization/resources/knowledge/types/index.js +11 -0
- package/dist/serialization/resources/segments/types/SegmentBase.d.ts +13 -0
- package/dist/serialization/resources/segments/types/SegmentBase.js +45 -0
- package/{serialization/resources/realtime/types/AudioFormat.d.ts → dist/serialization/resources/segments/types/SegmentField.d.ts} +3 -3
- package/{serialization/resources/realtime/types/AudioFormat.js → dist/serialization/resources/segments/types/SegmentField.js} +2 -2
- package/dist/serialization/resources/segments/types/SegmentPatchRequest.d.ts +16 -0
- package/dist/serialization/resources/segments/types/SegmentPatchRequest.js +48 -0
- package/dist/serialization/resources/segments/types/SegmentRequest.d.ts +14 -0
- package/dist/serialization/resources/segments/types/SegmentRequest.js +47 -0
- package/dist/serialization/resources/segments/types/SegmentResponse.d.ts +16 -0
- package/dist/serialization/resources/segments/types/SegmentResponse.js +49 -0
- package/dist/serialization/resources/{realtime/types/MessageBase.d.ts → segments/types/SegmentStatus.d.ts} +3 -5
- package/dist/serialization/resources/segments/types/SegmentStatus.js +41 -0
- package/dist/serialization/resources/segments/types/SegmentsSearchRequest.d.ts +14 -0
- package/dist/serialization/resources/segments/types/SegmentsSearchRequest.js +47 -0
- package/dist/serialization/resources/segments/types/SegmentsSearchResponse.d.ts +14 -0
- package/{serialization/resources/realtime/types/ControlEvent.js → dist/serialization/resources/segments/types/SegmentsSearchResponse.js} +6 -7
- package/dist/serialization/resources/segments/types/index.d.ts +8 -0
- package/dist/serialization/resources/segments/types/index.js +24 -0
- package/dist/serialization/resources/users/index.d.ts +1 -0
- package/dist/serialization/resources/users/index.js +17 -0
- package/dist/serialization/resources/users/types/AgentUser.d.ts +19 -0
- package/dist/serialization/resources/users/types/AgentUser.js +50 -0
- package/dist/serialization/resources/users/types/AgentUserField.d.ts +10 -0
- package/dist/serialization/resources/users/types/AgentUserField.js +41 -0
- package/dist/serialization/resources/users/types/AgentUserFilter.d.ts +13 -0
- package/dist/serialization/resources/users/types/AgentUserFilter.js +44 -0
- package/dist/serialization/resources/users/types/AgentUserSearchRequest.d.ts +16 -0
- package/dist/serialization/resources/users/types/AgentUserSearchRequest.js +49 -0
- package/dist/serialization/resources/users/types/AgentUserSearchResponse.d.ts +14 -0
- package/dist/serialization/resources/users/types/AgentUserSearchResponse.js +47 -0
- package/dist/serialization/resources/users/types/AppUserSummary.d.ts +16 -0
- package/dist/serialization/resources/users/types/AppUserSummary.js +47 -0
- package/dist/serialization/resources/users/types/index.d.ts +6 -0
- package/dist/serialization/resources/users/types/index.js +22 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/errors/MavenAGIError.d.ts +4 -1
- package/errors/MavenAGIError.js +4 -7
- package/index.d.ts +2 -2
- package/index.js +5 -5
- package/jest.config.mjs +6 -1
- package/package.json +13 -21
- package/reference.md +2051 -753
- package/scripts/rename-to-esm-files.js +10 -2
- package/serialization/resources/actions/types/ActionField.d.ts +10 -0
- package/serialization/resources/actions/types/ActionField.js +41 -0
- package/serialization/resources/actions/types/ActionFilter.d.ts +16 -0
- package/serialization/resources/actions/types/ActionFilter.js +47 -0
- package/serialization/resources/actions/types/ActionPatchRequest.d.ts +15 -0
- package/serialization/resources/actions/types/ActionPatchRequest.js +46 -0
- package/serialization/resources/actions/types/ActionsResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionsResponse.js +47 -0
- package/serialization/resources/actions/types/ActionsSearchRequest.d.ts +16 -0
- package/serialization/resources/actions/types/ActionsSearchRequest.js +49 -0
- package/serialization/resources/actions/types/index.d.ts +5 -0
- package/serialization/resources/actions/types/index.js +5 -0
- package/serialization/resources/agents/types/Agent.d.ts +2 -0
- package/serialization/resources/agents/types/Agent.js +2 -0
- package/serialization/resources/agents/types/AgentPatchRequest.d.ts +16 -0
- package/serialization/resources/agents/types/AgentPatchRequest.js +47 -0
- package/serialization/resources/agents/types/CreateAgentRequest.d.ts +14 -0
- package/serialization/resources/agents/types/CreateAgentRequest.js +45 -0
- package/serialization/resources/agents/types/PiiCategory.d.ts +10 -0
- package/serialization/resources/agents/types/PiiCategory.js +99 -0
- package/serialization/resources/agents/types/index.d.ts +3 -0
- package/serialization/resources/agents/types/index.js +3 -0
- package/serialization/resources/assets/index.d.ts +1 -0
- package/serialization/resources/assets/index.js +17 -0
- package/serialization/resources/assets/types/CommitAssetUploadRequest.d.ts +12 -0
- package/serialization/resources/assets/types/CommitAssetUploadRequest.js +43 -0
- package/serialization/resources/assets/types/InitiateAssetUploadRequest.d.ts +12 -0
- package/serialization/resources/assets/types/InitiateAssetUploadRequest.js +42 -0
- package/serialization/resources/assets/types/InitiateAssetUploadResponse.d.ts +15 -0
- package/serialization/resources/assets/types/InitiateAssetUploadResponse.js +46 -0
- package/serialization/resources/assets/types/index.d.ts +3 -0
- package/serialization/resources/assets/types/index.js +19 -0
- package/serialization/resources/commons/types/ActionResponse.d.ts +6 -0
- package/serialization/resources/commons/types/ActionResponse.js +6 -0
- package/serialization/resources/commons/types/AttachmentRequest.d.ts +15 -0
- package/serialization/resources/commons/types/AttachmentRequest.js +48 -0
- package/serialization/resources/commons/types/AttachmentResponse.d.ts +16 -0
- package/serialization/resources/commons/types/AttachmentResponse.js +49 -0
- package/serialization/resources/commons/types/AttachmentStatus.d.ts +10 -0
- package/serialization/resources/commons/types/AttachmentStatus.js +41 -0
- package/{dist/serialization/resources/conversation/types/Attachment.d.ts → serialization/resources/commons/types/BaseAttachment.d.ts} +3 -3
- package/serialization/resources/{conversation/types/Attachment.js → commons/types/BaseAttachment.js} +3 -3
- package/serialization/resources/commons/types/BaseConversationResponse.d.ts +2 -0
- package/serialization/resources/commons/types/BaseConversationResponse.js +2 -0
- package/serialization/resources/commons/types/BotLogic.d.ts +13 -0
- package/serialization/resources/commons/types/BotLogic.js +44 -0
- package/serialization/resources/commons/types/BotLogicActionExecutedDetail.d.ts +15 -0
- package/serialization/resources/commons/types/BotLogicActionExecutedDetail.js +48 -0
- package/serialization/resources/commons/types/BotLogicActionItem.d.ts +15 -0
- package/serialization/resources/commons/types/BotLogicActionItem.js +46 -0
- package/serialization/resources/commons/types/BotLogicActionReviewedDetail.d.ts +14 -0
- package/{dist/serialization/resources/commons/types/KnowledgeBaseInformation.js → serialization/resources/commons/types/BotLogicActionReviewedDetail.js} +4 -3
- package/serialization/resources/commons/types/BotLogicFormSubmissionItem.d.ts +12 -0
- package/serialization/resources/commons/types/BotLogicFormSubmissionItem.js +42 -0
- package/serialization/resources/commons/types/BotLogicItem.d.ts +34 -0
- package/serialization/resources/commons/types/BotLogicItem.js +59 -0
- package/{dist/serialization/resources/commons/types/KnowledgeBaseInformation.d.ts → serialization/resources/commons/types/BotLogicKnowledgeDetail.d.ts} +5 -2
- package/serialization/resources/commons/types/BotLogicKnowledgeDetail.js +47 -0
- package/serialization/resources/commons/types/BotLogicKnowledgeItem.d.ts +14 -0
- package/serialization/resources/commons/types/BotLogicKnowledgeItem.js +45 -0
- package/serialization/resources/commons/types/BotLogicSafetyItem.d.ts +12 -0
- package/{dist/serialization/resources/realtime/types/AudioSubscribeEvent.js → serialization/resources/commons/types/BotLogicSafetyItem.js} +3 -3
- package/serialization/resources/commons/types/BotLogicSegmentsItem.d.ts +13 -0
- package/serialization/resources/commons/types/BotLogicSegmentsItem.js +44 -0
- package/{dist/serialization/resources/realtime/types/AudioSubscribeEvent.d.ts → serialization/resources/commons/types/BotLogicUserItem.d.ts} +3 -3
- package/serialization/resources/commons/types/BotLogicUserItem.js +43 -0
- package/serialization/resources/commons/types/BotMessage.d.ts +4 -2
- package/serialization/resources/commons/types/BotMessage.js +4 -2
- package/serialization/resources/commons/types/Capability.d.ts +1 -1
- package/serialization/resources/commons/types/Capability.js +1 -1
- package/serialization/resources/commons/types/ConversationResponse.d.ts +2 -0
- package/serialization/resources/commons/types/ConversationResponse.js +2 -0
- package/serialization/resources/commons/types/DocumentInformation.d.ts +1 -0
- package/serialization/resources/commons/types/DocumentInformation.js +1 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/serialization/resources/commons/types/InboxItem.d.ts +1 -9
- package/serialization/resources/commons/types/InboxItem.js +0 -4
- package/serialization/resources/commons/types/InboxItemBase.d.ts +2 -0
- package/serialization/resources/commons/types/InboxItemBase.js +2 -0
- package/serialization/resources/commons/types/InboxItemDuplicateDocuments.d.ts +1 -1
- package/serialization/resources/commons/types/InboxItemDuplicateDocuments.js +1 -1
- package/serialization/resources/commons/types/InboxItemFix.d.ts +1 -5
- package/serialization/resources/commons/types/InboxItemFix.js +0 -2
- package/serialization/resources/commons/types/InboxItemSeverity.d.ts +10 -0
- package/serialization/resources/commons/types/InboxItemSeverity.js +41 -0
- package/serialization/resources/commons/types/InboxItemType.d.ts +1 -1
- package/serialization/resources/commons/types/InboxItemType.js +1 -6
- package/serialization/resources/commons/types/LlmInclusionStatus.d.ts +10 -0
- package/serialization/resources/commons/types/LlmInclusionStatus.js +41 -0
- package/serialization/resources/commons/types/{BotMessageStatus.d.ts → MessageStatus.d.ts} +2 -2
- package/serialization/resources/commons/types/MessageStatus.js +41 -0
- package/serialization/resources/commons/types/UserMessage.d.ts +7 -2
- package/serialization/resources/commons/types/UserMessage.js +7 -2
- package/serialization/resources/commons/types/UserMessageResponseState.d.ts +10 -0
- package/serialization/resources/commons/types/UserMessageResponseState.js +41 -0
- package/serialization/resources/commons/types/index.d.ts +19 -6
- package/serialization/resources/commons/types/index.js +19 -6
- package/{dist/serialization/resources/conversation/types/GenerateObjectRequest.d.ts → serialization/resources/conversation/types/AskObjectRequest.d.ts} +2 -2
- package/{dist/serialization/resources/conversation/types/GenerateObjectRequest.js → serialization/resources/conversation/types/AskObjectRequest.js} +2 -2
- package/serialization/resources/conversation/types/AskRequest.d.ts +2 -2
- package/serialization/resources/conversation/types/AskRequest.js +2 -2
- package/serialization/resources/conversation/types/ConversationField.d.ts +1 -1
- package/serialization/resources/conversation/types/ConversationField.js +4 -0
- package/serialization/resources/conversation/types/ConversationFilter.d.ts +1 -0
- package/serialization/resources/conversation/types/ConversationFilter.js +1 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationPatchRequest.d.ts +16 -0
- package/serialization/resources/conversation/types/ConversationPatchRequest.js +47 -0
- package/serialization/resources/conversation/types/DeliverConversationMessageRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/DeliverConversationMessageRequest.js +46 -0
- package/serialization/resources/conversation/types/DeliverMessageRequest.d.ts +18 -0
- package/serialization/resources/{realtime/types/PublishEvent.js → conversation/types/DeliverMessageRequest.js} +7 -7
- package/serialization/resources/conversation/types/DeliverMessageResponse.d.ts +13 -0
- package/serialization/resources/conversation/types/DeliverMessageResponse.js +44 -0
- package/serialization/resources/conversation/types/DeliverUserMessageRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/DeliverUserMessageRequest.js +46 -0
- package/serialization/resources/conversation/types/DeliveryStatus.d.ts +10 -0
- package/serialization/resources/conversation/types/DeliveryStatus.js +41 -0
- package/serialization/resources/conversation/types/NumericConversationField.d.ts +1 -1
- package/serialization/resources/conversation/types/NumericConversationField.js +1 -0
- package/serialization/resources/conversation/types/ObjectStreamResponse.d.ts +22 -0
- package/serialization/resources/{realtime/types/SubscribeEvent.js → conversation/types/ObjectStreamResponse.js} +9 -10
- package/serialization/resources/conversation/types/index.d.ts +8 -2
- package/serialization/resources/conversation/types/index.js +8 -2
- package/serialization/resources/inbox/types/{ApplyInboxItemFixRequest.d.ts → ApplyFixesRequest.d.ts} +3 -2
- package/{dist/serialization/resources/inbox/types/ApplyInboxItemFixRequest.js → serialization/resources/inbox/types/ApplyFixesRequest.js} +3 -2
- package/serialization/resources/inbox/types/InboxFilter.d.ts +17 -0
- package/serialization/resources/inbox/types/InboxFilter.js +48 -0
- package/serialization/resources/inbox/types/InboxSearchRequest.d.ts +4 -8
- package/serialization/resources/inbox/types/InboxSearchRequest.js +4 -8
- package/serialization/resources/inbox/types/InboxSearchResponse.d.ts +1 -1
- package/serialization/resources/inbox/types/InboxSearchResponse.js +1 -1
- package/serialization/resources/inbox/types/index.d.ts +2 -2
- package/serialization/resources/inbox/types/index.js +2 -2
- package/serialization/resources/index.d.ts +6 -2
- package/serialization/resources/index.js +7 -3
- package/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseField.js +41 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +46 -0
- package/serialization/resources/knowledge/types/KnowledgeBasePatchRequest.d.ts +18 -0
- package/serialization/resources/knowledge/types/KnowledgeBasePatchRequest.js +49 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRefreshFrequency.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRefreshFrequency.js +41 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +6 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +6 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseSearchRequest.d.ts +16 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseSearchRequest.js +49 -0
- package/serialization/resources/knowledge/types/KnowledgeBasesResponse.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBasesResponse.js +47 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentField.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentField.js +41 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.js +46 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchRequest.d.ts +16 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchRequest.js +49 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +48 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentsResponse.d.ts +14 -0
- package/serialization/resources/{commons/types/InboxItemFixDeactivateKnowledgeBase.js → knowledge/types/KnowledgeDocumentsResponse.js} +6 -6
- package/serialization/resources/knowledge/types/index.d.ts +11 -0
- package/serialization/resources/knowledge/types/index.js +11 -0
- package/serialization/resources/segments/index.d.ts +1 -0
- package/serialization/resources/segments/index.js +17 -0
- package/serialization/resources/segments/types/SegmentBase.d.ts +13 -0
- package/serialization/resources/segments/types/SegmentBase.js +45 -0
- package/{dist/serialization/resources/realtime/types/AudioFormat.d.ts → serialization/resources/segments/types/SegmentField.d.ts} +3 -3
- package/{dist/serialization/resources/realtime/types/AudioFormat.js → serialization/resources/segments/types/SegmentField.js} +2 -2
- package/serialization/resources/segments/types/SegmentPatchRequest.d.ts +16 -0
- package/serialization/resources/segments/types/SegmentPatchRequest.js +48 -0
- package/serialization/resources/segments/types/SegmentRequest.d.ts +14 -0
- package/serialization/resources/segments/types/SegmentRequest.js +47 -0
- package/serialization/resources/segments/types/SegmentResponse.d.ts +16 -0
- package/serialization/resources/segments/types/SegmentResponse.js +49 -0
- package/serialization/resources/segments/types/SegmentStatus.d.ts +10 -0
- package/serialization/resources/segments/types/SegmentStatus.js +41 -0
- package/serialization/resources/segments/types/SegmentsSearchRequest.d.ts +14 -0
- package/serialization/resources/segments/types/SegmentsSearchRequest.js +47 -0
- package/serialization/resources/segments/types/SegmentsSearchResponse.d.ts +14 -0
- package/serialization/resources/segments/types/SegmentsSearchResponse.js +47 -0
- package/serialization/resources/segments/types/index.d.ts +8 -0
- package/serialization/resources/segments/types/index.js +24 -0
- package/serialization/resources/users/index.d.ts +1 -0
- package/serialization/resources/users/index.js +17 -0
- package/serialization/resources/users/types/AgentUser.d.ts +19 -0
- package/serialization/resources/users/types/AgentUser.js +50 -0
- package/serialization/resources/users/types/AgentUserField.d.ts +10 -0
- package/serialization/resources/users/types/AgentUserField.js +41 -0
- package/serialization/resources/users/types/AgentUserFilter.d.ts +13 -0
- package/serialization/resources/users/types/AgentUserFilter.js +44 -0
- package/serialization/resources/users/types/AgentUserSearchRequest.d.ts +16 -0
- package/serialization/resources/users/types/AgentUserSearchRequest.js +49 -0
- package/serialization/resources/users/types/AgentUserSearchResponse.d.ts +14 -0
- package/serialization/resources/users/types/AgentUserSearchResponse.js +47 -0
- package/serialization/resources/users/types/AppUserSummary.d.ts +16 -0
- package/serialization/resources/users/types/AppUserSummary.js +47 -0
- package/serialization/resources/users/types/index.d.ts +6 -0
- package/serialization/resources/users/types/index.js +22 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/commons/types/InboxItemDuplicateKnowledgeBase.d.ts +0 -12
- package/api/resources/commons/types/InboxItemFixDeactivateKnowledgeBase.d.ts +0 -8
- package/api/resources/commons/types/InboxItemKnowledgeBaseAlert.d.ts +0 -10
- package/api/resources/commons/types/UserMessageAttachment.d.ts +0 -7
- package/api/resources/conversation/types/Attachment.d.ts +0 -9
- package/api/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +0 -9
- package/api/resources/inbox/types/BaseInboxSearchRequest.d.ts +0 -9
- package/api/resources/realtime/client/Client.d.ts +0 -36
- package/api/resources/realtime/client/Client.js +0 -90
- package/api/resources/realtime/client/Socket.d.ts +0 -41
- package/api/resources/realtime/client/Socket.js +0 -155
- package/api/resources/realtime/types/AudioFormat.d.ts +0 -8
- package/api/resources/realtime/types/ControlEvent.d.ts +0 -9
- package/api/resources/realtime/types/PublishEvent.d.ts +0 -16
- package/api/resources/realtime/types/SubscribeEvent.d.ts +0 -25
- package/api/resources/realtime/types/index.d.ts +0 -8
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/core/websocket/events.d.ts +0 -36
- package/core/websocket/events.js +0 -27
- package/core/websocket/index.d.ts +0 -1
- package/core/websocket/ws.d.ts +0 -137
- package/core/websocket/ws.js +0 -452
- package/dist/api/resources/commons/types/InboxItemDuplicateKnowledgeBase.d.ts +0 -12
- package/dist/api/resources/commons/types/InboxItemFixDeactivateKnowledgeBase.d.ts +0 -8
- package/dist/api/resources/commons/types/InboxItemKnowledgeBaseAlert.d.ts +0 -10
- package/dist/api/resources/commons/types/UserMessageAttachment.d.ts +0 -7
- package/dist/api/resources/conversation/types/Attachment.d.ts +0 -9
- package/dist/api/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +0 -9
- package/dist/api/resources/inbox/types/BaseInboxSearchRequest.d.ts +0 -9
- package/dist/api/resources/realtime/client/Client.d.ts +0 -36
- package/dist/api/resources/realtime/client/Client.js +0 -90
- package/dist/api/resources/realtime/client/Socket.d.ts +0 -41
- package/dist/api/resources/realtime/client/Socket.js +0 -155
- package/dist/api/resources/realtime/types/AudioFormat.d.ts +0 -8
- package/dist/api/resources/realtime/types/AudioPublishEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/ControlEvent.d.ts +0 -9
- package/dist/api/resources/realtime/types/HangUpPublishEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/MessageBase.d.ts +0 -6
- package/dist/api/resources/realtime/types/PublishEvent.d.ts +0 -16
- package/dist/api/resources/realtime/types/SubscribeEvent.d.ts +0 -25
- package/dist/api/resources/realtime/types/index.d.ts +0 -8
- package/dist/api/resources/realtime/types/index.js +0 -24
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/dist/core/websocket/events.d.ts +0 -36
- package/dist/core/websocket/events.js +0 -27
- package/dist/core/websocket/index.d.ts +0 -1
- package/dist/core/websocket/ws.d.ts +0 -137
- package/dist/core/websocket/ws.js +0 -452
- package/dist/serialization/resources/commons/types/InboxItemDuplicateKnowledgeBase.d.ts +0 -17
- package/dist/serialization/resources/commons/types/InboxItemDuplicateKnowledgeBase.js +0 -50
- package/dist/serialization/resources/commons/types/InboxItemFixDeactivateKnowledgeBase.d.ts +0 -14
- package/dist/serialization/resources/commons/types/InboxItemKnowledgeBaseAlert.d.ts +0 -16
- package/dist/serialization/resources/inbox/types/BaseInboxSearchRequest.d.ts +0 -13
- package/dist/serialization/resources/realtime/types/ControlEvent.d.ts +0 -15
- package/dist/serialization/resources/realtime/types/HangUpPublishEvent.d.ts +0 -12
- package/dist/serialization/resources/realtime/types/HangUpPublishEvent.js +0 -43
- package/dist/serialization/resources/realtime/types/PublishEvent.d.ts +0 -18
- package/dist/serialization/resources/realtime/types/SubscribeEvent.d.ts +0 -27
- package/dist/serialization/resources/realtime/types/index.d.ts +0 -8
- package/dist/serialization/resources/realtime/types/index.js +0 -24
- package/serialization/resources/commons/types/BotMessageStatus.js +0 -41
- package/serialization/resources/commons/types/InboxItemDuplicateKnowledgeBase.d.ts +0 -17
- package/serialization/resources/commons/types/InboxItemDuplicateKnowledgeBase.js +0 -50
- package/serialization/resources/commons/types/InboxItemFixDeactivateKnowledgeBase.d.ts +0 -14
- package/serialization/resources/commons/types/InboxItemKnowledgeBaseAlert.d.ts +0 -16
- package/serialization/resources/commons/types/InboxItemKnowledgeBaseAlert.js +0 -49
- package/serialization/resources/commons/types/UserMessageAttachment.d.ts +0 -12
- package/serialization/resources/commons/types/UserMessageAttachment.js +0 -43
- package/serialization/resources/inbox/types/BaseInboxSearchRequest.d.ts +0 -13
- package/serialization/resources/inbox/types/BaseInboxSearchRequest.js +0 -44
- package/serialization/resources/realtime/types/AudioPublishEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/AudioPublishEvent.js +0 -43
- package/serialization/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/AudioSubscribeEvent.js +0 -43
- package/serialization/resources/realtime/types/ControlEvent.d.ts +0 -15
- package/serialization/resources/realtime/types/HangUpPublishEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/HangUpPublishEvent.js +0 -43
- package/serialization/resources/realtime/types/PublishEvent.d.ts +0 -18
- package/serialization/resources/realtime/types/SubscribeEvent.d.ts +0 -27
- package/serialization/resources/realtime/types/index.d.ts +0 -8
- package/serialization/resources/realtime/types/index.js +0 -24
- /package/api/resources/{commons/types/InboxItemDuplicateKnowledgeBase.js → actions/client/requests/ActionGetRequest.js} +0 -0
- /package/api/resources/{realtime/client → actions/client/requests}/index.js +0 -0
- /package/api/resources/{commons/types/InboxItemFixDeactivateKnowledgeBase.js → actions/types/ActionFilter.js} +0 -0
- /package/api/resources/{commons/types/InboxItemKnowledgeBaseAlert.js → actions/types/ActionPatchRequest.js} +0 -0
- /package/api/resources/{commons/types/KnowledgeBaseInformation.js → actions/types/ActionsResponse.js} +0 -0
- /package/api/resources/{commons/types/UserMessageAttachment.js → actions/types/ActionsSearchRequest.js} +0 -0
- /package/api/resources/{conversation/types/Attachment.js → agents/types/AgentPatchRequest.js} +0 -0
- /package/api/resources/{conversation/types/GenerateObjectRequest.js → agents/types/CreateAgentRequest.js} +0 -0
- /package/api/resources/{realtime → assets}/client/index.d.ts +0 -0
- /package/{dist/api/resources/realtime → api/resources/assets}/client/index.js +0 -0
- /package/api/resources/{realtime → assets}/index.d.ts +0 -0
- /package/api/resources/{realtime → assets}/index.js +0 -0
- /package/api/resources/{inbox/types/ApplyInboxItemFixRequest.js → assets/types/CommitAssetUploadRequest.js} +0 -0
- /package/api/resources/{inbox/types/BaseInboxSearchRequest.js → assets/types/InitiateAssetUploadRequest.js} +0 -0
- /package/api/resources/{realtime/types/AudioPublishEvent.js → assets/types/InitiateAssetUploadResponse.js} +0 -0
- /package/api/resources/{realtime/types/AudioSubscribeEvent.js → commons/types/AttachmentRequest.js} +0 -0
- /package/api/resources/{realtime/types/ControlEvent.js → commons/types/AttachmentResponse.js} +0 -0
- /package/api/resources/{realtime/types/HangUpPublishEvent.js → commons/types/BaseAttachment.js} +0 -0
- /package/api/resources/{realtime/types/MessageBase.js → commons/types/BotLogic.js} +0 -0
- /package/api/resources/{realtime/types/PublishEvent.js → commons/types/BotLogicActionExecutedDetail.js} +0 -0
- /package/api/resources/{realtime/types/SubscribeEvent.js → commons/types/BotLogicActionItem.js} +0 -0
- /package/{dist/api/resources/commons/types/InboxItemDuplicateKnowledgeBase.js → api/resources/commons/types/BotLogicActionReviewedDetail.js} +0 -0
- /package/{dist/api/resources/commons/types/InboxItemFixDeactivateKnowledgeBase.js → api/resources/commons/types/BotLogicFormSubmissionItem.js} +0 -0
- /package/{dist/api/resources/commons/types/InboxItemKnowledgeBaseAlert.js → api/resources/commons/types/BotLogicItem.js} +0 -0
- /package/{dist/api/resources/commons/types/KnowledgeBaseInformation.js → api/resources/commons/types/BotLogicKnowledgeDetail.js} +0 -0
- /package/{dist/api/resources/commons/types/UserMessageAttachment.js → api/resources/commons/types/BotLogicKnowledgeItem.js} +0 -0
- /package/{dist/api/resources/conversation/types/Attachment.js → api/resources/commons/types/BotLogicSafetyItem.js} +0 -0
- /package/{dist/api/resources/conversation/types/GenerateObjectRequest.js → api/resources/commons/types/BotLogicSegmentsItem.js} +0 -0
- /package/{dist/api/resources/inbox/types/ApplyInboxItemFixRequest.js → api/resources/commons/types/BotLogicUserItem.js} +0 -0
- /package/{dist/api/resources/inbox/types/BaseInboxSearchRequest.js → api/resources/conversation/types/AskObjectRequest.js} +0 -0
- /package/{dist/api/resources/realtime/types/AudioPublishEvent.js → api/resources/conversation/types/ConversationPatchRequest.js} +0 -0
- /package/{dist/api/resources/realtime/types/AudioSubscribeEvent.js → api/resources/conversation/types/DeliverConversationMessageRequest.js} +0 -0
- /package/{dist/api/resources/realtime/types/ControlEvent.js → api/resources/conversation/types/DeliverMessageRequest.js} +0 -0
- /package/{dist/api/resources/realtime/types/HangUpPublishEvent.js → api/resources/conversation/types/DeliverMessageResponse.js} +0 -0
- /package/{dist/api/resources/realtime/types/MessageBase.js → api/resources/conversation/types/DeliverUserMessageRequest.js} +0 -0
- /package/{dist/api/resources/realtime/types/PublishEvent.js → api/resources/conversation/types/ObjectStreamResponse.js} +0 -0
- /package/{dist/api/resources/realtime/types/SubscribeEvent.js → api/resources/inbox/types/ApplyFixesRequest.js} +0 -0
- /package/{dist/api/resources/realtime → api/resources/segments}/index.d.ts +0 -0
- /package/{dist/api/resources/realtime → api/resources/segments}/index.js +0 -0
- /package/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/index.js +0 -0
- /package/dist/api/resources/{realtime → assets}/client/index.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.js +0 -0
- /package/dist/serialization/resources/{realtime → assets}/index.d.ts +0 -0
- /package/dist/serialization/resources/{realtime → assets}/index.js +0 -0
- /package/{serialization/resources/realtime → dist/serialization/resources/segments}/index.d.ts +0 -0
- /package/{serialization/resources/realtime → dist/serialization/resources/segments}/index.js +0 -0
|
@@ -44,16 +44,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
48
|
exports.Conversation = void 0;
|
|
52
49
|
const environments = __importStar(require("../../../../environments"));
|
|
53
50
|
const core = __importStar(require("../../../../core"));
|
|
54
51
|
const MavenAGI = __importStar(require("../../../index"));
|
|
52
|
+
const headers_1 = require("../../../../core/headers");
|
|
55
53
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
56
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
57
54
|
const errors = __importStar(require("../../../../errors/index"));
|
|
58
55
|
class Conversation {
|
|
59
56
|
constructor(_options) {
|
|
@@ -82,33 +79,40 @@ class Conversation {
|
|
|
82
79
|
* referenceId: "referenceId"
|
|
83
80
|
* },
|
|
84
81
|
* messages: [{
|
|
82
|
+
* conversationMessageId: {
|
|
83
|
+
* referenceId: "referenceId"
|
|
84
|
+
* },
|
|
85
85
|
* userId: {
|
|
86
86
|
* referenceId: "referenceId"
|
|
87
87
|
* },
|
|
88
88
|
* text: "text",
|
|
89
|
-
* userMessageType: "USER"
|
|
89
|
+
* userMessageType: "USER"
|
|
90
|
+
* }, {
|
|
90
91
|
* conversationMessageId: {
|
|
91
92
|
* referenceId: "referenceId"
|
|
92
|
-
* }
|
|
93
|
-
* }, {
|
|
93
|
+
* },
|
|
94
94
|
* userId: {
|
|
95
95
|
* referenceId: "referenceId"
|
|
96
96
|
* },
|
|
97
97
|
* text: "text",
|
|
98
|
-
* userMessageType: "USER"
|
|
99
|
-
* conversationMessageId: {
|
|
100
|
-
* referenceId: "referenceId"
|
|
101
|
-
* }
|
|
98
|
+
* userMessageType: "USER"
|
|
102
99
|
* }]
|
|
103
100
|
* })
|
|
104
101
|
*/
|
|
105
102
|
initialize(request, requestOptions) {
|
|
103
|
+
return core.HttpResponsePromise.fromPromise(this.__initialize(request, requestOptions));
|
|
104
|
+
}
|
|
105
|
+
__initialize(request, requestOptions) {
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
var _a, _b, _c;
|
|
107
|
+
var _a, _b, _c, _d;
|
|
108
108
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
109
|
-
url:
|
|
109
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/conversations"),
|
|
110
110
|
method: "POST",
|
|
111
|
-
headers:
|
|
111
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
112
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
113
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
114
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
115
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
112
116
|
contentType: "application/json",
|
|
113
117
|
requestType: "json",
|
|
114
118
|
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -117,12 +121,15 @@ class Conversation {
|
|
|
117
121
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
118
122
|
});
|
|
119
123
|
if (_response.ok) {
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
return {
|
|
125
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
126
|
+
unrecognizedObjectKeys: "passthrough",
|
|
127
|
+
allowUnrecognizedUnionMembers: true,
|
|
128
|
+
allowUnrecognizedEnumValues: true,
|
|
129
|
+
breadcrumbsPrefix: ["response"],
|
|
130
|
+
}),
|
|
131
|
+
rawResponse: _response.rawResponse,
|
|
132
|
+
};
|
|
126
133
|
}
|
|
127
134
|
if (_response.error.reason === "status-code") {
|
|
128
135
|
switch (_response.error.statusCode) {
|
|
@@ -132,25 +139,26 @@ class Conversation {
|
|
|
132
139
|
allowUnrecognizedUnionMembers: true,
|
|
133
140
|
allowUnrecognizedEnumValues: true,
|
|
134
141
|
breadcrumbsPrefix: ["response"],
|
|
135
|
-
}));
|
|
142
|
+
}), _response.rawResponse);
|
|
136
143
|
case 400:
|
|
137
144
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
138
145
|
unrecognizedObjectKeys: "passthrough",
|
|
139
146
|
allowUnrecognizedUnionMembers: true,
|
|
140
147
|
allowUnrecognizedEnumValues: true,
|
|
141
148
|
breadcrumbsPrefix: ["response"],
|
|
142
|
-
}));
|
|
149
|
+
}), _response.rawResponse);
|
|
143
150
|
case 500:
|
|
144
151
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
145
152
|
unrecognizedObjectKeys: "passthrough",
|
|
146
153
|
allowUnrecognizedUnionMembers: true,
|
|
147
154
|
allowUnrecognizedEnumValues: true,
|
|
148
155
|
breadcrumbsPrefix: ["response"],
|
|
149
|
-
}));
|
|
156
|
+
}), _response.rawResponse);
|
|
150
157
|
default:
|
|
151
158
|
throw new errors.MavenAGIError({
|
|
152
159
|
statusCode: _response.error.statusCode,
|
|
153
160
|
body: _response.error.body,
|
|
161
|
+
rawResponse: _response.rawResponse,
|
|
154
162
|
});
|
|
155
163
|
}
|
|
156
164
|
}
|
|
@@ -159,12 +167,113 @@ class Conversation {
|
|
|
159
167
|
throw new errors.MavenAGIError({
|
|
160
168
|
statusCode: _response.error.statusCode,
|
|
161
169
|
body: _response.error.rawBody,
|
|
170
|
+
rawResponse: _response.rawResponse,
|
|
162
171
|
});
|
|
163
172
|
case "timeout":
|
|
164
173
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations.");
|
|
165
174
|
case "unknown":
|
|
166
175
|
throw new errors.MavenAGIError({
|
|
167
176
|
message: _response.error.errorMessage,
|
|
177
|
+
rawResponse: _response.rawResponse,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Update mutable conversation fields.
|
|
184
|
+
*
|
|
185
|
+
* The `appId` field can be provided to update a conversation owned by a different app.
|
|
186
|
+
* All other fields will overwrite the existing value on the conversation only if provided.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} conversationId - The ID of the conversation to patch
|
|
189
|
+
* @param {MavenAGI.ConversationPatchRequest} request
|
|
190
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
191
|
+
*
|
|
192
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
193
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
194
|
+
* @throws {@link MavenAGI.ServerError}
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* await client.conversation.patch("conversation-0", {
|
|
198
|
+
* llmEnabled: true
|
|
199
|
+
* })
|
|
200
|
+
*/
|
|
201
|
+
patch(conversationId, request, requestOptions) {
|
|
202
|
+
return core.HttpResponsePromise.fromPromise(this.__patch(conversationId, request, requestOptions));
|
|
203
|
+
}
|
|
204
|
+
__patch(conversationId, request, requestOptions) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
var _a, _b, _c, _d;
|
|
207
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
208
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
209
|
+
method: "PATCH",
|
|
210
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
211
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
212
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
213
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
214
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
215
|
+
contentType: "application/json",
|
|
216
|
+
requestType: "json",
|
|
217
|
+
body: serializers.ConversationPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
218
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
219
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
220
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
221
|
+
});
|
|
222
|
+
if (_response.ok) {
|
|
223
|
+
return {
|
|
224
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
225
|
+
unrecognizedObjectKeys: "passthrough",
|
|
226
|
+
allowUnrecognizedUnionMembers: true,
|
|
227
|
+
allowUnrecognizedEnumValues: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}),
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 404:
|
|
236
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
237
|
+
unrecognizedObjectKeys: "passthrough",
|
|
238
|
+
allowUnrecognizedUnionMembers: true,
|
|
239
|
+
allowUnrecognizedEnumValues: true,
|
|
240
|
+
breadcrumbsPrefix: ["response"],
|
|
241
|
+
}), _response.rawResponse);
|
|
242
|
+
case 400:
|
|
243
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
244
|
+
unrecognizedObjectKeys: "passthrough",
|
|
245
|
+
allowUnrecognizedUnionMembers: true,
|
|
246
|
+
allowUnrecognizedEnumValues: true,
|
|
247
|
+
breadcrumbsPrefix: ["response"],
|
|
248
|
+
}), _response.rawResponse);
|
|
249
|
+
case 500:
|
|
250
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
251
|
+
unrecognizedObjectKeys: "passthrough",
|
|
252
|
+
allowUnrecognizedUnionMembers: true,
|
|
253
|
+
allowUnrecognizedEnumValues: true,
|
|
254
|
+
breadcrumbsPrefix: ["response"],
|
|
255
|
+
}), _response.rawResponse);
|
|
256
|
+
default:
|
|
257
|
+
throw new errors.MavenAGIError({
|
|
258
|
+
statusCode: _response.error.statusCode,
|
|
259
|
+
body: _response.error.body,
|
|
260
|
+
rawResponse: _response.rawResponse,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
switch (_response.error.reason) {
|
|
265
|
+
case "non-json":
|
|
266
|
+
throw new errors.MavenAGIError({
|
|
267
|
+
statusCode: _response.error.statusCode,
|
|
268
|
+
body: _response.error.rawBody,
|
|
269
|
+
rawResponse: _response.rawResponse,
|
|
270
|
+
});
|
|
271
|
+
case "timeout":
|
|
272
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling PATCH /v1/conversations/{conversationId}.");
|
|
273
|
+
case "unknown":
|
|
274
|
+
throw new errors.MavenAGIError({
|
|
275
|
+
message: _response.error.errorMessage,
|
|
276
|
+
rawResponse: _response.rawResponse,
|
|
168
277
|
});
|
|
169
278
|
}
|
|
170
279
|
});
|
|
@@ -183,32 +292,40 @@ class Conversation {
|
|
|
183
292
|
* @example
|
|
184
293
|
* await client.conversation.get("conversationId")
|
|
185
294
|
*/
|
|
186
|
-
get(
|
|
295
|
+
get(conversationId, request = {}, requestOptions) {
|
|
296
|
+
return core.HttpResponsePromise.fromPromise(this.__get(conversationId, request, requestOptions));
|
|
297
|
+
}
|
|
298
|
+
__get(conversationId_1) {
|
|
187
299
|
return __awaiter(this, arguments, void 0, function* (conversationId, request = {}, requestOptions) {
|
|
188
|
-
var _a, _b, _c;
|
|
300
|
+
var _a, _b, _c, _d;
|
|
189
301
|
const { appId } = request;
|
|
190
302
|
const _queryParams = {};
|
|
191
303
|
if (appId != null) {
|
|
192
304
|
_queryParams["appId"] = appId;
|
|
193
305
|
}
|
|
194
306
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
195
|
-
url:
|
|
307
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
196
308
|
method: "GET",
|
|
197
|
-
headers:
|
|
198
|
-
|
|
309
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
310
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
311
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
312
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
313
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
199
314
|
queryParameters: _queryParams,
|
|
200
|
-
requestType: "json",
|
|
201
315
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
202
316
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
203
317
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
204
318
|
});
|
|
205
319
|
if (_response.ok) {
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
320
|
+
return {
|
|
321
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
322
|
+
unrecognizedObjectKeys: "passthrough",
|
|
323
|
+
allowUnrecognizedUnionMembers: true,
|
|
324
|
+
allowUnrecognizedEnumValues: true,
|
|
325
|
+
breadcrumbsPrefix: ["response"],
|
|
326
|
+
}),
|
|
327
|
+
rawResponse: _response.rawResponse,
|
|
328
|
+
};
|
|
212
329
|
}
|
|
213
330
|
if (_response.error.reason === "status-code") {
|
|
214
331
|
switch (_response.error.statusCode) {
|
|
@@ -218,25 +335,26 @@ class Conversation {
|
|
|
218
335
|
allowUnrecognizedUnionMembers: true,
|
|
219
336
|
allowUnrecognizedEnumValues: true,
|
|
220
337
|
breadcrumbsPrefix: ["response"],
|
|
221
|
-
}));
|
|
338
|
+
}), _response.rawResponse);
|
|
222
339
|
case 400:
|
|
223
340
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
224
341
|
unrecognizedObjectKeys: "passthrough",
|
|
225
342
|
allowUnrecognizedUnionMembers: true,
|
|
226
343
|
allowUnrecognizedEnumValues: true,
|
|
227
344
|
breadcrumbsPrefix: ["response"],
|
|
228
|
-
}));
|
|
345
|
+
}), _response.rawResponse);
|
|
229
346
|
case 500:
|
|
230
347
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
231
348
|
unrecognizedObjectKeys: "passthrough",
|
|
232
349
|
allowUnrecognizedUnionMembers: true,
|
|
233
350
|
allowUnrecognizedEnumValues: true,
|
|
234
351
|
breadcrumbsPrefix: ["response"],
|
|
235
|
-
}));
|
|
352
|
+
}), _response.rawResponse);
|
|
236
353
|
default:
|
|
237
354
|
throw new errors.MavenAGIError({
|
|
238
355
|
statusCode: _response.error.statusCode,
|
|
239
356
|
body: _response.error.body,
|
|
357
|
+
rawResponse: _response.rawResponse,
|
|
240
358
|
});
|
|
241
359
|
}
|
|
242
360
|
}
|
|
@@ -245,12 +363,14 @@ class Conversation {
|
|
|
245
363
|
throw new errors.MavenAGIError({
|
|
246
364
|
statusCode: _response.error.statusCode,
|
|
247
365
|
body: _response.error.rawBody,
|
|
366
|
+
rawResponse: _response.rawResponse,
|
|
248
367
|
});
|
|
249
368
|
case "timeout":
|
|
250
369
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling GET /v1/conversations/{conversationId}.");
|
|
251
370
|
case "unknown":
|
|
252
371
|
throw new errors.MavenAGIError({
|
|
253
372
|
message: _response.error.errorMessage,
|
|
373
|
+
rawResponse: _response.rawResponse,
|
|
254
374
|
});
|
|
255
375
|
}
|
|
256
376
|
});
|
|
@@ -278,8 +398,11 @@ class Conversation {
|
|
|
278
398
|
* })
|
|
279
399
|
*/
|
|
280
400
|
delete(conversationId, request, requestOptions) {
|
|
401
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(conversationId, request, requestOptions));
|
|
402
|
+
}
|
|
403
|
+
__delete(conversationId, request, requestOptions) {
|
|
281
404
|
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
var _a, _b, _c;
|
|
405
|
+
var _a, _b, _c, _d;
|
|
283
406
|
const { appId, reason } = request;
|
|
284
407
|
const _queryParams = {};
|
|
285
408
|
if (appId != null) {
|
|
@@ -287,18 +410,20 @@ class Conversation {
|
|
|
287
410
|
}
|
|
288
411
|
_queryParams["reason"] = reason;
|
|
289
412
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
290
|
-
url:
|
|
413
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
|
|
291
414
|
method: "DELETE",
|
|
292
|
-
headers:
|
|
293
|
-
|
|
415
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
416
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
417
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
418
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
419
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
294
420
|
queryParameters: _queryParams,
|
|
295
|
-
requestType: "json",
|
|
296
421
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
297
422
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
298
423
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
299
424
|
});
|
|
300
425
|
if (_response.ok) {
|
|
301
|
-
return;
|
|
426
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
302
427
|
}
|
|
303
428
|
if (_response.error.reason === "status-code") {
|
|
304
429
|
switch (_response.error.statusCode) {
|
|
@@ -308,25 +433,26 @@ class Conversation {
|
|
|
308
433
|
allowUnrecognizedUnionMembers: true,
|
|
309
434
|
allowUnrecognizedEnumValues: true,
|
|
310
435
|
breadcrumbsPrefix: ["response"],
|
|
311
|
-
}));
|
|
436
|
+
}), _response.rawResponse);
|
|
312
437
|
case 400:
|
|
313
438
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
314
439
|
unrecognizedObjectKeys: "passthrough",
|
|
315
440
|
allowUnrecognizedUnionMembers: true,
|
|
316
441
|
allowUnrecognizedEnumValues: true,
|
|
317
442
|
breadcrumbsPrefix: ["response"],
|
|
318
|
-
}));
|
|
443
|
+
}), _response.rawResponse);
|
|
319
444
|
case 500:
|
|
320
445
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
321
446
|
unrecognizedObjectKeys: "passthrough",
|
|
322
447
|
allowUnrecognizedUnionMembers: true,
|
|
323
448
|
allowUnrecognizedEnumValues: true,
|
|
324
449
|
breadcrumbsPrefix: ["response"],
|
|
325
|
-
}));
|
|
450
|
+
}), _response.rawResponse);
|
|
326
451
|
default:
|
|
327
452
|
throw new errors.MavenAGIError({
|
|
328
453
|
statusCode: _response.error.statusCode,
|
|
329
454
|
body: _response.error.body,
|
|
455
|
+
rawResponse: _response.rawResponse,
|
|
330
456
|
});
|
|
331
457
|
}
|
|
332
458
|
}
|
|
@@ -335,12 +461,14 @@ class Conversation {
|
|
|
335
461
|
throw new errors.MavenAGIError({
|
|
336
462
|
statusCode: _response.error.statusCode,
|
|
337
463
|
body: _response.error.rawBody,
|
|
464
|
+
rawResponse: _response.rawResponse,
|
|
338
465
|
});
|
|
339
466
|
case "timeout":
|
|
340
467
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling DELETE /v1/conversations/{conversationId}.");
|
|
341
468
|
case "unknown":
|
|
342
469
|
throw new errors.MavenAGIError({
|
|
343
470
|
message: _response.error.errorMessage,
|
|
471
|
+
rawResponse: _response.rawResponse,
|
|
344
472
|
});
|
|
345
473
|
}
|
|
346
474
|
});
|
|
@@ -358,32 +486,39 @@ class Conversation {
|
|
|
358
486
|
*
|
|
359
487
|
* @example
|
|
360
488
|
* await client.conversation.appendNewMessages("conversationId", [{
|
|
489
|
+
* conversationMessageId: {
|
|
490
|
+
* referenceId: "referenceId"
|
|
491
|
+
* },
|
|
361
492
|
* userId: {
|
|
362
493
|
* referenceId: "referenceId"
|
|
363
494
|
* },
|
|
364
495
|
* text: "text",
|
|
365
|
-
* userMessageType: "USER"
|
|
496
|
+
* userMessageType: "USER"
|
|
497
|
+
* }, {
|
|
366
498
|
* conversationMessageId: {
|
|
367
499
|
* referenceId: "referenceId"
|
|
368
|
-
* }
|
|
369
|
-
* }, {
|
|
500
|
+
* },
|
|
370
501
|
* userId: {
|
|
371
502
|
* referenceId: "referenceId"
|
|
372
503
|
* },
|
|
373
504
|
* text: "text",
|
|
374
|
-
* userMessageType: "USER"
|
|
375
|
-
* conversationMessageId: {
|
|
376
|
-
* referenceId: "referenceId"
|
|
377
|
-
* }
|
|
505
|
+
* userMessageType: "USER"
|
|
378
506
|
* }])
|
|
379
507
|
*/
|
|
380
508
|
appendNewMessages(conversationId, request, requestOptions) {
|
|
509
|
+
return core.HttpResponsePromise.fromPromise(this.__appendNewMessages(conversationId, request, requestOptions));
|
|
510
|
+
}
|
|
511
|
+
__appendNewMessages(conversationId, request, requestOptions) {
|
|
381
512
|
return __awaiter(this, void 0, void 0, function* () {
|
|
382
|
-
var _a, _b, _c;
|
|
513
|
+
var _a, _b, _c, _d;
|
|
383
514
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
384
|
-
url:
|
|
515
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/messages`),
|
|
385
516
|
method: "POST",
|
|
386
|
-
headers:
|
|
517
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
518
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
519
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
520
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
521
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
387
522
|
contentType: "application/json",
|
|
388
523
|
requestType: "json",
|
|
389
524
|
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
@@ -394,12 +529,15 @@ class Conversation {
|
|
|
394
529
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
395
530
|
});
|
|
396
531
|
if (_response.ok) {
|
|
397
|
-
return
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
532
|
+
return {
|
|
533
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
534
|
+
unrecognizedObjectKeys: "passthrough",
|
|
535
|
+
allowUnrecognizedUnionMembers: true,
|
|
536
|
+
allowUnrecognizedEnumValues: true,
|
|
537
|
+
breadcrumbsPrefix: ["response"],
|
|
538
|
+
}),
|
|
539
|
+
rawResponse: _response.rawResponse,
|
|
540
|
+
};
|
|
403
541
|
}
|
|
404
542
|
if (_response.error.reason === "status-code") {
|
|
405
543
|
switch (_response.error.statusCode) {
|
|
@@ -409,25 +547,26 @@ class Conversation {
|
|
|
409
547
|
allowUnrecognizedUnionMembers: true,
|
|
410
548
|
allowUnrecognizedEnumValues: true,
|
|
411
549
|
breadcrumbsPrefix: ["response"],
|
|
412
|
-
}));
|
|
550
|
+
}), _response.rawResponse);
|
|
413
551
|
case 400:
|
|
414
552
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
415
553
|
unrecognizedObjectKeys: "passthrough",
|
|
416
554
|
allowUnrecognizedUnionMembers: true,
|
|
417
555
|
allowUnrecognizedEnumValues: true,
|
|
418
556
|
breadcrumbsPrefix: ["response"],
|
|
419
|
-
}));
|
|
557
|
+
}), _response.rawResponse);
|
|
420
558
|
case 500:
|
|
421
559
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
422
560
|
unrecognizedObjectKeys: "passthrough",
|
|
423
561
|
allowUnrecognizedUnionMembers: true,
|
|
424
562
|
allowUnrecognizedEnumValues: true,
|
|
425
563
|
breadcrumbsPrefix: ["response"],
|
|
426
|
-
}));
|
|
564
|
+
}), _response.rawResponse);
|
|
427
565
|
default:
|
|
428
566
|
throw new errors.MavenAGIError({
|
|
429
567
|
statusCode: _response.error.statusCode,
|
|
430
568
|
body: _response.error.body,
|
|
569
|
+
rawResponse: _response.rawResponse,
|
|
431
570
|
});
|
|
432
571
|
}
|
|
433
572
|
}
|
|
@@ -436,12 +575,14 @@ class Conversation {
|
|
|
436
575
|
throw new errors.MavenAGIError({
|
|
437
576
|
statusCode: _response.error.statusCode,
|
|
438
577
|
body: _response.error.rawBody,
|
|
578
|
+
rawResponse: _response.rawResponse,
|
|
439
579
|
});
|
|
440
580
|
case "timeout":
|
|
441
581
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/messages.");
|
|
442
582
|
case "unknown":
|
|
443
583
|
throw new errors.MavenAGIError({
|
|
444
584
|
message: _response.error.errorMessage,
|
|
585
|
+
rawResponse: _response.rawResponse,
|
|
445
586
|
});
|
|
446
587
|
}
|
|
447
588
|
});
|
|
@@ -486,12 +627,19 @@ class Conversation {
|
|
|
486
627
|
* })
|
|
487
628
|
*/
|
|
488
629
|
ask(conversationId, request, requestOptions) {
|
|
630
|
+
return core.HttpResponsePromise.fromPromise(this.__ask(conversationId, request, requestOptions));
|
|
631
|
+
}
|
|
632
|
+
__ask(conversationId, request, requestOptions) {
|
|
489
633
|
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
-
var _a, _b, _c;
|
|
634
|
+
var _a, _b, _c, _d;
|
|
491
635
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
492
|
-
url:
|
|
636
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask`),
|
|
493
637
|
method: "POST",
|
|
494
|
-
headers:
|
|
638
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
639
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
640
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
641
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
642
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
495
643
|
contentType: "application/json",
|
|
496
644
|
requestType: "json",
|
|
497
645
|
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -500,12 +648,15 @@ class Conversation {
|
|
|
500
648
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
501
649
|
});
|
|
502
650
|
if (_response.ok) {
|
|
503
|
-
return
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
651
|
+
return {
|
|
652
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
653
|
+
unrecognizedObjectKeys: "passthrough",
|
|
654
|
+
allowUnrecognizedUnionMembers: true,
|
|
655
|
+
allowUnrecognizedEnumValues: true,
|
|
656
|
+
breadcrumbsPrefix: ["response"],
|
|
657
|
+
}),
|
|
658
|
+
rawResponse: _response.rawResponse,
|
|
659
|
+
};
|
|
509
660
|
}
|
|
510
661
|
if (_response.error.reason === "status-code") {
|
|
511
662
|
switch (_response.error.statusCode) {
|
|
@@ -515,25 +666,26 @@ class Conversation {
|
|
|
515
666
|
allowUnrecognizedUnionMembers: true,
|
|
516
667
|
allowUnrecognizedEnumValues: true,
|
|
517
668
|
breadcrumbsPrefix: ["response"],
|
|
518
|
-
}));
|
|
669
|
+
}), _response.rawResponse);
|
|
519
670
|
case 400:
|
|
520
671
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
521
672
|
unrecognizedObjectKeys: "passthrough",
|
|
522
673
|
allowUnrecognizedUnionMembers: true,
|
|
523
674
|
allowUnrecognizedEnumValues: true,
|
|
524
675
|
breadcrumbsPrefix: ["response"],
|
|
525
|
-
}));
|
|
676
|
+
}), _response.rawResponse);
|
|
526
677
|
case 500:
|
|
527
678
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
528
679
|
unrecognizedObjectKeys: "passthrough",
|
|
529
680
|
allowUnrecognizedUnionMembers: true,
|
|
530
681
|
allowUnrecognizedEnumValues: true,
|
|
531
682
|
breadcrumbsPrefix: ["response"],
|
|
532
|
-
}));
|
|
683
|
+
}), _response.rawResponse);
|
|
533
684
|
default:
|
|
534
685
|
throw new errors.MavenAGIError({
|
|
535
686
|
statusCode: _response.error.statusCode,
|
|
536
687
|
body: _response.error.body,
|
|
688
|
+
rawResponse: _response.rawResponse,
|
|
537
689
|
});
|
|
538
690
|
}
|
|
539
691
|
}
|
|
@@ -542,12 +694,14 @@ class Conversation {
|
|
|
542
694
|
throw new errors.MavenAGIError({
|
|
543
695
|
statusCode: _response.error.statusCode,
|
|
544
696
|
body: _response.error.rawBody,
|
|
697
|
+
rawResponse: _response.rawResponse,
|
|
545
698
|
});
|
|
546
699
|
case "timeout":
|
|
547
700
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/ask.");
|
|
548
701
|
case "unknown":
|
|
549
702
|
throw new errors.MavenAGIError({
|
|
550
703
|
message: _response.error.errorMessage,
|
|
704
|
+
rawResponse: _response.rawResponse,
|
|
551
705
|
});
|
|
552
706
|
}
|
|
553
707
|
});
|
|
@@ -568,12 +722,19 @@ class Conversation {
|
|
|
568
722
|
* - The API does not currently expose metadata indicating whether a response or message is incomplete. This will be addressed in a future update.
|
|
569
723
|
*/
|
|
570
724
|
askStream(conversationId, request, requestOptions) {
|
|
725
|
+
return core.HttpResponsePromise.fromPromise(this.__askStream(conversationId, request, requestOptions));
|
|
726
|
+
}
|
|
727
|
+
__askStream(conversationId, request, requestOptions) {
|
|
571
728
|
return __awaiter(this, void 0, void 0, function* () {
|
|
572
|
-
var _a, _b, _c;
|
|
729
|
+
var _a, _b, _c, _d;
|
|
573
730
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
574
|
-
url:
|
|
731
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask_stream`),
|
|
575
732
|
method: "POST",
|
|
576
|
-
headers:
|
|
733
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
734
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
735
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
736
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
737
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
577
738
|
contentType: "application/json",
|
|
578
739
|
requestType: "json",
|
|
579
740
|
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -583,22 +744,25 @@ class Conversation {
|
|
|
583
744
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
584
745
|
});
|
|
585
746
|
if (_response.ok) {
|
|
586
|
-
return
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
747
|
+
return {
|
|
748
|
+
data: new core.Stream({
|
|
749
|
+
stream: _response.body,
|
|
750
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
751
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
752
|
+
unrecognizedObjectKeys: "passthrough",
|
|
753
|
+
allowUnrecognizedUnionMembers: true,
|
|
754
|
+
allowUnrecognizedEnumValues: true,
|
|
755
|
+
breadcrumbsPrefix: ["response"],
|
|
756
|
+
});
|
|
757
|
+
}),
|
|
758
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
759
|
+
eventShape: {
|
|
760
|
+
type: "sse",
|
|
761
|
+
streamTerminator: "[DONE]",
|
|
762
|
+
},
|
|
595
763
|
}),
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
type: "sse",
|
|
599
|
-
streamTerminator: "[DONE]",
|
|
600
|
-
},
|
|
601
|
-
});
|
|
764
|
+
rawResponse: _response.rawResponse,
|
|
765
|
+
};
|
|
602
766
|
}
|
|
603
767
|
if (_response.error.reason === "status-code") {
|
|
604
768
|
switch (_response.error.statusCode) {
|
|
@@ -608,25 +772,26 @@ class Conversation {
|
|
|
608
772
|
allowUnrecognizedUnionMembers: true,
|
|
609
773
|
allowUnrecognizedEnumValues: true,
|
|
610
774
|
breadcrumbsPrefix: ["response"],
|
|
611
|
-
}));
|
|
775
|
+
}), _response.rawResponse);
|
|
612
776
|
case 400:
|
|
613
777
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
614
778
|
unrecognizedObjectKeys: "passthrough",
|
|
615
779
|
allowUnrecognizedUnionMembers: true,
|
|
616
780
|
allowUnrecognizedEnumValues: true,
|
|
617
781
|
breadcrumbsPrefix: ["response"],
|
|
618
|
-
}));
|
|
782
|
+
}), _response.rawResponse);
|
|
619
783
|
case 500:
|
|
620
784
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
621
785
|
unrecognizedObjectKeys: "passthrough",
|
|
622
786
|
allowUnrecognizedUnionMembers: true,
|
|
623
787
|
allowUnrecognizedEnumValues: true,
|
|
624
788
|
breadcrumbsPrefix: ["response"],
|
|
625
|
-
}));
|
|
789
|
+
}), _response.rawResponse);
|
|
626
790
|
default:
|
|
627
791
|
throw new errors.MavenAGIError({
|
|
628
792
|
statusCode: _response.error.statusCode,
|
|
629
793
|
body: _response.error.body,
|
|
794
|
+
rawResponse: _response.rawResponse,
|
|
630
795
|
});
|
|
631
796
|
}
|
|
632
797
|
}
|
|
@@ -635,12 +800,14 @@ class Conversation {
|
|
|
635
800
|
throw new errors.MavenAGIError({
|
|
636
801
|
statusCode: _response.error.statusCode,
|
|
637
802
|
body: _response.error.rawBody,
|
|
803
|
+
rawResponse: _response.rawResponse,
|
|
638
804
|
});
|
|
639
805
|
case "timeout":
|
|
640
806
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/ask_stream.");
|
|
641
807
|
case "unknown":
|
|
642
808
|
throw new errors.MavenAGIError({
|
|
643
809
|
message: _response.error.errorMessage,
|
|
810
|
+
rawResponse: _response.rawResponse,
|
|
644
811
|
});
|
|
645
812
|
}
|
|
646
813
|
});
|
|
@@ -666,12 +833,19 @@ class Conversation {
|
|
|
666
833
|
* })
|
|
667
834
|
*/
|
|
668
835
|
generateMavenSuggestions(conversationId, request, requestOptions) {
|
|
836
|
+
return core.HttpResponsePromise.fromPromise(this.__generateMavenSuggestions(conversationId, request, requestOptions));
|
|
837
|
+
}
|
|
838
|
+
__generateMavenSuggestions(conversationId, request, requestOptions) {
|
|
669
839
|
return __awaiter(this, void 0, void 0, function* () {
|
|
670
|
-
var _a, _b, _c;
|
|
840
|
+
var _a, _b, _c, _d;
|
|
671
841
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
672
|
-
url:
|
|
842
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/generate_maven_suggestions`),
|
|
673
843
|
method: "POST",
|
|
674
|
-
headers:
|
|
844
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
845
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
846
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
847
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
848
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
675
849
|
contentType: "application/json",
|
|
676
850
|
requestType: "json",
|
|
677
851
|
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -680,12 +854,15 @@ class Conversation {
|
|
|
680
854
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
681
855
|
});
|
|
682
856
|
if (_response.ok) {
|
|
683
|
-
return
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
857
|
+
return {
|
|
858
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
859
|
+
unrecognizedObjectKeys: "passthrough",
|
|
860
|
+
allowUnrecognizedUnionMembers: true,
|
|
861
|
+
allowUnrecognizedEnumValues: true,
|
|
862
|
+
breadcrumbsPrefix: ["response"],
|
|
863
|
+
}),
|
|
864
|
+
rawResponse: _response.rawResponse,
|
|
865
|
+
};
|
|
689
866
|
}
|
|
690
867
|
if (_response.error.reason === "status-code") {
|
|
691
868
|
switch (_response.error.statusCode) {
|
|
@@ -695,25 +872,26 @@ class Conversation {
|
|
|
695
872
|
allowUnrecognizedUnionMembers: true,
|
|
696
873
|
allowUnrecognizedEnumValues: true,
|
|
697
874
|
breadcrumbsPrefix: ["response"],
|
|
698
|
-
}));
|
|
875
|
+
}), _response.rawResponse);
|
|
699
876
|
case 400:
|
|
700
877
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
701
878
|
unrecognizedObjectKeys: "passthrough",
|
|
702
879
|
allowUnrecognizedUnionMembers: true,
|
|
703
880
|
allowUnrecognizedEnumValues: true,
|
|
704
881
|
breadcrumbsPrefix: ["response"],
|
|
705
|
-
}));
|
|
882
|
+
}), _response.rawResponse);
|
|
706
883
|
case 500:
|
|
707
884
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
708
885
|
unrecognizedObjectKeys: "passthrough",
|
|
709
886
|
allowUnrecognizedUnionMembers: true,
|
|
710
887
|
allowUnrecognizedEnumValues: true,
|
|
711
888
|
breadcrumbsPrefix: ["response"],
|
|
712
|
-
}));
|
|
889
|
+
}), _response.rawResponse);
|
|
713
890
|
default:
|
|
714
891
|
throw new errors.MavenAGIError({
|
|
715
892
|
statusCode: _response.error.statusCode,
|
|
716
893
|
body: _response.error.body,
|
|
894
|
+
rawResponse: _response.rawResponse,
|
|
717
895
|
});
|
|
718
896
|
}
|
|
719
897
|
}
|
|
@@ -722,66 +900,75 @@ class Conversation {
|
|
|
722
900
|
throw new errors.MavenAGIError({
|
|
723
901
|
statusCode: _response.error.statusCode,
|
|
724
902
|
body: _response.error.rawBody,
|
|
903
|
+
rawResponse: _response.rawResponse,
|
|
725
904
|
});
|
|
726
905
|
case "timeout":
|
|
727
906
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/generate_maven_suggestions.");
|
|
728
907
|
case "unknown":
|
|
729
908
|
throw new errors.MavenAGIError({
|
|
730
909
|
message: _response.error.errorMessage,
|
|
910
|
+
rawResponse: _response.rawResponse,
|
|
731
911
|
});
|
|
732
912
|
}
|
|
733
913
|
});
|
|
734
914
|
}
|
|
735
915
|
/**
|
|
736
|
-
* Generate a structured object response based on a provided schema and user prompt.
|
|
916
|
+
* Generate a structured object response based on a provided schema and user prompt with a streaming response.
|
|
917
|
+
* The response will be sent as a stream of events containing text, start, and end events.
|
|
918
|
+
* The text portions of stream responses should be concatenated to form the full response text.
|
|
737
919
|
*
|
|
738
920
|
* If the user question and object response already exist, they will be reused and not updated.
|
|
739
921
|
*
|
|
922
|
+
* Concurrency Behavior:
|
|
923
|
+
* - If another API call is made for the same user question while a response is mid-stream, partial answers may be returned.
|
|
924
|
+
* - The second caller will receive a truncated or partial response depending on where the first stream is in its processing. The first caller's stream will remain unaffected and continue delivering the full response.
|
|
925
|
+
*
|
|
740
926
|
* Known Limitations:
|
|
741
927
|
* - Schema enforcement is best-effort and may not guarantee exact conformity.
|
|
742
|
-
* -
|
|
743
|
-
*
|
|
744
|
-
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the object generation request
|
|
745
|
-
* @param {MavenAGI.GenerateObjectRequest} request
|
|
746
|
-
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
747
|
-
*
|
|
748
|
-
* @throws {@link MavenAGI.NotFoundError}
|
|
749
|
-
* @throws {@link MavenAGI.BadRequestError}
|
|
750
|
-
* @throws {@link MavenAGI.ServerError}
|
|
751
|
-
*
|
|
752
|
-
* @example
|
|
753
|
-
* await client.conversation.generateObject("conversationId", {
|
|
754
|
-
* conversationMessageId: {
|
|
755
|
-
* referenceId: "referenceId"
|
|
756
|
-
* },
|
|
757
|
-
* userId: {
|
|
758
|
-
* referenceId: "referenceId"
|
|
759
|
-
* },
|
|
760
|
-
* text: "text",
|
|
761
|
-
* schema: "schema"
|
|
762
|
-
* })
|
|
928
|
+
* - The API does not currently expose metadata indicating whether a response or message is incomplete. This will be addressed in a future update.
|
|
763
929
|
*/
|
|
764
|
-
|
|
930
|
+
askObjectStream(conversationId, request, requestOptions) {
|
|
931
|
+
return core.HttpResponsePromise.fromPromise(this.__askObjectStream(conversationId, request, requestOptions));
|
|
932
|
+
}
|
|
933
|
+
__askObjectStream(conversationId, request, requestOptions) {
|
|
765
934
|
return __awaiter(this, void 0, void 0, function* () {
|
|
766
|
-
var _a, _b, _c;
|
|
935
|
+
var _a, _b, _c, _d;
|
|
767
936
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
768
|
-
url:
|
|
937
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask_object_stream`),
|
|
769
938
|
method: "POST",
|
|
770
|
-
headers:
|
|
939
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
940
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
941
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
942
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
943
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
771
944
|
contentType: "application/json",
|
|
772
945
|
requestType: "json",
|
|
773
|
-
body: serializers.
|
|
946
|
+
body: serializers.AskObjectRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
947
|
+
responseType: "sse",
|
|
774
948
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
775
949
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
776
950
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
777
951
|
});
|
|
778
952
|
if (_response.ok) {
|
|
779
|
-
return
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
953
|
+
return {
|
|
954
|
+
data: new core.Stream({
|
|
955
|
+
stream: _response.body,
|
|
956
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
957
|
+
return serializers.ObjectStreamResponse.parseOrThrow(data, {
|
|
958
|
+
unrecognizedObjectKeys: "passthrough",
|
|
959
|
+
allowUnrecognizedUnionMembers: true,
|
|
960
|
+
allowUnrecognizedEnumValues: true,
|
|
961
|
+
breadcrumbsPrefix: ["response"],
|
|
962
|
+
});
|
|
963
|
+
}),
|
|
964
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
965
|
+
eventShape: {
|
|
966
|
+
type: "sse",
|
|
967
|
+
streamTerminator: "[DONE]",
|
|
968
|
+
},
|
|
969
|
+
}),
|
|
970
|
+
rawResponse: _response.rawResponse,
|
|
971
|
+
};
|
|
785
972
|
}
|
|
786
973
|
if (_response.error.reason === "status-code") {
|
|
787
974
|
switch (_response.error.statusCode) {
|
|
@@ -791,25 +978,26 @@ class Conversation {
|
|
|
791
978
|
allowUnrecognizedUnionMembers: true,
|
|
792
979
|
allowUnrecognizedEnumValues: true,
|
|
793
980
|
breadcrumbsPrefix: ["response"],
|
|
794
|
-
}));
|
|
981
|
+
}), _response.rawResponse);
|
|
795
982
|
case 400:
|
|
796
983
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
797
984
|
unrecognizedObjectKeys: "passthrough",
|
|
798
985
|
allowUnrecognizedUnionMembers: true,
|
|
799
986
|
allowUnrecognizedEnumValues: true,
|
|
800
987
|
breadcrumbsPrefix: ["response"],
|
|
801
|
-
}));
|
|
988
|
+
}), _response.rawResponse);
|
|
802
989
|
case 500:
|
|
803
990
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
804
991
|
unrecognizedObjectKeys: "passthrough",
|
|
805
992
|
allowUnrecognizedUnionMembers: true,
|
|
806
993
|
allowUnrecognizedEnumValues: true,
|
|
807
994
|
breadcrumbsPrefix: ["response"],
|
|
808
|
-
}));
|
|
995
|
+
}), _response.rawResponse);
|
|
809
996
|
default:
|
|
810
997
|
throw new errors.MavenAGIError({
|
|
811
998
|
statusCode: _response.error.statusCode,
|
|
812
999
|
body: _response.error.body,
|
|
1000
|
+
rawResponse: _response.rawResponse,
|
|
813
1001
|
});
|
|
814
1002
|
}
|
|
815
1003
|
}
|
|
@@ -818,12 +1006,14 @@ class Conversation {
|
|
|
818
1006
|
throw new errors.MavenAGIError({
|
|
819
1007
|
statusCode: _response.error.statusCode,
|
|
820
1008
|
body: _response.error.rawBody,
|
|
1009
|
+
rawResponse: _response.rawResponse,
|
|
821
1010
|
});
|
|
822
1011
|
case "timeout":
|
|
823
|
-
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/
|
|
1012
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/ask_object_stream.");
|
|
824
1013
|
case "unknown":
|
|
825
1014
|
throw new errors.MavenAGIError({
|
|
826
1015
|
message: _response.error.errorMessage,
|
|
1016
|
+
rawResponse: _response.rawResponse,
|
|
827
1017
|
});
|
|
828
1018
|
}
|
|
829
1019
|
});
|
|
@@ -842,25 +1032,33 @@ class Conversation {
|
|
|
842
1032
|
* await client.conversation.categorize("conversationId")
|
|
843
1033
|
*/
|
|
844
1034
|
categorize(conversationId, requestOptions) {
|
|
1035
|
+
return core.HttpResponsePromise.fromPromise(this.__categorize(conversationId, requestOptions));
|
|
1036
|
+
}
|
|
1037
|
+
__categorize(conversationId, requestOptions) {
|
|
845
1038
|
return __awaiter(this, void 0, void 0, function* () {
|
|
846
|
-
var _a, _b, _c;
|
|
1039
|
+
var _a, _b, _c, _d;
|
|
847
1040
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
848
|
-
url:
|
|
1041
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/categorize`),
|
|
849
1042
|
method: "POST",
|
|
850
|
-
headers:
|
|
851
|
-
|
|
852
|
-
|
|
1043
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1044
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1045
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1046
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1047
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
853
1048
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
854
1049
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
855
1050
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
856
1051
|
});
|
|
857
1052
|
if (_response.ok) {
|
|
858
|
-
return
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1053
|
+
return {
|
|
1054
|
+
data: serializers.CategorizationResponse.parseOrThrow(_response.body, {
|
|
1055
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1056
|
+
allowUnrecognizedUnionMembers: true,
|
|
1057
|
+
allowUnrecognizedEnumValues: true,
|
|
1058
|
+
breadcrumbsPrefix: ["response"],
|
|
1059
|
+
}),
|
|
1060
|
+
rawResponse: _response.rawResponse,
|
|
1061
|
+
};
|
|
864
1062
|
}
|
|
865
1063
|
if (_response.error.reason === "status-code") {
|
|
866
1064
|
switch (_response.error.statusCode) {
|
|
@@ -870,25 +1068,26 @@ class Conversation {
|
|
|
870
1068
|
allowUnrecognizedUnionMembers: true,
|
|
871
1069
|
allowUnrecognizedEnumValues: true,
|
|
872
1070
|
breadcrumbsPrefix: ["response"],
|
|
873
|
-
}));
|
|
1071
|
+
}), _response.rawResponse);
|
|
874
1072
|
case 400:
|
|
875
1073
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
876
1074
|
unrecognizedObjectKeys: "passthrough",
|
|
877
1075
|
allowUnrecognizedUnionMembers: true,
|
|
878
1076
|
allowUnrecognizedEnumValues: true,
|
|
879
1077
|
breadcrumbsPrefix: ["response"],
|
|
880
|
-
}));
|
|
1078
|
+
}), _response.rawResponse);
|
|
881
1079
|
case 500:
|
|
882
1080
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
883
1081
|
unrecognizedObjectKeys: "passthrough",
|
|
884
1082
|
allowUnrecognizedUnionMembers: true,
|
|
885
1083
|
allowUnrecognizedEnumValues: true,
|
|
886
1084
|
breadcrumbsPrefix: ["response"],
|
|
887
|
-
}));
|
|
1085
|
+
}), _response.rawResponse);
|
|
888
1086
|
default:
|
|
889
1087
|
throw new errors.MavenAGIError({
|
|
890
1088
|
statusCode: _response.error.statusCode,
|
|
891
1089
|
body: _response.error.body,
|
|
1090
|
+
rawResponse: _response.rawResponse,
|
|
892
1091
|
});
|
|
893
1092
|
}
|
|
894
1093
|
}
|
|
@@ -897,12 +1096,14 @@ class Conversation {
|
|
|
897
1096
|
throw new errors.MavenAGIError({
|
|
898
1097
|
statusCode: _response.error.statusCode,
|
|
899
1098
|
body: _response.error.rawBody,
|
|
1099
|
+
rawResponse: _response.rawResponse,
|
|
900
1100
|
});
|
|
901
1101
|
case "timeout":
|
|
902
1102
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/categorize.");
|
|
903
1103
|
case "unknown":
|
|
904
1104
|
throw new errors.MavenAGIError({
|
|
905
1105
|
message: _response.error.errorMessage,
|
|
1106
|
+
rawResponse: _response.rawResponse,
|
|
906
1107
|
});
|
|
907
1108
|
}
|
|
908
1109
|
});
|
|
@@ -936,12 +1137,19 @@ class Conversation {
|
|
|
936
1137
|
* })
|
|
937
1138
|
*/
|
|
938
1139
|
createFeedback(request, requestOptions) {
|
|
1140
|
+
return core.HttpResponsePromise.fromPromise(this.__createFeedback(request, requestOptions));
|
|
1141
|
+
}
|
|
1142
|
+
__createFeedback(request, requestOptions) {
|
|
939
1143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
940
|
-
var _a, _b, _c;
|
|
1144
|
+
var _a, _b, _c, _d;
|
|
941
1145
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
942
|
-
url:
|
|
1146
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/conversations/feedback"),
|
|
943
1147
|
method: "POST",
|
|
944
|
-
headers:
|
|
1148
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1149
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1150
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1151
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1152
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
945
1153
|
contentType: "application/json",
|
|
946
1154
|
requestType: "json",
|
|
947
1155
|
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -950,12 +1158,15 @@ class Conversation {
|
|
|
950
1158
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
951
1159
|
});
|
|
952
1160
|
if (_response.ok) {
|
|
953
|
-
return
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
1161
|
+
return {
|
|
1162
|
+
data: serializers.Feedback.parseOrThrow(_response.body, {
|
|
1163
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1164
|
+
allowUnrecognizedUnionMembers: true,
|
|
1165
|
+
allowUnrecognizedEnumValues: true,
|
|
1166
|
+
breadcrumbsPrefix: ["response"],
|
|
1167
|
+
}),
|
|
1168
|
+
rawResponse: _response.rawResponse,
|
|
1169
|
+
};
|
|
959
1170
|
}
|
|
960
1171
|
if (_response.error.reason === "status-code") {
|
|
961
1172
|
switch (_response.error.statusCode) {
|
|
@@ -965,25 +1176,26 @@ class Conversation {
|
|
|
965
1176
|
allowUnrecognizedUnionMembers: true,
|
|
966
1177
|
allowUnrecognizedEnumValues: true,
|
|
967
1178
|
breadcrumbsPrefix: ["response"],
|
|
968
|
-
}));
|
|
1179
|
+
}), _response.rawResponse);
|
|
969
1180
|
case 400:
|
|
970
1181
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
971
1182
|
unrecognizedObjectKeys: "passthrough",
|
|
972
1183
|
allowUnrecognizedUnionMembers: true,
|
|
973
1184
|
allowUnrecognizedEnumValues: true,
|
|
974
1185
|
breadcrumbsPrefix: ["response"],
|
|
975
|
-
}));
|
|
1186
|
+
}), _response.rawResponse);
|
|
976
1187
|
case 500:
|
|
977
1188
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
978
1189
|
unrecognizedObjectKeys: "passthrough",
|
|
979
1190
|
allowUnrecognizedUnionMembers: true,
|
|
980
1191
|
allowUnrecognizedEnumValues: true,
|
|
981
1192
|
breadcrumbsPrefix: ["response"],
|
|
982
|
-
}));
|
|
1193
|
+
}), _response.rawResponse);
|
|
983
1194
|
default:
|
|
984
1195
|
throw new errors.MavenAGIError({
|
|
985
1196
|
statusCode: _response.error.statusCode,
|
|
986
1197
|
body: _response.error.body,
|
|
1198
|
+
rawResponse: _response.rawResponse,
|
|
987
1199
|
});
|
|
988
1200
|
}
|
|
989
1201
|
}
|
|
@@ -992,12 +1204,14 @@ class Conversation {
|
|
|
992
1204
|
throw new errors.MavenAGIError({
|
|
993
1205
|
statusCode: _response.error.statusCode,
|
|
994
1206
|
body: _response.error.rawBody,
|
|
1207
|
+
rawResponse: _response.rawResponse,
|
|
995
1208
|
});
|
|
996
1209
|
case "timeout":
|
|
997
1210
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/feedback.");
|
|
998
1211
|
case "unknown":
|
|
999
1212
|
throw new errors.MavenAGIError({
|
|
1000
1213
|
message: _response.error.errorMessage,
|
|
1214
|
+
rawResponse: _response.rawResponse,
|
|
1001
1215
|
});
|
|
1002
1216
|
}
|
|
1003
1217
|
});
|
|
@@ -1024,12 +1238,19 @@ class Conversation {
|
|
|
1024
1238
|
* })
|
|
1025
1239
|
*/
|
|
1026
1240
|
submitActionForm(conversationId, request, requestOptions) {
|
|
1241
|
+
return core.HttpResponsePromise.fromPromise(this.__submitActionForm(conversationId, request, requestOptions));
|
|
1242
|
+
}
|
|
1243
|
+
__submitActionForm(conversationId, request, requestOptions) {
|
|
1027
1244
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1028
|
-
var _a, _b, _c;
|
|
1245
|
+
var _a, _b, _c, _d;
|
|
1029
1246
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1030
|
-
url:
|
|
1247
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/submit-form`),
|
|
1031
1248
|
method: "POST",
|
|
1032
|
-
headers:
|
|
1249
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1250
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1251
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1252
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1253
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1033
1254
|
contentType: "application/json",
|
|
1034
1255
|
requestType: "json",
|
|
1035
1256
|
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1038,12 +1259,15 @@ class Conversation {
|
|
|
1038
1259
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1039
1260
|
});
|
|
1040
1261
|
if (_response.ok) {
|
|
1041
|
-
return
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1262
|
+
return {
|
|
1263
|
+
data: serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
1264
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1265
|
+
allowUnrecognizedUnionMembers: true,
|
|
1266
|
+
allowUnrecognizedEnumValues: true,
|
|
1267
|
+
breadcrumbsPrefix: ["response"],
|
|
1268
|
+
}),
|
|
1269
|
+
rawResponse: _response.rawResponse,
|
|
1270
|
+
};
|
|
1047
1271
|
}
|
|
1048
1272
|
if (_response.error.reason === "status-code") {
|
|
1049
1273
|
switch (_response.error.statusCode) {
|
|
@@ -1053,25 +1277,26 @@ class Conversation {
|
|
|
1053
1277
|
allowUnrecognizedUnionMembers: true,
|
|
1054
1278
|
allowUnrecognizedEnumValues: true,
|
|
1055
1279
|
breadcrumbsPrefix: ["response"],
|
|
1056
|
-
}));
|
|
1280
|
+
}), _response.rawResponse);
|
|
1057
1281
|
case 400:
|
|
1058
1282
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1059
1283
|
unrecognizedObjectKeys: "passthrough",
|
|
1060
1284
|
allowUnrecognizedUnionMembers: true,
|
|
1061
1285
|
allowUnrecognizedEnumValues: true,
|
|
1062
1286
|
breadcrumbsPrefix: ["response"],
|
|
1063
|
-
}));
|
|
1287
|
+
}), _response.rawResponse);
|
|
1064
1288
|
case 500:
|
|
1065
1289
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1066
1290
|
unrecognizedObjectKeys: "passthrough",
|
|
1067
1291
|
allowUnrecognizedUnionMembers: true,
|
|
1068
1292
|
allowUnrecognizedEnumValues: true,
|
|
1069
1293
|
breadcrumbsPrefix: ["response"],
|
|
1070
|
-
}));
|
|
1294
|
+
}), _response.rawResponse);
|
|
1071
1295
|
default:
|
|
1072
1296
|
throw new errors.MavenAGIError({
|
|
1073
1297
|
statusCode: _response.error.statusCode,
|
|
1074
1298
|
body: _response.error.body,
|
|
1299
|
+
rawResponse: _response.rawResponse,
|
|
1075
1300
|
});
|
|
1076
1301
|
}
|
|
1077
1302
|
}
|
|
@@ -1080,12 +1305,14 @@ class Conversation {
|
|
|
1080
1305
|
throw new errors.MavenAGIError({
|
|
1081
1306
|
statusCode: _response.error.statusCode,
|
|
1082
1307
|
body: _response.error.rawBody,
|
|
1308
|
+
rawResponse: _response.rawResponse,
|
|
1083
1309
|
});
|
|
1084
1310
|
case "timeout":
|
|
1085
1311
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/submit-form.");
|
|
1086
1312
|
case "unknown":
|
|
1087
1313
|
throw new errors.MavenAGIError({
|
|
1088
1314
|
message: _response.error.errorMessage,
|
|
1315
|
+
rawResponse: _response.rawResponse,
|
|
1089
1316
|
});
|
|
1090
1317
|
}
|
|
1091
1318
|
});
|
|
@@ -1109,12 +1336,19 @@ class Conversation {
|
|
|
1109
1336
|
* })
|
|
1110
1337
|
*/
|
|
1111
1338
|
addConversationMetadata(conversationId, request, requestOptions) {
|
|
1339
|
+
return core.HttpResponsePromise.fromPromise(this.__addConversationMetadata(conversationId, request, requestOptions));
|
|
1340
|
+
}
|
|
1341
|
+
__addConversationMetadata(conversationId, request, requestOptions) {
|
|
1112
1342
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1113
|
-
var _a, _b, _c;
|
|
1343
|
+
var _a, _b, _c, _d;
|
|
1114
1344
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1115
|
-
url:
|
|
1345
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/metadata`),
|
|
1116
1346
|
method: "POST",
|
|
1117
|
-
headers:
|
|
1347
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1348
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1349
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1350
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1351
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1118
1352
|
contentType: "application/json",
|
|
1119
1353
|
requestType: "json",
|
|
1120
1354
|
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
@@ -1125,12 +1359,15 @@ class Conversation {
|
|
|
1125
1359
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1126
1360
|
});
|
|
1127
1361
|
if (_response.ok) {
|
|
1128
|
-
return
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1362
|
+
return {
|
|
1363
|
+
data: serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
1364
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1365
|
+
allowUnrecognizedUnionMembers: true,
|
|
1366
|
+
allowUnrecognizedEnumValues: true,
|
|
1367
|
+
breadcrumbsPrefix: ["response"],
|
|
1368
|
+
}),
|
|
1369
|
+
rawResponse: _response.rawResponse,
|
|
1370
|
+
};
|
|
1134
1371
|
}
|
|
1135
1372
|
if (_response.error.reason === "status-code") {
|
|
1136
1373
|
switch (_response.error.statusCode) {
|
|
@@ -1140,25 +1377,26 @@ class Conversation {
|
|
|
1140
1377
|
allowUnrecognizedUnionMembers: true,
|
|
1141
1378
|
allowUnrecognizedEnumValues: true,
|
|
1142
1379
|
breadcrumbsPrefix: ["response"],
|
|
1143
|
-
}));
|
|
1380
|
+
}), _response.rawResponse);
|
|
1144
1381
|
case 400:
|
|
1145
1382
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1146
1383
|
unrecognizedObjectKeys: "passthrough",
|
|
1147
1384
|
allowUnrecognizedUnionMembers: true,
|
|
1148
1385
|
allowUnrecognizedEnumValues: true,
|
|
1149
1386
|
breadcrumbsPrefix: ["response"],
|
|
1150
|
-
}));
|
|
1387
|
+
}), _response.rawResponse);
|
|
1151
1388
|
case 500:
|
|
1152
1389
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1153
1390
|
unrecognizedObjectKeys: "passthrough",
|
|
1154
1391
|
allowUnrecognizedUnionMembers: true,
|
|
1155
1392
|
allowUnrecognizedEnumValues: true,
|
|
1156
1393
|
breadcrumbsPrefix: ["response"],
|
|
1157
|
-
}));
|
|
1394
|
+
}), _response.rawResponse);
|
|
1158
1395
|
default:
|
|
1159
1396
|
throw new errors.MavenAGIError({
|
|
1160
1397
|
statusCode: _response.error.statusCode,
|
|
1161
1398
|
body: _response.error.body,
|
|
1399
|
+
rawResponse: _response.rawResponse,
|
|
1162
1400
|
});
|
|
1163
1401
|
}
|
|
1164
1402
|
}
|
|
@@ -1167,12 +1405,14 @@ class Conversation {
|
|
|
1167
1405
|
throw new errors.MavenAGIError({
|
|
1168
1406
|
statusCode: _response.error.statusCode,
|
|
1169
1407
|
body: _response.error.rawBody,
|
|
1408
|
+
rawResponse: _response.rawResponse,
|
|
1170
1409
|
});
|
|
1171
1410
|
case "timeout":
|
|
1172
1411
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/{conversationId}/metadata.");
|
|
1173
1412
|
case "unknown":
|
|
1174
1413
|
throw new errors.MavenAGIError({
|
|
1175
1414
|
message: _response.error.errorMessage,
|
|
1415
|
+
rawResponse: _response.rawResponse,
|
|
1176
1416
|
});
|
|
1177
1417
|
}
|
|
1178
1418
|
});
|
|
@@ -1203,12 +1443,19 @@ class Conversation {
|
|
|
1203
1443
|
* })
|
|
1204
1444
|
*/
|
|
1205
1445
|
updateConversationMetadata(conversationId, request, requestOptions) {
|
|
1446
|
+
return core.HttpResponsePromise.fromPromise(this.__updateConversationMetadata(conversationId, request, requestOptions));
|
|
1447
|
+
}
|
|
1448
|
+
__updateConversationMetadata(conversationId, request, requestOptions) {
|
|
1206
1449
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1207
|
-
var _a, _b, _c;
|
|
1450
|
+
var _a, _b, _c, _d;
|
|
1208
1451
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1209
|
-
url:
|
|
1452
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/metadata`),
|
|
1210
1453
|
method: "PUT",
|
|
1211
|
-
headers:
|
|
1454
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1455
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1456
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1457
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1458
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1212
1459
|
contentType: "application/json",
|
|
1213
1460
|
requestType: "json",
|
|
1214
1461
|
body: serializers.UpdateMetadataRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1217,12 +1464,15 @@ class Conversation {
|
|
|
1217
1464
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1218
1465
|
});
|
|
1219
1466
|
if (_response.ok) {
|
|
1220
|
-
return
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1467
|
+
return {
|
|
1468
|
+
data: serializers.ConversationMetadata.parseOrThrow(_response.body, {
|
|
1469
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1470
|
+
allowUnrecognizedUnionMembers: true,
|
|
1471
|
+
allowUnrecognizedEnumValues: true,
|
|
1472
|
+
breadcrumbsPrefix: ["response"],
|
|
1473
|
+
}),
|
|
1474
|
+
rawResponse: _response.rawResponse,
|
|
1475
|
+
};
|
|
1226
1476
|
}
|
|
1227
1477
|
if (_response.error.reason === "status-code") {
|
|
1228
1478
|
switch (_response.error.statusCode) {
|
|
@@ -1232,25 +1482,26 @@ class Conversation {
|
|
|
1232
1482
|
allowUnrecognizedUnionMembers: true,
|
|
1233
1483
|
allowUnrecognizedEnumValues: true,
|
|
1234
1484
|
breadcrumbsPrefix: ["response"],
|
|
1235
|
-
}));
|
|
1485
|
+
}), _response.rawResponse);
|
|
1236
1486
|
case 400:
|
|
1237
1487
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1238
1488
|
unrecognizedObjectKeys: "passthrough",
|
|
1239
1489
|
allowUnrecognizedUnionMembers: true,
|
|
1240
1490
|
allowUnrecognizedEnumValues: true,
|
|
1241
1491
|
breadcrumbsPrefix: ["response"],
|
|
1242
|
-
}));
|
|
1492
|
+
}), _response.rawResponse);
|
|
1243
1493
|
case 500:
|
|
1244
1494
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1245
1495
|
unrecognizedObjectKeys: "passthrough",
|
|
1246
1496
|
allowUnrecognizedUnionMembers: true,
|
|
1247
1497
|
allowUnrecognizedEnumValues: true,
|
|
1248
1498
|
breadcrumbsPrefix: ["response"],
|
|
1249
|
-
}));
|
|
1499
|
+
}), _response.rawResponse);
|
|
1250
1500
|
default:
|
|
1251
1501
|
throw new errors.MavenAGIError({
|
|
1252
1502
|
statusCode: _response.error.statusCode,
|
|
1253
1503
|
body: _response.error.body,
|
|
1504
|
+
rawResponse: _response.rawResponse,
|
|
1254
1505
|
});
|
|
1255
1506
|
}
|
|
1256
1507
|
}
|
|
@@ -1259,12 +1510,14 @@ class Conversation {
|
|
|
1259
1510
|
throw new errors.MavenAGIError({
|
|
1260
1511
|
statusCode: _response.error.statusCode,
|
|
1261
1512
|
body: _response.error.rawBody,
|
|
1513
|
+
rawResponse: _response.rawResponse,
|
|
1262
1514
|
});
|
|
1263
1515
|
case "timeout":
|
|
1264
1516
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling PUT /v1/conversations/{conversationId}/metadata.");
|
|
1265
1517
|
case "unknown":
|
|
1266
1518
|
throw new errors.MavenAGIError({
|
|
1267
1519
|
message: _response.error.errorMessage,
|
|
1520
|
+
rawResponse: _response.rawResponse,
|
|
1268
1521
|
});
|
|
1269
1522
|
}
|
|
1270
1523
|
});
|
|
@@ -1283,12 +1536,19 @@ class Conversation {
|
|
|
1283
1536
|
* await client.conversation.search({})
|
|
1284
1537
|
*/
|
|
1285
1538
|
search(request, requestOptions) {
|
|
1539
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
1540
|
+
}
|
|
1541
|
+
__search(request, requestOptions) {
|
|
1286
1542
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1287
|
-
var _a, _b, _c;
|
|
1543
|
+
var _a, _b, _c, _d;
|
|
1288
1544
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1289
|
-
url:
|
|
1545
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/conversations/search"),
|
|
1290
1546
|
method: "POST",
|
|
1291
|
-
headers:
|
|
1547
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1548
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1549
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1550
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1551
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1292
1552
|
contentType: "application/json",
|
|
1293
1553
|
requestType: "json",
|
|
1294
1554
|
body: serializers.ConversationsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1297,12 +1557,15 @@ class Conversation {
|
|
|
1297
1557
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1298
1558
|
});
|
|
1299
1559
|
if (_response.ok) {
|
|
1300
|
-
return
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1560
|
+
return {
|
|
1561
|
+
data: serializers.ConversationsResponse.parseOrThrow(_response.body, {
|
|
1562
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1563
|
+
allowUnrecognizedUnionMembers: true,
|
|
1564
|
+
allowUnrecognizedEnumValues: true,
|
|
1565
|
+
breadcrumbsPrefix: ["response"],
|
|
1566
|
+
}),
|
|
1567
|
+
rawResponse: _response.rawResponse,
|
|
1568
|
+
};
|
|
1306
1569
|
}
|
|
1307
1570
|
if (_response.error.reason === "status-code") {
|
|
1308
1571
|
switch (_response.error.statusCode) {
|
|
@@ -1312,25 +1575,26 @@ class Conversation {
|
|
|
1312
1575
|
allowUnrecognizedUnionMembers: true,
|
|
1313
1576
|
allowUnrecognizedEnumValues: true,
|
|
1314
1577
|
breadcrumbsPrefix: ["response"],
|
|
1315
|
-
}));
|
|
1578
|
+
}), _response.rawResponse);
|
|
1316
1579
|
case 400:
|
|
1317
1580
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1318
1581
|
unrecognizedObjectKeys: "passthrough",
|
|
1319
1582
|
allowUnrecognizedUnionMembers: true,
|
|
1320
1583
|
allowUnrecognizedEnumValues: true,
|
|
1321
1584
|
breadcrumbsPrefix: ["response"],
|
|
1322
|
-
}));
|
|
1585
|
+
}), _response.rawResponse);
|
|
1323
1586
|
case 500:
|
|
1324
1587
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1325
1588
|
unrecognizedObjectKeys: "passthrough",
|
|
1326
1589
|
allowUnrecognizedUnionMembers: true,
|
|
1327
1590
|
allowUnrecognizedEnumValues: true,
|
|
1328
1591
|
breadcrumbsPrefix: ["response"],
|
|
1329
|
-
}));
|
|
1592
|
+
}), _response.rawResponse);
|
|
1330
1593
|
default:
|
|
1331
1594
|
throw new errors.MavenAGIError({
|
|
1332
1595
|
statusCode: _response.error.statusCode,
|
|
1333
1596
|
body: _response.error.body,
|
|
1597
|
+
rawResponse: _response.rawResponse,
|
|
1334
1598
|
});
|
|
1335
1599
|
}
|
|
1336
1600
|
}
|
|
@@ -1339,12 +1603,129 @@ class Conversation {
|
|
|
1339
1603
|
throw new errors.MavenAGIError({
|
|
1340
1604
|
statusCode: _response.error.statusCode,
|
|
1341
1605
|
body: _response.error.rawBody,
|
|
1606
|
+
rawResponse: _response.rawResponse,
|
|
1342
1607
|
});
|
|
1343
1608
|
case "timeout":
|
|
1344
1609
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/search.");
|
|
1345
1610
|
case "unknown":
|
|
1346
1611
|
throw new errors.MavenAGIError({
|
|
1347
1612
|
message: _response.error.errorMessage,
|
|
1613
|
+
rawResponse: _response.rawResponse,
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* Deliver a message to a user or conversation.
|
|
1620
|
+
*
|
|
1621
|
+
* <Warning>
|
|
1622
|
+
* Currently, messages can only be successfully delivered to conversations with the `ASYNC` capability that are `open`.
|
|
1623
|
+
* User message delivery is not yet supported.
|
|
1624
|
+
* </Warning>
|
|
1625
|
+
*
|
|
1626
|
+
* @param {MavenAGI.DeliverMessageRequest} request
|
|
1627
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
1628
|
+
*
|
|
1629
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
1630
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
1631
|
+
* @throws {@link MavenAGI.ServerError}
|
|
1632
|
+
*
|
|
1633
|
+
* @example
|
|
1634
|
+
* await client.conversation.deliverMessage({
|
|
1635
|
+
* type: "user",
|
|
1636
|
+
* userId: {
|
|
1637
|
+
* type: "AGENT",
|
|
1638
|
+
* appId: "appId",
|
|
1639
|
+
* referenceId: "referenceId"
|
|
1640
|
+
* },
|
|
1641
|
+
* message: {
|
|
1642
|
+
* conversationMessageId: {
|
|
1643
|
+
* referenceId: "referenceId"
|
|
1644
|
+
* },
|
|
1645
|
+
* userId: {
|
|
1646
|
+
* referenceId: "referenceId"
|
|
1647
|
+
* },
|
|
1648
|
+
* text: "text",
|
|
1649
|
+
* userMessageType: "USER"
|
|
1650
|
+
* }
|
|
1651
|
+
* })
|
|
1652
|
+
*/
|
|
1653
|
+
deliverMessage(request, requestOptions) {
|
|
1654
|
+
return core.HttpResponsePromise.fromPromise(this.__deliverMessage(request, requestOptions));
|
|
1655
|
+
}
|
|
1656
|
+
__deliverMessage(request, requestOptions) {
|
|
1657
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1658
|
+
var _a, _b, _c, _d;
|
|
1659
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1660
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/conversations/deliver-message"),
|
|
1661
|
+
method: "POST",
|
|
1662
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1663
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1664
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
1665
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
1666
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1667
|
+
contentType: "application/json",
|
|
1668
|
+
requestType: "json",
|
|
1669
|
+
body: serializers.DeliverMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1670
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1671
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1672
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1673
|
+
});
|
|
1674
|
+
if (_response.ok) {
|
|
1675
|
+
return {
|
|
1676
|
+
data: serializers.DeliverMessageResponse.parseOrThrow(_response.body, {
|
|
1677
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1678
|
+
allowUnrecognizedUnionMembers: true,
|
|
1679
|
+
allowUnrecognizedEnumValues: true,
|
|
1680
|
+
breadcrumbsPrefix: ["response"],
|
|
1681
|
+
}),
|
|
1682
|
+
rawResponse: _response.rawResponse,
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
if (_response.error.reason === "status-code") {
|
|
1686
|
+
switch (_response.error.statusCode) {
|
|
1687
|
+
case 404:
|
|
1688
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1689
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1690
|
+
allowUnrecognizedUnionMembers: true,
|
|
1691
|
+
allowUnrecognizedEnumValues: true,
|
|
1692
|
+
breadcrumbsPrefix: ["response"],
|
|
1693
|
+
}), _response.rawResponse);
|
|
1694
|
+
case 400:
|
|
1695
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1696
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1697
|
+
allowUnrecognizedUnionMembers: true,
|
|
1698
|
+
allowUnrecognizedEnumValues: true,
|
|
1699
|
+
breadcrumbsPrefix: ["response"],
|
|
1700
|
+
}), _response.rawResponse);
|
|
1701
|
+
case 500:
|
|
1702
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
1703
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1704
|
+
allowUnrecognizedUnionMembers: true,
|
|
1705
|
+
allowUnrecognizedEnumValues: true,
|
|
1706
|
+
breadcrumbsPrefix: ["response"],
|
|
1707
|
+
}), _response.rawResponse);
|
|
1708
|
+
default:
|
|
1709
|
+
throw new errors.MavenAGIError({
|
|
1710
|
+
statusCode: _response.error.statusCode,
|
|
1711
|
+
body: _response.error.body,
|
|
1712
|
+
rawResponse: _response.rawResponse,
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
switch (_response.error.reason) {
|
|
1717
|
+
case "non-json":
|
|
1718
|
+
throw new errors.MavenAGIError({
|
|
1719
|
+
statusCode: _response.error.statusCode,
|
|
1720
|
+
body: _response.error.rawBody,
|
|
1721
|
+
rawResponse: _response.rawResponse,
|
|
1722
|
+
});
|
|
1723
|
+
case "timeout":
|
|
1724
|
+
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/conversations/deliver-message.");
|
|
1725
|
+
case "unknown":
|
|
1726
|
+
throw new errors.MavenAGIError({
|
|
1727
|
+
message: _response.error.errorMessage,
|
|
1728
|
+
rawResponse: _response.rawResponse,
|
|
1348
1729
|
});
|
|
1349
1730
|
}
|
|
1350
1731
|
});
|