mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -0
- package/Client.js +15 -0
- package/README.md +63 -39
- package/api/resources/actions/client/Client.d.ts +123 -0
- package/api/resources/actions/client/Client.js +564 -0
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +1 -0
- package/api/resources/actions/index.d.ts +2 -0
- package/api/resources/actions/index.js +2 -0
- package/api/resources/actions/types/Action.d.ts +23 -0
- package/api/resources/actions/types/ActionParameter.d.ts +8 -0
- package/api/resources/actions/types/ActionSetBase.d.ts +9 -0
- package/api/resources/actions/types/ActionSetRequest.d.ts +6 -0
- package/api/resources/actions/types/ActionSetResponse.d.ts +6 -0
- package/api/resources/actions/types/ActionSetResponse.js +4 -0
- package/api/resources/actions/types/index.d.ts +5 -0
- package/api/resources/actions/types/index.js +5 -0
- package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
- package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
- package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
- package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
- package/{dist/api/resources/conversation/errors/EmptyConversationError.d.ts → api/resources/commons/errors/ServerError.d.ts} +1 -1
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -1
- package/api/resources/commons/errors/index.js +3 -1
- package/api/resources/commons/types/AppUser.d.ts +10 -0
- package/api/resources/commons/types/AppUser.js +4 -0
- package/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentification.js +4 -0
- package/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifyingProperty.js +4 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/api/resources/commons/types/Feedback.d.ts +16 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
- package/api/resources/commons/types/User.d.ts +1 -0
- package/api/resources/commons/types/index.d.ts +6 -0
- package/api/resources/commons/types/index.js +6 -0
- package/api/resources/conversation/client/Client.d.ts +69 -31
- package/api/resources/conversation/client/Client.js +223 -111
- package/api/resources/conversation/index.d.ts +0 -1
- package/api/resources/conversation/index.js +0 -1
- package/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
- package/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
- package/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
- package/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
- package/api/resources/conversation/types/AskRequest.d.ts +2 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/api/resources/conversation/types/Capability.d.ts +8 -0
- package/api/resources/conversation/types/Capability.js +7 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/api/resources/conversation/types/ResponseLength.js +8 -0
- package/api/resources/conversation/types/UserMessage.d.ts +1 -0
- package/api/resources/conversation/types/index.d.ts +5 -1
- package/api/resources/conversation/types/index.js +5 -1
- package/api/resources/index.d.ts +5 -2
- package/api/resources/index.js +5 -2
- package/api/resources/knowledge/client/Client.d.ts +52 -40
- package/api/resources/knowledge/client/Client.js +191 -129
- package/api/resources/knowledge/index.d.ts +0 -1
- package/api/resources/knowledge/index.js +0 -1
- package/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
- package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +4 -2
- package/api/resources/knowledge/types/index.js +4 -2
- package/api/resources/triggers/client/Client.d.ts +72 -0
- package/api/resources/triggers/client/Client.js +298 -0
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/triggers/client/index.js +1 -0
- package/api/resources/triggers/index.d.ts +2 -0
- package/api/resources/triggers/index.js +2 -0
- package/api/resources/triggers/types/EventTrigger.d.ts +12 -0
- package/api/resources/triggers/types/EventTrigger.js +4 -0
- package/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/api/resources/triggers/types/index.d.ts +2 -0
- package/api/resources/triggers/types/index.js +2 -0
- package/api/resources/user/client/Client.d.ts +62 -0
- package/api/resources/user/client/Client.js +220 -0
- package/api/resources/user/client/index.d.ts +1 -0
- package/api/resources/user/client/index.js +1 -0
- package/api/resources/user/index.d.ts +1 -0
- package/api/resources/user/index.js +1 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/dist/Client.d.ts +9 -0
- package/dist/Client.js +15 -0
- package/dist/api/resources/actions/client/Client.d.ts +123 -0
- package/dist/api/resources/actions/client/Client.js +564 -0
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +1 -0
- package/dist/api/resources/actions/index.d.ts +2 -0
- package/dist/api/resources/actions/index.js +2 -0
- package/dist/api/resources/actions/types/Action.d.ts +23 -0
- package/dist/api/resources/actions/types/Action.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.d.ts +8 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionSetBase.d.ts +9 -0
- package/dist/api/resources/actions/types/ActionSetBase.js +4 -0
- package/dist/api/resources/actions/types/ActionSetRequest.d.ts +6 -0
- package/dist/api/resources/actions/types/ActionSetRequest.js +4 -0
- package/dist/api/resources/actions/types/ActionSetResponse.d.ts +6 -0
- package/dist/api/resources/actions/types/ActionSetResponse.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +5 -0
- package/dist/api/resources/actions/types/index.js +5 -0
- package/{api/resources/conversation/errors/EmptyConversationError.d.ts → dist/api/resources/commons/errors/BadRequestError.d.ts} +1 -1
- package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -1
- package/dist/api/resources/commons/errors/index.js +3 -1
- package/dist/api/resources/commons/types/AppUser.d.ts +10 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentification.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingProperty.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +16 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
- package/dist/api/resources/commons/types/User.d.ts +1 -0
- package/dist/api/resources/commons/types/index.d.ts +6 -0
- package/dist/api/resources/commons/types/index.js +6 -0
- package/dist/api/resources/conversation/client/Client.d.ts +69 -31
- package/dist/api/resources/conversation/client/Client.js +223 -111
- package/dist/api/resources/conversation/index.d.ts +0 -1
- package/dist/api/resources/conversation/index.js +0 -1
- package/dist/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
- package/dist/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
- package/dist/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
- package/dist/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +8 -0
- package/dist/api/resources/conversation/types/Capability.js +7 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
- package/dist/api/resources/conversation/types/UserMessage.d.ts +1 -0
- package/dist/api/resources/conversation/types/index.d.ts +5 -1
- package/dist/api/resources/conversation/types/index.js +5 -1
- package/dist/api/resources/index.d.ts +5 -2
- package/dist/api/resources/index.js +5 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +52 -40
- package/dist/api/resources/knowledge/client/Client.js +191 -129
- package/dist/api/resources/knowledge/index.d.ts +0 -1
- package/dist/api/resources/knowledge/index.js +0 -1
- package/dist/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +4 -2
- package/dist/api/resources/knowledge/types/index.js +4 -2
- package/dist/api/resources/triggers/client/Client.d.ts +72 -0
- package/dist/api/resources/triggers/client/Client.js +298 -0
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/triggers/client/index.js +1 -0
- package/dist/api/resources/triggers/index.d.ts +2 -0
- package/dist/api/resources/triggers/index.js +2 -0
- package/dist/api/resources/triggers/types/EventTrigger.d.ts +12 -0
- package/dist/api/resources/triggers/types/EventTrigger.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/dist/api/resources/triggers/types/index.d.ts +2 -0
- package/dist/api/resources/triggers/types/index.js +2 -0
- package/dist/api/resources/user/client/Client.d.ts +62 -0
- package/dist/api/resources/user/client/Client.js +220 -0
- package/dist/api/resources/user/client/index.d.ts +1 -0
- package/dist/api/resources/user/client/index.js +1 -0
- package/dist/api/resources/user/index.d.ts +1 -0
- package/dist/api/resources/user/index.js +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/serialization/resources/actions/index.d.ts +1 -0
- package/dist/serialization/resources/actions/index.js +1 -0
- package/dist/serialization/resources/actions/types/Action.d.ts +21 -0
- package/dist/serialization/resources/actions/types/Action.js +16 -0
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +9 -0
- package/dist/serialization/resources/{knowledge/types/IdBody.d.ts → actions/types/ActionSetBase.d.ts} +4 -3
- package/dist/serialization/resources/actions/types/ActionSetBase.js +8 -0
- package/dist/serialization/resources/actions/types/ActionSetRequest.d.ts +12 -0
- package/dist/serialization/resources/actions/types/ActionSetRequest.js +6 -0
- package/dist/serialization/resources/actions/types/ActionSetResponse.d.ts +12 -0
- package/dist/serialization/resources/actions/types/ActionSetResponse.js +6 -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/commons/types/AppUser.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AppUser.js +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/dist/serialization/resources/{knowledge/types/IdBody.js → commons/types/AppUserIdentifyingPropertyType.js} +1 -3
- package/dist/serialization/resources/commons/types/Feedback.d.ts +17 -0
- package/dist/serialization/resources/commons/types/Feedback.js +12 -0
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/dist/serialization/resources/commons/types/User.d.ts +1 -0
- package/dist/serialization/resources/commons/types/User.js +1 -0
- package/dist/serialization/resources/commons/types/index.d.ts +6 -0
- package/dist/serialization/resources/commons/types/index.js +6 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/ActionExecutionResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/AskRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/{serialization/resources/knowledge/types/IdBody.js → dist/serialization/resources/conversation/types/Capability.js} +1 -3
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +2 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/index.js +5 -1
- package/dist/serialization/resources/index.d.ts +4 -0
- package/dist/serialization/resources/index.js +4 -0
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
- package/{serialization/resources/knowledge/types/KnowledgeDocument.js → dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +3 -4
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +4 -2
- package/dist/serialization/resources/knowledge/types/index.js +4 -2
- package/dist/serialization/resources/triggers/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/index.js +1 -0
- package/dist/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
- package/dist/serialization/resources/triggers/types/EventTrigger.js +10 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +2 -0
- package/dist/serialization/resources/triggers/types/index.js +2 -0
- package/package.json +1 -1
- package/serialization/resources/actions/index.d.ts +1 -0
- package/serialization/resources/actions/index.js +1 -0
- package/serialization/resources/actions/types/Action.d.ts +21 -0
- package/serialization/resources/actions/types/Action.js +16 -0
- package/serialization/resources/actions/types/ActionParameter.d.ts +14 -0
- package/serialization/resources/actions/types/ActionParameter.js +9 -0
- package/serialization/resources/{knowledge/types/IdBody.d.ts → actions/types/ActionSetBase.d.ts} +4 -3
- package/serialization/resources/actions/types/ActionSetBase.js +8 -0
- package/serialization/resources/actions/types/ActionSetRequest.d.ts +12 -0
- package/serialization/resources/actions/types/ActionSetRequest.js +6 -0
- package/serialization/resources/actions/types/ActionSetResponse.d.ts +12 -0
- package/serialization/resources/actions/types/ActionSetResponse.js +6 -0
- package/serialization/resources/actions/types/index.d.ts +5 -0
- package/serialization/resources/actions/types/index.js +5 -0
- package/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/serialization/resources/commons/types/AppUser.js +10 -0
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/serialization/resources/commons/types/Feedback.d.ts +17 -0
- package/serialization/resources/commons/types/Feedback.js +12 -0
- package/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
- package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/serialization/resources/commons/types/User.d.ts +1 -0
- package/serialization/resources/commons/types/User.js +1 -0
- package/serialization/resources/commons/types/index.d.ts +6 -0
- package/serialization/resources/commons/types/index.js +6 -0
- package/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
- package/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
- package/serialization/resources/conversation/types/ActionExecutionResponse.js +7 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/AskRequest.js +2 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/serialization/resources/conversation/types/Capability.js +5 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationBase.js +2 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
- package/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/serialization/resources/conversation/types/index.d.ts +5 -1
- package/serialization/resources/conversation/types/index.js +5 -1
- package/serialization/resources/index.d.ts +4 -0
- package/serialization/resources/index.js +4 -0
- package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
- package/{dist/serialization/resources/knowledge/types/KnowledgeDocument.js → serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +3 -4
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
- package/serialization/resources/knowledge/types/index.d.ts +4 -2
- package/serialization/resources/knowledge/types/index.js +4 -2
- package/serialization/resources/triggers/index.d.ts +1 -0
- package/serialization/resources/triggers/index.js +1 -0
- package/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
- package/serialization/resources/triggers/types/EventTrigger.js +10 -0
- package/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/serialization/resources/triggers/types/index.d.ts +2 -0
- package/serialization/resources/triggers/types/index.js +2 -0
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/api/resources/conversation/errors/index.d.ts +0 -7
- package/api/resources/conversation/errors/index.js +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/api/resources/knowledge/errors/index.d.ts +0 -6
- package/api/resources/knowledge/errors/index.js +0 -6
- package/api/resources/knowledge/types/IdBody.d.ts +0 -6
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/dist/api/resources/conversation/errors/index.d.ts +0 -7
- package/dist/api/resources/conversation/errors/index.js +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
- package/dist/api/resources/knowledge/errors/index.js +0 -6
- package/dist/api/resources/knowledge/types/IdBody.d.ts +0 -6
- /package/api/resources/{knowledge/types/IdBody.js → actions/types/Action.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocument.js → actions/types/ActionParameter.js} +0 -0
- /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/actions/types/ActionSetBase.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/actions/types/ActionSetRequest.js} +0 -0
|
@@ -21,15 +21,17 @@ export class Knowledge {
|
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Create knowledge base
|
|
24
|
+
* Create a new knowledge base.
|
|
25
25
|
*
|
|
26
26
|
* @param {MavenAGI.KnowledgeBase} request
|
|
27
27
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
|
-
* @throws {@link MavenAGI.
|
|
29
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
+
* @throws {@link MavenAGI.ServerError}
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
32
|
-
* await
|
|
34
|
+
* await client.knowledge.createKnowledgeBase({
|
|
33
35
|
* displayName: "string",
|
|
34
36
|
* type: MavenAGI.KnowledgeBaseType.Api,
|
|
35
37
|
* url: "string",
|
|
@@ -37,7 +39,7 @@ export class Knowledge {
|
|
|
37
39
|
* })
|
|
38
40
|
*/
|
|
39
41
|
createKnowledgeBase(request, requestOptions) {
|
|
40
|
-
var _a, _b
|
|
42
|
+
var _a, _b;
|
|
41
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
44
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
43
45
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge"),
|
|
@@ -48,7 +50,7 @@ export class Knowledge {
|
|
|
48
50
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
49
51
|
"X-Fern-Language": "JavaScript",
|
|
50
52
|
"X-Fern-SDK-Name": "mavenagi",
|
|
51
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
53
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
52
54
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
55
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
56
|
},
|
|
@@ -67,9 +69,23 @@ export class Knowledge {
|
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
if (_response.error.reason === "status-code") {
|
|
70
|
-
switch (
|
|
71
|
-
case
|
|
72
|
-
throw new MavenAGI.
|
|
72
|
+
switch (_response.error.statusCode) {
|
|
73
|
+
case 404:
|
|
74
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
75
|
+
unrecognizedObjectKeys: "passthrough",
|
|
76
|
+
allowUnrecognizedUnionMembers: true,
|
|
77
|
+
allowUnrecognizedEnumValues: true,
|
|
78
|
+
breadcrumbsPrefix: ["response"],
|
|
79
|
+
}));
|
|
80
|
+
case 400:
|
|
81
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
82
|
+
unrecognizedObjectKeys: "passthrough",
|
|
83
|
+
allowUnrecognizedUnionMembers: true,
|
|
84
|
+
allowUnrecognizedEnumValues: true,
|
|
85
|
+
breadcrumbsPrefix: ["response"],
|
|
86
|
+
}));
|
|
87
|
+
case 500:
|
|
88
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
73
89
|
unrecognizedObjectKeys: "passthrough",
|
|
74
90
|
allowUnrecognizedUnionMembers: true,
|
|
75
91
|
allowUnrecognizedEnumValues: true,
|
|
@@ -98,24 +114,110 @@ export class Knowledge {
|
|
|
98
114
|
});
|
|
99
115
|
}
|
|
100
116
|
/**
|
|
101
|
-
*
|
|
117
|
+
* Get an existing knowledge base.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} knowledgeBaseId - The ID of the knowledge base to get
|
|
120
|
+
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
|
+
*
|
|
122
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
123
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
124
|
+
* @throws {@link MavenAGI.ServerError}
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* await client.knowledge.getKnowledgeBase("string")
|
|
128
|
+
*/
|
|
129
|
+
getKnowledgeBase(knowledgeBaseId, requestOptions) {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
133
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseId)}`),
|
|
134
|
+
method: "GET",
|
|
135
|
+
headers: {
|
|
136
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
137
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
138
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
139
|
+
"X-Fern-Language": "JavaScript",
|
|
140
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
141
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
142
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
143
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
144
|
+
},
|
|
145
|
+
contentType: "application/json",
|
|
146
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
147
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
148
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
149
|
+
});
|
|
150
|
+
if (_response.ok) {
|
|
151
|
+
return yield serializers.KnowledgeBase.parseOrThrow(_response.body, {
|
|
152
|
+
unrecognizedObjectKeys: "passthrough",
|
|
153
|
+
allowUnrecognizedUnionMembers: true,
|
|
154
|
+
allowUnrecognizedEnumValues: true,
|
|
155
|
+
breadcrumbsPrefix: ["response"],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (_response.error.reason === "status-code") {
|
|
159
|
+
switch (_response.error.statusCode) {
|
|
160
|
+
case 404:
|
|
161
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
162
|
+
unrecognizedObjectKeys: "passthrough",
|
|
163
|
+
allowUnrecognizedUnionMembers: true,
|
|
164
|
+
allowUnrecognizedEnumValues: true,
|
|
165
|
+
breadcrumbsPrefix: ["response"],
|
|
166
|
+
}));
|
|
167
|
+
case 400:
|
|
168
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
169
|
+
unrecognizedObjectKeys: "passthrough",
|
|
170
|
+
allowUnrecognizedUnionMembers: true,
|
|
171
|
+
allowUnrecognizedEnumValues: true,
|
|
172
|
+
breadcrumbsPrefix: ["response"],
|
|
173
|
+
}));
|
|
174
|
+
case 500:
|
|
175
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
176
|
+
unrecognizedObjectKeys: "passthrough",
|
|
177
|
+
allowUnrecognizedUnionMembers: true,
|
|
178
|
+
allowUnrecognizedEnumValues: true,
|
|
179
|
+
breadcrumbsPrefix: ["response"],
|
|
180
|
+
}));
|
|
181
|
+
default:
|
|
182
|
+
throw new errors.MavenAGIError({
|
|
183
|
+
statusCode: _response.error.statusCode,
|
|
184
|
+
body: _response.error.body,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
switch (_response.error.reason) {
|
|
189
|
+
case "non-json":
|
|
190
|
+
throw new errors.MavenAGIError({
|
|
191
|
+
statusCode: _response.error.statusCode,
|
|
192
|
+
body: _response.error.rawBody,
|
|
193
|
+
});
|
|
194
|
+
case "timeout":
|
|
195
|
+
throw new errors.MavenAGITimeoutError();
|
|
196
|
+
case "unknown":
|
|
197
|
+
throw new errors.MavenAGIError({
|
|
198
|
+
message: _response.error.errorMessage,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
|
|
102
205
|
*
|
|
103
206
|
* @param {MavenAGI.KnowledgeBaseVersion} request
|
|
104
207
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
208
|
*
|
|
106
|
-
* @throws {@link MavenAGI.
|
|
107
|
-
* @throws {@link MavenAGI.
|
|
108
|
-
* @throws {@link MavenAGI.
|
|
109
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
209
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
210
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
211
|
+
* @throws {@link MavenAGI.ServerError}
|
|
110
212
|
*
|
|
111
213
|
* @example
|
|
112
|
-
* await
|
|
214
|
+
* await client.knowledge.createKnowledgeBaseVersion({
|
|
113
215
|
* knowledgeBaseId: "string",
|
|
114
216
|
* type: MavenAGI.KnowledgeBaseVersionType.Full
|
|
115
217
|
* })
|
|
116
218
|
*/
|
|
117
219
|
createKnowledgeBaseVersion(request, requestOptions) {
|
|
118
|
-
var _a, _b
|
|
220
|
+
var _a, _b;
|
|
119
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
222
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
121
223
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version"),
|
|
@@ -126,7 +228,7 @@ export class Knowledge {
|
|
|
126
228
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
127
229
|
"X-Fern-Language": "JavaScript",
|
|
128
230
|
"X-Fern-SDK-Name": "mavenagi",
|
|
129
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
231
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
130
232
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
131
233
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
132
234
|
},
|
|
@@ -145,30 +247,23 @@ export class Knowledge {
|
|
|
145
247
|
});
|
|
146
248
|
}
|
|
147
249
|
if (_response.error.reason === "status-code") {
|
|
148
|
-
switch (
|
|
149
|
-
case
|
|
150
|
-
throw new MavenAGI.
|
|
151
|
-
unrecognizedObjectKeys: "passthrough",
|
|
152
|
-
allowUnrecognizedUnionMembers: true,
|
|
153
|
-
allowUnrecognizedEnumValues: true,
|
|
154
|
-
breadcrumbsPrefix: ["response"],
|
|
155
|
-
}));
|
|
156
|
-
case "IneligibleKnowledgeBaseError":
|
|
157
|
-
throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
|
|
250
|
+
switch (_response.error.statusCode) {
|
|
251
|
+
case 404:
|
|
252
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
158
253
|
unrecognizedObjectKeys: "passthrough",
|
|
159
254
|
allowUnrecognizedUnionMembers: true,
|
|
160
255
|
allowUnrecognizedEnumValues: true,
|
|
161
256
|
breadcrumbsPrefix: ["response"],
|
|
162
257
|
}));
|
|
163
|
-
case
|
|
164
|
-
throw new MavenAGI.
|
|
258
|
+
case 400:
|
|
259
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
165
260
|
unrecognizedObjectKeys: "passthrough",
|
|
166
261
|
allowUnrecognizedUnionMembers: true,
|
|
167
262
|
allowUnrecognizedEnumValues: true,
|
|
168
263
|
breadcrumbsPrefix: ["response"],
|
|
169
264
|
}));
|
|
170
|
-
case
|
|
171
|
-
throw new MavenAGI.
|
|
265
|
+
case 500:
|
|
266
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
172
267
|
unrecognizedObjectKeys: "passthrough",
|
|
173
268
|
allowUnrecognizedUnionMembers: true,
|
|
174
269
|
allowUnrecognizedEnumValues: true,
|
|
@@ -197,23 +292,22 @@ export class Knowledge {
|
|
|
197
292
|
});
|
|
198
293
|
}
|
|
199
294
|
/**
|
|
200
|
-
* Finalize
|
|
295
|
+
* Finalize the latest knowledge base version. Required to indicate the version is complete. Will throw an exception if the latest version is not in progress.
|
|
201
296
|
*
|
|
202
297
|
* @param {MavenAGI.KnowledgeBaseId} request
|
|
203
298
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
204
299
|
*
|
|
205
|
-
* @throws {@link MavenAGI.
|
|
206
|
-
* @throws {@link MavenAGI.
|
|
207
|
-
* @throws {@link MavenAGI.
|
|
208
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
300
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
301
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
302
|
+
* @throws {@link MavenAGI.ServerError}
|
|
209
303
|
*
|
|
210
304
|
* @example
|
|
211
|
-
* await
|
|
305
|
+
* await client.knowledge.finalizeKnowledgeBaseVersion({
|
|
212
306
|
* knowledgeBaseId: "string"
|
|
213
307
|
* })
|
|
214
308
|
*/
|
|
215
309
|
finalizeKnowledgeBaseVersion(request, requestOptions) {
|
|
216
|
-
var _a, _b
|
|
310
|
+
var _a, _b;
|
|
217
311
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
312
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
219
313
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version/finalize"),
|
|
@@ -224,7 +318,7 @@ export class Knowledge {
|
|
|
224
318
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
225
319
|
"X-Fern-Language": "JavaScript",
|
|
226
320
|
"X-Fern-SDK-Name": "mavenagi",
|
|
227
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
321
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
228
322
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
229
323
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
230
324
|
},
|
|
@@ -238,30 +332,23 @@ export class Knowledge {
|
|
|
238
332
|
return;
|
|
239
333
|
}
|
|
240
334
|
if (_response.error.reason === "status-code") {
|
|
241
|
-
switch (
|
|
242
|
-
case
|
|
243
|
-
throw new MavenAGI.
|
|
335
|
+
switch (_response.error.statusCode) {
|
|
336
|
+
case 404:
|
|
337
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
244
338
|
unrecognizedObjectKeys: "passthrough",
|
|
245
339
|
allowUnrecognizedUnionMembers: true,
|
|
246
340
|
allowUnrecognizedEnumValues: true,
|
|
247
341
|
breadcrumbsPrefix: ["response"],
|
|
248
342
|
}));
|
|
249
|
-
case
|
|
250
|
-
throw new MavenAGI.
|
|
343
|
+
case 400:
|
|
344
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
251
345
|
unrecognizedObjectKeys: "passthrough",
|
|
252
346
|
allowUnrecognizedUnionMembers: true,
|
|
253
347
|
allowUnrecognizedEnumValues: true,
|
|
254
348
|
breadcrumbsPrefix: ["response"],
|
|
255
349
|
}));
|
|
256
|
-
case
|
|
257
|
-
throw new MavenAGI.
|
|
258
|
-
unrecognizedObjectKeys: "passthrough",
|
|
259
|
-
allowUnrecognizedUnionMembers: true,
|
|
260
|
-
allowUnrecognizedEnumValues: true,
|
|
261
|
-
breadcrumbsPrefix: ["response"],
|
|
262
|
-
}));
|
|
263
|
-
case "AgentNotFoundError":
|
|
264
|
-
throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
350
|
+
case 500:
|
|
351
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
352
|
unrecognizedObjectKeys: "passthrough",
|
|
266
353
|
allowUnrecognizedUnionMembers: true,
|
|
267
354
|
allowUnrecognizedEnumValues: true,
|
|
@@ -290,21 +377,20 @@ export class Knowledge {
|
|
|
290
377
|
});
|
|
291
378
|
}
|
|
292
379
|
/**
|
|
293
|
-
* Create knowledge document
|
|
380
|
+
* Create knowledge document. Requires an existing knowledge base with an in progress version. Will throw an exception if the latest version is not in progress.
|
|
294
381
|
*
|
|
295
|
-
* @param {MavenAGI.
|
|
382
|
+
* @param {MavenAGI.KnowledgeDocumentRequest} request
|
|
296
383
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
297
384
|
*
|
|
298
|
-
* @throws {@link MavenAGI.
|
|
299
|
-
* @throws {@link MavenAGI.
|
|
300
|
-
* @throws {@link MavenAGI.
|
|
301
|
-
* @throws {@link MavenAGI.DocumentCreationError}
|
|
302
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
385
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
386
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
387
|
+
* @throws {@link MavenAGI.ServerError}
|
|
303
388
|
*
|
|
304
389
|
* @example
|
|
305
|
-
* await
|
|
306
|
-
*
|
|
390
|
+
* await client.knowledge.createKnowledgeDocument({
|
|
391
|
+
* contentType: MavenAGI.KnowledgeDocumentContentType.Html,
|
|
307
392
|
* content: "string",
|
|
393
|
+
* title: "string",
|
|
308
394
|
* url: "string",
|
|
309
395
|
* language: "string",
|
|
310
396
|
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
@@ -315,7 +401,7 @@ export class Knowledge {
|
|
|
315
401
|
* })
|
|
316
402
|
*/
|
|
317
403
|
createKnowledgeDocument(request, requestOptions) {
|
|
318
|
-
var _a, _b
|
|
404
|
+
var _a, _b;
|
|
319
405
|
return __awaiter(this, void 0, void 0, function* () {
|
|
320
406
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
321
407
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
|
|
@@ -326,18 +412,18 @@ export class Knowledge {
|
|
|
326
412
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
327
413
|
"X-Fern-Language": "JavaScript",
|
|
328
414
|
"X-Fern-SDK-Name": "mavenagi",
|
|
329
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
415
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
330
416
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
331
417
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
332
418
|
},
|
|
333
419
|
contentType: "application/json",
|
|
334
|
-
body: yield serializers.
|
|
420
|
+
body: yield serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
335
421
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
336
422
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
337
423
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
338
424
|
});
|
|
339
425
|
if (_response.ok) {
|
|
340
|
-
return yield serializers.
|
|
426
|
+
return yield serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
341
427
|
unrecognizedObjectKeys: "passthrough",
|
|
342
428
|
allowUnrecognizedUnionMembers: true,
|
|
343
429
|
allowUnrecognizedEnumValues: true,
|
|
@@ -345,32 +431,23 @@ export class Knowledge {
|
|
|
345
431
|
});
|
|
346
432
|
}
|
|
347
433
|
if (_response.error.reason === "status-code") {
|
|
348
|
-
switch (
|
|
349
|
-
case
|
|
350
|
-
throw new MavenAGI.
|
|
351
|
-
unrecognizedObjectKeys: "passthrough",
|
|
352
|
-
allowUnrecognizedUnionMembers: true,
|
|
353
|
-
allowUnrecognizedEnumValues: true,
|
|
354
|
-
breadcrumbsPrefix: ["response"],
|
|
355
|
-
}));
|
|
356
|
-
case "IneligibleKnowledgeBaseError":
|
|
357
|
-
throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
|
|
434
|
+
switch (_response.error.statusCode) {
|
|
435
|
+
case 404:
|
|
436
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
358
437
|
unrecognizedObjectKeys: "passthrough",
|
|
359
438
|
allowUnrecognizedUnionMembers: true,
|
|
360
439
|
allowUnrecognizedEnumValues: true,
|
|
361
440
|
breadcrumbsPrefix: ["response"],
|
|
362
441
|
}));
|
|
363
|
-
case
|
|
364
|
-
throw new MavenAGI.
|
|
442
|
+
case 400:
|
|
443
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
365
444
|
unrecognizedObjectKeys: "passthrough",
|
|
366
445
|
allowUnrecognizedUnionMembers: true,
|
|
367
446
|
allowUnrecognizedEnumValues: true,
|
|
368
447
|
breadcrumbsPrefix: ["response"],
|
|
369
448
|
}));
|
|
370
|
-
case
|
|
371
|
-
throw new MavenAGI.
|
|
372
|
-
case "AgentNotFoundError":
|
|
373
|
-
throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
449
|
+
case 500:
|
|
450
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
374
451
|
unrecognizedObjectKeys: "passthrough",
|
|
375
452
|
allowUnrecognizedUnionMembers: true,
|
|
376
453
|
allowUnrecognizedEnumValues: true,
|
|
@@ -399,20 +476,20 @@ export class Knowledge {
|
|
|
399
476
|
});
|
|
400
477
|
}
|
|
401
478
|
/**
|
|
402
|
-
* Update knowledge document
|
|
479
|
+
* Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
|
|
403
480
|
*
|
|
404
|
-
* @param {MavenAGI.
|
|
481
|
+
* @param {MavenAGI.KnowledgeDocumentRequest} request
|
|
405
482
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
406
483
|
*
|
|
407
|
-
* @throws {@link MavenAGI.
|
|
408
|
-
* @throws {@link MavenAGI.
|
|
409
|
-
* @throws {@link MavenAGI.
|
|
410
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
484
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
485
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
486
|
+
* @throws {@link MavenAGI.ServerError}
|
|
411
487
|
*
|
|
412
488
|
* @example
|
|
413
|
-
* await
|
|
414
|
-
*
|
|
489
|
+
* await client.knowledge.updateKnowledgeDocument({
|
|
490
|
+
* contentType: MavenAGI.KnowledgeDocumentContentType.Html,
|
|
415
491
|
* content: "string",
|
|
492
|
+
* title: "string",
|
|
416
493
|
* url: "string",
|
|
417
494
|
* language: "string",
|
|
418
495
|
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
@@ -423,7 +500,7 @@ export class Knowledge {
|
|
|
423
500
|
* })
|
|
424
501
|
*/
|
|
425
502
|
updateKnowledgeDocument(request, requestOptions) {
|
|
426
|
-
var _a, _b
|
|
503
|
+
var _a, _b;
|
|
427
504
|
return __awaiter(this, void 0, void 0, function* () {
|
|
428
505
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
429
506
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
|
|
@@ -434,18 +511,18 @@ export class Knowledge {
|
|
|
434
511
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
435
512
|
"X-Fern-Language": "JavaScript",
|
|
436
513
|
"X-Fern-SDK-Name": "mavenagi",
|
|
437
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
514
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
438
515
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
439
516
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
440
517
|
},
|
|
441
518
|
contentType: "application/json",
|
|
442
|
-
body: yield serializers.
|
|
519
|
+
body: yield serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
443
520
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
444
521
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
445
522
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
446
523
|
});
|
|
447
524
|
if (_response.ok) {
|
|
448
|
-
return yield serializers.
|
|
525
|
+
return yield serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
449
526
|
unrecognizedObjectKeys: "passthrough",
|
|
450
527
|
allowUnrecognizedUnionMembers: true,
|
|
451
528
|
allowUnrecognizedEnumValues: true,
|
|
@@ -453,30 +530,23 @@ export class Knowledge {
|
|
|
453
530
|
});
|
|
454
531
|
}
|
|
455
532
|
if (_response.error.reason === "status-code") {
|
|
456
|
-
switch (
|
|
457
|
-
case
|
|
458
|
-
throw new MavenAGI.
|
|
459
|
-
unrecognizedObjectKeys: "passthrough",
|
|
460
|
-
allowUnrecognizedUnionMembers: true,
|
|
461
|
-
allowUnrecognizedEnumValues: true,
|
|
462
|
-
breadcrumbsPrefix: ["response"],
|
|
463
|
-
}));
|
|
464
|
-
case "KnowledgeBaseNotFoundError":
|
|
465
|
-
throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
|
|
533
|
+
switch (_response.error.statusCode) {
|
|
534
|
+
case 404:
|
|
535
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
466
536
|
unrecognizedObjectKeys: "passthrough",
|
|
467
537
|
allowUnrecognizedUnionMembers: true,
|
|
468
538
|
allowUnrecognizedEnumValues: true,
|
|
469
539
|
breadcrumbsPrefix: ["response"],
|
|
470
540
|
}));
|
|
471
|
-
case
|
|
472
|
-
throw new MavenAGI.
|
|
541
|
+
case 400:
|
|
542
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
473
543
|
unrecognizedObjectKeys: "passthrough",
|
|
474
544
|
allowUnrecognizedUnionMembers: true,
|
|
475
545
|
allowUnrecognizedEnumValues: true,
|
|
476
546
|
breadcrumbsPrefix: ["response"],
|
|
477
547
|
}));
|
|
478
|
-
case
|
|
479
|
-
throw new MavenAGI.
|
|
548
|
+
case 500:
|
|
549
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
480
550
|
unrecognizedObjectKeys: "passthrough",
|
|
481
551
|
allowUnrecognizedUnionMembers: true,
|
|
482
552
|
allowUnrecognizedEnumValues: true,
|
|
@@ -505,24 +575,23 @@ export class Knowledge {
|
|
|
505
575
|
});
|
|
506
576
|
}
|
|
507
577
|
/**
|
|
508
|
-
* Delete knowledge document
|
|
578
|
+
* Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
|
|
509
579
|
*
|
|
510
580
|
* @param {MavenAGI.KnowledgeDocumentId} request
|
|
511
581
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
512
582
|
*
|
|
513
|
-
* @throws {@link MavenAGI.
|
|
514
|
-
* @throws {@link MavenAGI.
|
|
515
|
-
* @throws {@link MavenAGI.
|
|
516
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
583
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
584
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
585
|
+
* @throws {@link MavenAGI.ServerError}
|
|
517
586
|
*
|
|
518
587
|
* @example
|
|
519
|
-
* await
|
|
588
|
+
* await client.knowledge.deleteKnowledgeDocument({
|
|
520
589
|
* knowledgeBaseId: "string",
|
|
521
590
|
* documentId: "string"
|
|
522
591
|
* })
|
|
523
592
|
*/
|
|
524
593
|
deleteKnowledgeDocument(request, requestOptions) {
|
|
525
|
-
var _a, _b
|
|
594
|
+
var _a, _b;
|
|
526
595
|
return __awaiter(this, void 0, void 0, function* () {
|
|
527
596
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
528
597
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
|
|
@@ -533,7 +602,7 @@ export class Knowledge {
|
|
|
533
602
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
534
603
|
"X-Fern-Language": "JavaScript",
|
|
535
604
|
"X-Fern-SDK-Name": "mavenagi",
|
|
536
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
605
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
537
606
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
538
607
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
539
608
|
},
|
|
@@ -547,30 +616,23 @@ export class Knowledge {
|
|
|
547
616
|
return;
|
|
548
617
|
}
|
|
549
618
|
if (_response.error.reason === "status-code") {
|
|
550
|
-
switch (
|
|
551
|
-
case
|
|
552
|
-
throw new MavenAGI.
|
|
553
|
-
unrecognizedObjectKeys: "passthrough",
|
|
554
|
-
allowUnrecognizedUnionMembers: true,
|
|
555
|
-
allowUnrecognizedEnumValues: true,
|
|
556
|
-
breadcrumbsPrefix: ["response"],
|
|
557
|
-
}));
|
|
558
|
-
case "KnowledgeBaseNotFoundError":
|
|
559
|
-
throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
|
|
619
|
+
switch (_response.error.statusCode) {
|
|
620
|
+
case 404:
|
|
621
|
+
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
560
622
|
unrecognizedObjectKeys: "passthrough",
|
|
561
623
|
allowUnrecognizedUnionMembers: true,
|
|
562
624
|
allowUnrecognizedEnumValues: true,
|
|
563
625
|
breadcrumbsPrefix: ["response"],
|
|
564
626
|
}));
|
|
565
|
-
case
|
|
566
|
-
throw new MavenAGI.
|
|
627
|
+
case 400:
|
|
628
|
+
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
567
629
|
unrecognizedObjectKeys: "passthrough",
|
|
568
630
|
allowUnrecognizedUnionMembers: true,
|
|
569
631
|
allowUnrecognizedEnumValues: true,
|
|
570
632
|
breadcrumbsPrefix: ["response"],
|
|
571
633
|
}));
|
|
572
|
-
case
|
|
573
|
-
throw new MavenAGI.
|
|
634
|
+
case 500:
|
|
635
|
+
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
574
636
|
unrecognizedObjectKeys: "passthrough",
|
|
575
637
|
allowUnrecognizedUnionMembers: true,
|
|
576
638
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
|
-
export interface
|
|
5
|
+
export interface BaseKnowledgeDocument extends MavenAGI.KnowledgeDocumentId {
|
|
6
6
|
/** The title of the document. Will be shown as part of answers. */
|
|
7
7
|
title: string;
|
|
8
|
-
/** The content of the document */
|
|
9
|
-
content: string;
|
|
10
8
|
/** The URL of the document. Should be visible to end users. Will be shown as part of answers. */
|
|
11
9
|
url?: string;
|
|
12
10
|
/** The document language. Must be a valid ISO 639-1 language code. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* API knowledge bases are managed by a Maven App. URL knowledge bases will start a web crawl of the provided URL. RSS knowledge bases will parse documents from the RSS returned from the provided URL.
|
|
6
6
|
*/
|
|
7
7
|
export declare type KnowledgeBaseType = "API" | "URL" | "RSS";
|
|
8
8
|
export declare const KnowledgeBaseType: {
|
|
@@ -5,6 +5,6 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface KnowledgeBaseVersion {
|
|
6
6
|
/** External ID of the knowledge base used to create a new version */
|
|
7
7
|
knowledgeBaseId: string;
|
|
8
|
-
/** Indicates whether the completed version constitutes a full or partial refresh of the knowledge base */
|
|
8
|
+
/** Indicates whether the completed version constitutes a full or partial refresh of the knowledge base. Deleting and updating documents is only supported for partial refreshes. */
|
|
9
9
|
type: MavenAGI.KnowledgeBaseVersionType;
|
|
10
10
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The type of the knowledge document content. Markdown preferred.
|
|
6
|
+
*/
|
|
7
|
+
export declare type KnowledgeDocumentContentType = "HTML" | "MARKDOWN";
|
|
8
|
+
export declare const KnowledgeDocumentContentType: {
|
|
9
|
+
readonly Html: "HTML";
|
|
10
|
+
readonly Markdown: "MARKDOWN";
|
|
11
|
+
};
|