mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +21 -0
- package/Client.js +20 -0
- package/README.md +83 -16
- package/api/resources/actions/client/Client.d.ts +96 -0
- package/api/resources/actions/client/Client.js +319 -0
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +1 -0
- package/api/resources/actions/index.d.ts +2 -0
- package/api/resources/actions/index.js +2 -0
- package/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/api/resources/actions/types/Precondition.d.ts +31 -0
- package/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/api/resources/{knowledge/types/IdBody.d.ts → actions/types/PreconditionOperator.js} +3 -3
- package/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/api/resources/actions/types/index.d.ts +13 -0
- package/api/resources/actions/types/index.js +13 -0
- package/api/resources/appSettings/client/Client.d.ts +47 -0
- package/api/resources/appSettings/client/Client.js +125 -0
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/appSettings/client/index.js +1 -0
- package/api/resources/appSettings/index.d.ts +1 -0
- package/api/resources/appSettings/index.js +1 -0
- package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
- package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
- package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
- package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
- package/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/ServerError.d.ts} +1 -1
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -1
- package/api/resources/commons/errors/index.js +3 -1
- package/api/resources/commons/types/AppUser.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/api/resources/commons/types/AppUserRequest.d.ts +26 -0
- package/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityIdBase.js +4 -0
- package/api/resources/commons/types/EntityType.d.ts +16 -0
- package/api/resources/commons/types/EntityType.js +15 -0
- package/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/api/resources/commons/types/EventTriggerType.js +7 -0
- package/api/resources/commons/types/Feedback.d.ts +12 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/FeedbackBase.js +4 -0
- package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
- package/api/resources/commons/types/UserData.d.ts +10 -0
- package/api/resources/commons/types/UserData.js +4 -0
- package/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/api/resources/commons/types/VisibilityType.js +8 -0
- package/api/resources/commons/types/index.d.ts +16 -1
- package/api/resources/commons/types/index.js +16 -1
- package/api/resources/conversation/client/Client.d.ts +149 -44
- package/api/resources/conversation/client/Client.js +474 -132
- package/api/resources/conversation/index.d.ts +0 -1
- package/api/resources/conversation/index.js +0 -1
- package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +18 -0
- package/api/resources/conversation/types/Capability.js +8 -0
- package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/conversation/types/CategorizationResponse.d.ts} +2 -2
- package/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/api/resources/conversation/types/ResponseLength.js +8 -0
- package/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/api/resources/conversation/types/Sentiment.js +10 -0
- package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/api/resources/conversation/types/index.d.ts +9 -3
- package/api/resources/conversation/types/index.js +9 -3
- package/api/resources/index.d.ts +6 -2
- package/api/resources/index.js +6 -2
- package/api/resources/knowledge/client/Client.d.ts +86 -74
- package/api/resources/knowledge/client/Client.js +240 -175
- package/api/resources/knowledge/index.d.ts +0 -1
- package/api/resources/knowledge/index.js +0 -1
- package/{dist/api/resources/knowledge/types/KnowledgeDocument.d.ts → api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +7 -5
- package/api/resources/knowledge/types/index.js +7 -5
- package/api/resources/triggers/client/Client.d.ts +83 -0
- package/api/resources/triggers/client/Client.js +306 -0
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/triggers/client/index.js +1 -0
- package/api/resources/triggers/index.d.ts +2 -0
- package/api/resources/triggers/index.js +2 -0
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/api/resources/triggers/types/index.d.ts +1 -0
- package/api/resources/triggers/types/index.js +1 -0
- package/api/resources/users/client/Client.d.ts +77 -0
- package/api/resources/users/client/Client.js +230 -0
- package/api/resources/users/client/index.d.ts +1 -0
- package/api/resources/users/client/index.js +1 -0
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -0
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +18 -159
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +6 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +32 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +19 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +38 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +28 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +32 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +8 -4
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +46 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +1 -0
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +21 -0
- package/dist/Client.js +20 -0
- package/dist/api/resources/actions/client/Client.d.ts +96 -0
- package/dist/api/resources/actions/client/Client.js +319 -0
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +1 -0
- package/dist/api/resources/actions/index.d.ts +2 -0
- package/dist/api/resources/actions/index.js +2 -0
- package/dist/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/api/resources/actions/types/ActionBase.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +31 -0
- package/dist/api/resources/actions/types/ActionRequest.js +4 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +35 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.js +4 -0
- package/dist/api/resources/actions/types/Precondition.d.ts +31 -0
- package/dist/api/resources/actions/types/Precondition.js +4 -0
- package/dist/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionBase.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroup.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.js +6 -0
- package/dist/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/dist/api/resources/actions/types/TagsPrecondition.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +13 -0
- package/dist/api/resources/actions/types/index.js +13 -0
- package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
- package/dist/api/resources/appSettings/client/Client.js +125 -0
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/appSettings/client/index.js +1 -0
- package/dist/api/resources/appSettings/index.d.ts +1 -0
- package/dist/api/resources/appSettings/index.js +1 -0
- package/dist/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/BadRequestError.d.ts} +1 -1
- package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -1
- package/dist/api/resources/commons/errors/index.js +3 -1
- package/dist/api/resources/commons/types/AppUser.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +26 -0
- package/dist/api/resources/commons/types/AppUserRequest.js +4 -0
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +42 -0
- package/dist/api/resources/commons/types/AppUserResponse.js +4 -0
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +16 -0
- package/dist/api/resources/commons/types/EntityType.js +15 -0
- package/dist/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/commons/types/EventTriggerType.js +7 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +12 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/FeedbackBase.js +4 -0
- package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
- package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
- package/dist/api/resources/commons/types/UserData.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.js +4 -0
- package/dist/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/dist/api/resources/commons/types/VisibilityType.js +8 -0
- package/dist/api/resources/commons/types/index.d.ts +16 -1
- package/dist/api/resources/commons/types/index.js +16 -1
- package/dist/api/resources/conversation/client/Client.d.ts +149 -44
- package/dist/api/resources/conversation/client/Client.js +474 -132
- package/dist/api/resources/conversation/index.d.ts +0 -1
- package/dist/api/resources/conversation/index.js +0 -1
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +15 -3
- package/dist/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +18 -0
- package/dist/api/resources/conversation/types/Capability.js +8 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +14 -4
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
- package/dist/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/dist/api/resources/conversation/types/Sentiment.js +10 -0
- package/dist/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
- package/dist/api/resources/conversation/types/UserMessage.d.ts +3 -3
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +9 -3
- package/dist/api/resources/conversation/types/index.js +9 -3
- package/dist/api/resources/index.d.ts +6 -2
- package/dist/api/resources/index.js +6 -2
- package/dist/api/resources/knowledge/client/Client.d.ts +86 -74
- package/dist/api/resources/knowledge/client/Client.js +240 -175
- package/dist/api/resources/knowledge/index.d.ts +0 -1
- package/dist/api/resources/knowledge/index.js +0 -1
- package/{api/resources/knowledge/types/KnowledgeDocument.d.ts → dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +7 -5
- package/dist/api/resources/knowledge/types/index.js +7 -5
- package/dist/api/resources/triggers/client/Client.d.ts +83 -0
- package/dist/api/resources/triggers/client/Client.js +306 -0
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/triggers/client/index.js +1 -0
- package/dist/api/resources/triggers/index.d.ts +2 -0
- package/dist/api/resources/triggers/index.js +2 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +1 -0
- package/dist/api/resources/triggers/types/index.js +1 -0
- package/dist/api/resources/users/client/Client.d.ts +77 -0
- package/dist/api/resources/users/client/Client.js +230 -0
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/index.js +1 -0
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +18 -159
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +32 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +19 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +38 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +28 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +32 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +8 -4
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +46 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +1 -0
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/actions/index.d.ts +1 -0
- package/dist/serialization/resources/actions/index.js +1 -0
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/serialization/resources/actions/types/ActionBase.js +14 -0
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/Precondition.js +19 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/index.d.ts +13 -0
- package/dist/serialization/resources/actions/types/index.js +13 -0
- package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/dist/serialization/resources/appSettings/client/get.js +5 -0
- package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/client/index.js +1 -0
- package/dist/serialization/resources/appSettings/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/index.js +1 -0
- package/dist/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AppUser.js +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/knowledge/types/IdBody.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/dist/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +16 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/dist/serialization/resources/commons/types/Feedback.js +13 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{serialization/resources/conversation → dist/serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/dist/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/dist/serialization/resources/commons/types/UserData.js +9 -0
- package/dist/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/dist/serialization/resources/commons/types/index.d.ts +16 -1
- package/dist/serialization/resources/commons/types/index.js +16 -1
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/dist/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/dist/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Capability.js +5 -0
- package/dist/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/dist/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/dist/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/dist/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +9 -3
- package/dist/serialization/resources/conversation/types/index.js +9 -3
- package/dist/serialization/resources/index.d.ts +5 -0
- package/dist/serialization/resources/index.js +5 -0
- package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{serialization/resources/knowledge/types/KnowledgeDocument.js → dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{serialization/resources/knowledge/types/KnowledgeBase.d.ts → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/dist/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/dist/serialization/resources/knowledge/types/index.js +7 -5
- package/dist/serialization/resources/triggers/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/index.js +1 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/types/index.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -2
- package/reference.md +1876 -0
- package/serialization/resources/actions/index.d.ts +1 -0
- package/serialization/resources/actions/index.js +1 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +18 -0
- package/serialization/resources/actions/types/ActionBase.js +14 -0
- package/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/serialization/resources/actions/types/Precondition.js +19 -0
- package/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/serialization/resources/actions/types/index.d.ts +13 -0
- package/serialization/resources/actions/types/index.js +13 -0
- package/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/serialization/resources/appSettings/client/get.js +5 -0
- package/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/serialization/resources/appSettings/client/index.js +1 -0
- package/serialization/resources/appSettings/index.d.ts +1 -0
- package/serialization/resources/appSettings/index.js +1 -0
- package/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/serialization/resources/commons/types/AppUser.js +10 -0
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
- package/serialization/resources/commons/types/AppUserResponse.js +13 -0
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/knowledge/types/IdBody.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
- package/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +16 -0
- package/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerBase.js +9 -0
- package/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/commons/types/EventTriggerType.js +5 -0
- package/serialization/resources/commons/types/Feedback.d.ts +16 -0
- package/serialization/resources/commons/types/Feedback.js +13 -0
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/{dist/serialization/resources/conversation → serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
- package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
- package/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/serialization/resources/commons/types/UserData.js +9 -0
- package/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/serialization/resources/commons/types/index.d.ts +16 -1
- package/serialization/resources/commons/types/index.js +16 -1
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
- package/serialization/resources/conversation/types/AskRequest.js +3 -3
- package/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
- package/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/serialization/resources/conversation/types/Capability.d.ts +10 -0
- package/serialization/resources/conversation/types/Capability.js +5 -0
- package/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
- package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
- package/serialization/resources/conversation/types/ConversationBase.js +8 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +4 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
- package/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/serialization/resources/conversation/types/ResponseLength.js +5 -0
- package/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
- package/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
- package/serialization/resources/conversation/types/UserMessage.js +4 -5
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/serialization/resources/conversation/types/index.d.ts +9 -3
- package/serialization/resources/conversation/types/index.js +9 -3
- package/serialization/resources/index.d.ts +5 -0
- package/serialization/resources/index.js +5 -0
- package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
- package/{dist/serialization/resources/knowledge/types/KnowledgeDocument.js → serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
- package/{dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts → serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
- package/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/serialization/resources/knowledge/types/index.d.ts +7 -5
- package/serialization/resources/knowledge/types/index.js +7 -5
- package/serialization/resources/triggers/index.d.ts +1 -0
- package/serialization/resources/triggers/index.js +1 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +1 -0
- package/serialization/resources/triggers/types/index.js +1 -0
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/api/resources/commons/types/User.d.ts +0 -9
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/api/resources/conversation/errors/index.d.ts +0 -7
- package/api/resources/conversation/errors/index.js +0 -7
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/api/resources/knowledge/errors/index.d.ts +0 -6
- package/api/resources/knowledge/errors/index.js +0 -6
- package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/api/resources/commons/types/User.d.ts +0 -9
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
- package/dist/api/resources/conversation/errors/index.d.ts +0 -7
- package/dist/api/resources/conversation/errors/index.js +0 -7
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
- package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
- package/dist/api/resources/knowledge/errors/index.js +0 -6
- package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
- package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
- package/dist/serialization/resources/commons/types/User.js +0 -9
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- package/serialization/resources/commons/types/User.js +0 -9
- package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
- package/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
- /package/api/resources/{commons/types/User.js → actions/types/ActionBase.js} +0 -0
- /package/api/resources/{conversation/types/ConversationContext.js → actions/types/ActionParameter.js} +0 -0
- /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/ActionRequest.js} +0 -0
- /package/api/resources/{knowledge/types/IdBody.js → actions/types/ActionResponse.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBase.js → actions/types/ConversationExecutedActionPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeBaseId.js → actions/types/ConversationPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocument.js → actions/types/MetadataPrecondition.js} +0 -0
- /package/api/resources/{knowledge/types/KnowledgeDocumentId.js → actions/types/Precondition.js} +0 -0
- /package/{dist/api/resources/commons/types/User.js → api/resources/actions/types/PreconditionBase.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/actions/types/PreconditionGroup.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/actions/types/TagsPrecondition.js} +0 -0
- /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/commons/types/AppUser.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBase.js → api/resources/commons/types/AppUserIdentifier.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeBaseId.js → api/resources/commons/types/AppUserRequest.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/commons/types/AppUserResponse.js} +0 -0
- /package/{dist/api/resources/knowledge/types/KnowledgeDocumentId.js → api/resources/commons/types/EntityId.js} +0 -0
|
@@ -21,45 +21,50 @@ export class Knowledge {
|
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Update a knowledge base or create it if it doesn't exist.
|
|
25
25
|
*
|
|
26
|
-
* @param {MavenAGI.
|
|
26
|
+
* @param {MavenAGI.KnowledgeBaseRequest} 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
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* await client.knowledge.createOrUpdateKnowledgeBase({
|
|
35
|
+
* knowledgeBaseId: {
|
|
36
|
+
* referenceId: "help-center"
|
|
37
|
+
* },
|
|
38
|
+
* name: "Help center",
|
|
39
|
+
* type: "API"
|
|
37
40
|
* })
|
|
38
41
|
*/
|
|
39
|
-
|
|
40
|
-
var _a, _b
|
|
42
|
+
createOrUpdateKnowledgeBase(request, requestOptions) {
|
|
43
|
+
var _a, _b;
|
|
41
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
45
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
43
46
|
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge"),
|
|
44
|
-
method: "
|
|
47
|
+
method: "PUT",
|
|
45
48
|
headers: {
|
|
46
49
|
Authorization: yield this._getAuthorizationHeader(),
|
|
47
50
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
48
51
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
49
52
|
"X-Fern-Language": "JavaScript",
|
|
50
53
|
"X-Fern-SDK-Name": "mavenagi",
|
|
51
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
54
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
55
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
52
56
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
57
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
58
|
},
|
|
55
59
|
contentType: "application/json",
|
|
56
|
-
|
|
60
|
+
requestType: "json",
|
|
61
|
+
body: serializers.KnowledgeBaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
57
62
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
58
63
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
59
64
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
60
65
|
});
|
|
61
66
|
if (_response.ok) {
|
|
62
|
-
return
|
|
67
|
+
return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
|
|
63
68
|
unrecognizedObjectKeys: "passthrough",
|
|
64
69
|
allowUnrecognizedUnionMembers: true,
|
|
65
70
|
allowUnrecognizedEnumValues: true,
|
|
@@ -67,9 +72,23 @@ export class Knowledge {
|
|
|
67
72
|
});
|
|
68
73
|
}
|
|
69
74
|
if (_response.error.reason === "status-code") {
|
|
70
|
-
switch (
|
|
71
|
-
case
|
|
72
|
-
throw new MavenAGI.
|
|
75
|
+
switch (_response.error.statusCode) {
|
|
76
|
+
case 404:
|
|
77
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
78
|
+
unrecognizedObjectKeys: "passthrough",
|
|
79
|
+
allowUnrecognizedUnionMembers: true,
|
|
80
|
+
allowUnrecognizedEnumValues: true,
|
|
81
|
+
breadcrumbsPrefix: ["response"],
|
|
82
|
+
}));
|
|
83
|
+
case 400:
|
|
84
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
85
|
+
unrecognizedObjectKeys: "passthrough",
|
|
86
|
+
allowUnrecognizedUnionMembers: true,
|
|
87
|
+
allowUnrecognizedEnumValues: true,
|
|
88
|
+
breadcrumbsPrefix: ["response"],
|
|
89
|
+
}));
|
|
90
|
+
case 500:
|
|
91
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
73
92
|
unrecognizedObjectKeys: "passthrough",
|
|
74
93
|
allowUnrecognizedUnionMembers: true,
|
|
75
94
|
allowUnrecognizedEnumValues: true,
|
|
@@ -98,46 +117,43 @@ export class Knowledge {
|
|
|
98
117
|
});
|
|
99
118
|
}
|
|
100
119
|
/**
|
|
101
|
-
*
|
|
120
|
+
* Get an existing knowledge base by its supplied ID
|
|
102
121
|
*
|
|
103
|
-
* @param {
|
|
122
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to get. All other entity ID fields are inferred from the request.
|
|
104
123
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
124
|
*
|
|
106
|
-
* @throws {@link MavenAGI.
|
|
107
|
-
* @throws {@link MavenAGI.
|
|
108
|
-
* @throws {@link MavenAGI.
|
|
109
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
125
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
126
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
127
|
+
* @throws {@link MavenAGI.ServerError}
|
|
110
128
|
*
|
|
111
129
|
* @example
|
|
112
|
-
* await
|
|
113
|
-
* knowledgeBaseId: "string",
|
|
114
|
-
* type: MavenAGI.KnowledgeBaseVersionType.Full
|
|
115
|
-
* })
|
|
130
|
+
* await client.knowledge.getKnowledgeBase("help-center")
|
|
116
131
|
*/
|
|
117
|
-
|
|
118
|
-
var _a, _b
|
|
132
|
+
getKnowledgeBase(knowledgeBaseReferenceId, requestOptions) {
|
|
133
|
+
var _a, _b;
|
|
119
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
135
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
121
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
122
|
-
method: "
|
|
136
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}`),
|
|
137
|
+
method: "GET",
|
|
123
138
|
headers: {
|
|
124
139
|
Authorization: yield this._getAuthorizationHeader(),
|
|
125
140
|
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
126
141
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
127
142
|
"X-Fern-Language": "JavaScript",
|
|
128
143
|
"X-Fern-SDK-Name": "mavenagi",
|
|
129
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
144
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
145
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
130
146
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
131
147
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
132
148
|
},
|
|
133
149
|
contentType: "application/json",
|
|
134
|
-
|
|
150
|
+
requestType: "json",
|
|
135
151
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
136
152
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
137
153
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
138
154
|
});
|
|
139
155
|
if (_response.ok) {
|
|
140
|
-
return
|
|
156
|
+
return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
|
|
141
157
|
unrecognizedObjectKeys: "passthrough",
|
|
142
158
|
allowUnrecognizedUnionMembers: true,
|
|
143
159
|
allowUnrecognizedEnumValues: true,
|
|
@@ -145,30 +161,23 @@ export class Knowledge {
|
|
|
145
161
|
});
|
|
146
162
|
}
|
|
147
163
|
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, {
|
|
164
|
+
switch (_response.error.statusCode) {
|
|
165
|
+
case 404:
|
|
166
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
158
167
|
unrecognizedObjectKeys: "passthrough",
|
|
159
168
|
allowUnrecognizedUnionMembers: true,
|
|
160
169
|
allowUnrecognizedEnumValues: true,
|
|
161
170
|
breadcrumbsPrefix: ["response"],
|
|
162
171
|
}));
|
|
163
|
-
case
|
|
164
|
-
throw new MavenAGI.
|
|
172
|
+
case 400:
|
|
173
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
165
174
|
unrecognizedObjectKeys: "passthrough",
|
|
166
175
|
allowUnrecognizedUnionMembers: true,
|
|
167
176
|
allowUnrecognizedEnumValues: true,
|
|
168
177
|
breadcrumbsPrefix: ["response"],
|
|
169
178
|
}));
|
|
170
|
-
case
|
|
171
|
-
throw new MavenAGI.
|
|
179
|
+
case 500:
|
|
180
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
172
181
|
unrecognizedObjectKeys: "passthrough",
|
|
173
182
|
allowUnrecognizedUnionMembers: true,
|
|
174
183
|
allowUnrecognizedEnumValues: true,
|
|
@@ -197,26 +206,26 @@ export class Knowledge {
|
|
|
197
206
|
});
|
|
198
207
|
}
|
|
199
208
|
/**
|
|
200
|
-
*
|
|
209
|
+
* Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
|
|
201
210
|
*
|
|
202
|
-
* @param {
|
|
211
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a version for. All other entity ID fields are inferred from the request.
|
|
212
|
+
* @param {MavenAGI.KnowledgeBaseVersion} request
|
|
203
213
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
204
214
|
*
|
|
205
|
-
* @throws {@link MavenAGI.
|
|
206
|
-
* @throws {@link MavenAGI.
|
|
207
|
-
* @throws {@link MavenAGI.
|
|
208
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
215
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
216
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
217
|
+
* @throws {@link MavenAGI.ServerError}
|
|
209
218
|
*
|
|
210
219
|
* @example
|
|
211
|
-
* await
|
|
212
|
-
*
|
|
220
|
+
* await client.knowledge.createKnowledgeBaseVersion("help-center", {
|
|
221
|
+
* type: "FULL"
|
|
213
222
|
* })
|
|
214
223
|
*/
|
|
215
|
-
|
|
216
|
-
var _a, _b
|
|
224
|
+
createKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions) {
|
|
225
|
+
var _a, _b;
|
|
217
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
227
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
219
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
228
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version`),
|
|
220
229
|
method: "POST",
|
|
221
230
|
headers: {
|
|
222
231
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -224,44 +233,128 @@ export class Knowledge {
|
|
|
224
233
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
225
234
|
"X-Fern-Language": "JavaScript",
|
|
226
235
|
"X-Fern-SDK-Name": "mavenagi",
|
|
227
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
236
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
237
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
228
238
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
229
239
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
230
240
|
},
|
|
231
241
|
contentType: "application/json",
|
|
232
|
-
|
|
242
|
+
requestType: "json",
|
|
243
|
+
body: serializers.KnowledgeBaseVersion.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
233
244
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
234
245
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
235
246
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
247
|
});
|
|
237
248
|
if (_response.ok) {
|
|
238
|
-
return
|
|
249
|
+
return serializers.KnowledgeBaseVersion.parseOrThrow(_response.body, {
|
|
250
|
+
unrecognizedObjectKeys: "passthrough",
|
|
251
|
+
allowUnrecognizedUnionMembers: true,
|
|
252
|
+
allowUnrecognizedEnumValues: true,
|
|
253
|
+
breadcrumbsPrefix: ["response"],
|
|
254
|
+
});
|
|
239
255
|
}
|
|
240
256
|
if (_response.error.reason === "status-code") {
|
|
241
|
-
switch (
|
|
242
|
-
case
|
|
243
|
-
throw new MavenAGI.
|
|
257
|
+
switch (_response.error.statusCode) {
|
|
258
|
+
case 404:
|
|
259
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
260
|
+
unrecognizedObjectKeys: "passthrough",
|
|
261
|
+
allowUnrecognizedUnionMembers: true,
|
|
262
|
+
allowUnrecognizedEnumValues: true,
|
|
263
|
+
breadcrumbsPrefix: ["response"],
|
|
264
|
+
}));
|
|
265
|
+
case 400:
|
|
266
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
244
267
|
unrecognizedObjectKeys: "passthrough",
|
|
245
268
|
allowUnrecognizedUnionMembers: true,
|
|
246
269
|
allowUnrecognizedEnumValues: true,
|
|
247
270
|
breadcrumbsPrefix: ["response"],
|
|
248
271
|
}));
|
|
249
|
-
case
|
|
250
|
-
throw new MavenAGI.
|
|
272
|
+
case 500:
|
|
273
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
274
|
+
unrecognizedObjectKeys: "passthrough",
|
|
275
|
+
allowUnrecognizedUnionMembers: true,
|
|
276
|
+
allowUnrecognizedEnumValues: true,
|
|
277
|
+
breadcrumbsPrefix: ["response"],
|
|
278
|
+
}));
|
|
279
|
+
default:
|
|
280
|
+
throw new errors.MavenAGIError({
|
|
281
|
+
statusCode: _response.error.statusCode,
|
|
282
|
+
body: _response.error.body,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
switch (_response.error.reason) {
|
|
287
|
+
case "non-json":
|
|
288
|
+
throw new errors.MavenAGIError({
|
|
289
|
+
statusCode: _response.error.statusCode,
|
|
290
|
+
body: _response.error.rawBody,
|
|
291
|
+
});
|
|
292
|
+
case "timeout":
|
|
293
|
+
throw new errors.MavenAGITimeoutError();
|
|
294
|
+
case "unknown":
|
|
295
|
+
throw new errors.MavenAGIError({
|
|
296
|
+
message: _response.error.errorMessage,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* 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.
|
|
303
|
+
*
|
|
304
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to finalize a version for. All other entity ID fields are inferred from the request.
|
|
305
|
+
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
306
|
+
*
|
|
307
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
308
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
309
|
+
* @throws {@link MavenAGI.ServerError}
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* await client.knowledge.finalizeKnowledgeBaseVersion("help-center")
|
|
313
|
+
*/
|
|
314
|
+
finalizeKnowledgeBaseVersion(knowledgeBaseReferenceId, requestOptions) {
|
|
315
|
+
var _a, _b;
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
318
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version/finalize`),
|
|
319
|
+
method: "POST",
|
|
320
|
+
headers: {
|
|
321
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
322
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
323
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
324
|
+
"X-Fern-Language": "JavaScript",
|
|
325
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
326
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
327
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
328
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
329
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
330
|
+
},
|
|
331
|
+
contentType: "application/json",
|
|
332
|
+
requestType: "json",
|
|
333
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
334
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
335
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
336
|
+
});
|
|
337
|
+
if (_response.ok) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (_response.error.reason === "status-code") {
|
|
341
|
+
switch (_response.error.statusCode) {
|
|
342
|
+
case 404:
|
|
343
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
251
344
|
unrecognizedObjectKeys: "passthrough",
|
|
252
345
|
allowUnrecognizedUnionMembers: true,
|
|
253
346
|
allowUnrecognizedEnumValues: true,
|
|
254
347
|
breadcrumbsPrefix: ["response"],
|
|
255
348
|
}));
|
|
256
|
-
case
|
|
257
|
-
throw new MavenAGI.
|
|
349
|
+
case 400:
|
|
350
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
258
351
|
unrecognizedObjectKeys: "passthrough",
|
|
259
352
|
allowUnrecognizedUnionMembers: true,
|
|
260
353
|
allowUnrecognizedEnumValues: true,
|
|
261
354
|
breadcrumbsPrefix: ["response"],
|
|
262
355
|
}));
|
|
263
|
-
case
|
|
264
|
-
throw new MavenAGI.
|
|
356
|
+
case 500:
|
|
357
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
358
|
unrecognizedObjectKeys: "passthrough",
|
|
266
359
|
allowUnrecognizedUnionMembers: true,
|
|
267
360
|
allowUnrecognizedEnumValues: true,
|
|
@@ -290,35 +383,31 @@ export class Knowledge {
|
|
|
290
383
|
});
|
|
291
384
|
}
|
|
292
385
|
/**
|
|
293
|
-
* Create knowledge document
|
|
386
|
+
* 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
387
|
*
|
|
295
|
-
* @param {
|
|
388
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a document for. All other entity ID fields are inferred from the request.
|
|
389
|
+
* @param {MavenAGI.KnowledgeDocumentRequest} request
|
|
296
390
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
297
391
|
*
|
|
298
|
-
* @throws {@link MavenAGI.
|
|
299
|
-
* @throws {@link MavenAGI.
|
|
300
|
-
* @throws {@link MavenAGI.
|
|
301
|
-
* @throws {@link MavenAGI.DocumentCreationError}
|
|
302
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
392
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
393
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
394
|
+
* @throws {@link MavenAGI.ServerError}
|
|
303
395
|
*
|
|
304
396
|
* @example
|
|
305
|
-
* await
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* author: "string",
|
|
313
|
-
* knowledgeBaseId: "string",
|
|
314
|
-
* documentId: "string"
|
|
397
|
+
* await client.knowledge.createKnowledgeDocument("help-center", {
|
|
398
|
+
* knowledgeDocumentId: {
|
|
399
|
+
* referenceId: "getting-started"
|
|
400
|
+
* },
|
|
401
|
+
* contentType: "MARKDOWN",
|
|
402
|
+
* content: "## Getting started\\nThis is a getting started guide for the help center.",
|
|
403
|
+
* title: "Getting started"
|
|
315
404
|
* })
|
|
316
405
|
*/
|
|
317
|
-
createKnowledgeDocument(request, requestOptions) {
|
|
318
|
-
var _a, _b
|
|
406
|
+
createKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
|
|
407
|
+
var _a, _b;
|
|
319
408
|
return __awaiter(this, void 0, void 0, function* () {
|
|
320
409
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
321
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
410
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
|
|
322
411
|
method: "POST",
|
|
323
412
|
headers: {
|
|
324
413
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -326,18 +415,20 @@ export class Knowledge {
|
|
|
326
415
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
327
416
|
"X-Fern-Language": "JavaScript",
|
|
328
417
|
"X-Fern-SDK-Name": "mavenagi",
|
|
329
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
418
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
419
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
330
420
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
331
421
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
332
422
|
},
|
|
333
423
|
contentType: "application/json",
|
|
334
|
-
|
|
424
|
+
requestType: "json",
|
|
425
|
+
body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
335
426
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
336
427
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
337
428
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
338
429
|
});
|
|
339
430
|
if (_response.ok) {
|
|
340
|
-
return
|
|
431
|
+
return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
341
432
|
unrecognizedObjectKeys: "passthrough",
|
|
342
433
|
allowUnrecognizedUnionMembers: true,
|
|
343
434
|
allowUnrecognizedEnumValues: true,
|
|
@@ -345,32 +436,23 @@ export class Knowledge {
|
|
|
345
436
|
});
|
|
346
437
|
}
|
|
347
438
|
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, {
|
|
439
|
+
switch (_response.error.statusCode) {
|
|
440
|
+
case 404:
|
|
441
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
358
442
|
unrecognizedObjectKeys: "passthrough",
|
|
359
443
|
allowUnrecognizedUnionMembers: true,
|
|
360
444
|
allowUnrecognizedEnumValues: true,
|
|
361
445
|
breadcrumbsPrefix: ["response"],
|
|
362
446
|
}));
|
|
363
|
-
case
|
|
364
|
-
throw new MavenAGI.
|
|
447
|
+
case 400:
|
|
448
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
365
449
|
unrecognizedObjectKeys: "passthrough",
|
|
366
450
|
allowUnrecognizedUnionMembers: true,
|
|
367
451
|
allowUnrecognizedEnumValues: true,
|
|
368
452
|
breadcrumbsPrefix: ["response"],
|
|
369
453
|
}));
|
|
370
|
-
case
|
|
371
|
-
throw new MavenAGI.
|
|
372
|
-
case "AgentNotFoundError":
|
|
373
|
-
throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
454
|
+
case 500:
|
|
455
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
374
456
|
unrecognizedObjectKeys: "passthrough",
|
|
375
457
|
allowUnrecognizedUnionMembers: true,
|
|
376
458
|
allowUnrecognizedEnumValues: true,
|
|
@@ -399,34 +481,31 @@ export class Knowledge {
|
|
|
399
481
|
});
|
|
400
482
|
}
|
|
401
483
|
/**
|
|
402
|
-
* Update knowledge document
|
|
484
|
+
* Not yet implemented. 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
485
|
*
|
|
404
|
-
* @param {
|
|
486
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to update. All other entity ID fields are inferred from the request.
|
|
487
|
+
* @param {MavenAGI.KnowledgeDocumentRequest} request
|
|
405
488
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
406
489
|
*
|
|
407
|
-
* @throws {@link MavenAGI.
|
|
408
|
-
* @throws {@link MavenAGI.
|
|
409
|
-
* @throws {@link MavenAGI.
|
|
410
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
490
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
491
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
492
|
+
* @throws {@link MavenAGI.ServerError}
|
|
411
493
|
*
|
|
412
494
|
* @example
|
|
413
|
-
* await
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
* author: "string",
|
|
421
|
-
* knowledgeBaseId: "string",
|
|
422
|
-
* documentId: "string"
|
|
495
|
+
* await client.knowledge.updateKnowledgeDocument("help-center", {
|
|
496
|
+
* knowledgeDocumentId: {
|
|
497
|
+
* referenceId: "getting-started"
|
|
498
|
+
* },
|
|
499
|
+
* contentType: "MARKDOWN",
|
|
500
|
+
* content: "## Getting started\\nThis is a getting started guide for the help center.",
|
|
501
|
+
* title: "Getting started"
|
|
423
502
|
* })
|
|
424
503
|
*/
|
|
425
|
-
updateKnowledgeDocument(request, requestOptions) {
|
|
426
|
-
var _a, _b
|
|
504
|
+
updateKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
|
|
505
|
+
var _a, _b;
|
|
427
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
428
507
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
429
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
508
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
|
|
430
509
|
method: "PUT",
|
|
431
510
|
headers: {
|
|
432
511
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -434,18 +513,20 @@ export class Knowledge {
|
|
|
434
513
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
435
514
|
"X-Fern-Language": "JavaScript",
|
|
436
515
|
"X-Fern-SDK-Name": "mavenagi",
|
|
437
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
516
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
517
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
438
518
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
439
519
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
440
520
|
},
|
|
441
521
|
contentType: "application/json",
|
|
442
|
-
|
|
522
|
+
requestType: "json",
|
|
523
|
+
body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
443
524
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
444
525
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
445
526
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
446
527
|
});
|
|
447
528
|
if (_response.ok) {
|
|
448
|
-
return
|
|
529
|
+
return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
|
|
449
530
|
unrecognizedObjectKeys: "passthrough",
|
|
450
531
|
allowUnrecognizedUnionMembers: true,
|
|
451
532
|
allowUnrecognizedEnumValues: true,
|
|
@@ -453,30 +534,23 @@ export class Knowledge {
|
|
|
453
534
|
});
|
|
454
535
|
}
|
|
455
536
|
if (_response.error.reason === "status-code") {
|
|
456
|
-
switch (
|
|
457
|
-
case
|
|
458
|
-
throw new MavenAGI.
|
|
537
|
+
switch (_response.error.statusCode) {
|
|
538
|
+
case 404:
|
|
539
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
459
540
|
unrecognizedObjectKeys: "passthrough",
|
|
460
541
|
allowUnrecognizedUnionMembers: true,
|
|
461
542
|
allowUnrecognizedEnumValues: true,
|
|
462
543
|
breadcrumbsPrefix: ["response"],
|
|
463
544
|
}));
|
|
464
|
-
case
|
|
465
|
-
throw new MavenAGI.
|
|
545
|
+
case 400:
|
|
546
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
466
547
|
unrecognizedObjectKeys: "passthrough",
|
|
467
548
|
allowUnrecognizedUnionMembers: true,
|
|
468
549
|
allowUnrecognizedEnumValues: true,
|
|
469
550
|
breadcrumbsPrefix: ["response"],
|
|
470
551
|
}));
|
|
471
|
-
case
|
|
472
|
-
throw new MavenAGI.
|
|
473
|
-
unrecognizedObjectKeys: "passthrough",
|
|
474
|
-
allowUnrecognizedUnionMembers: true,
|
|
475
|
-
allowUnrecognizedEnumValues: true,
|
|
476
|
-
breadcrumbsPrefix: ["response"],
|
|
477
|
-
}));
|
|
478
|
-
case "AgentNotFoundError":
|
|
479
|
-
throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
552
|
+
case 500:
|
|
553
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
480
554
|
unrecognizedObjectKeys: "passthrough",
|
|
481
555
|
allowUnrecognizedUnionMembers: true,
|
|
482
556
|
allowUnrecognizedEnumValues: true,
|
|
@@ -505,27 +579,24 @@ export class Knowledge {
|
|
|
505
579
|
});
|
|
506
580
|
}
|
|
507
581
|
/**
|
|
508
|
-
* Delete knowledge document
|
|
582
|
+
* Not yet implemented. 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
583
|
*
|
|
510
|
-
* @param {
|
|
584
|
+
* @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to delete. All other entity ID fields are inferred from the request
|
|
585
|
+
* @param {string} knowledgeDocumentReferenceId - The reference ID of the knowledge document to delete. All other entity ID fields are inferred from the request.
|
|
511
586
|
* @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
|
|
512
587
|
*
|
|
513
|
-
* @throws {@link MavenAGI.
|
|
514
|
-
* @throws {@link MavenAGI.
|
|
515
|
-
* @throws {@link MavenAGI.
|
|
516
|
-
* @throws {@link MavenAGI.AgentNotFoundError}
|
|
588
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
589
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
590
|
+
* @throws {@link MavenAGI.ServerError}
|
|
517
591
|
*
|
|
518
592
|
* @example
|
|
519
|
-
* await
|
|
520
|
-
* knowledgeBaseId: "string",
|
|
521
|
-
* documentId: "string"
|
|
522
|
-
* })
|
|
593
|
+
* await client.knowledge.deleteKnowledgeDocument("help-center", "getting-started")
|
|
523
594
|
*/
|
|
524
|
-
deleteKnowledgeDocument(
|
|
525
|
-
var _a, _b
|
|
595
|
+
deleteKnowledgeDocument(knowledgeBaseReferenceId, knowledgeDocumentReferenceId, requestOptions) {
|
|
596
|
+
var _a, _b;
|
|
526
597
|
return __awaiter(this, void 0, void 0, function* () {
|
|
527
598
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
528
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production,
|
|
599
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/${encodeURIComponent(knowledgeDocumentReferenceId)}/document`),
|
|
529
600
|
method: "DELETE",
|
|
530
601
|
headers: {
|
|
531
602
|
Authorization: yield this._getAuthorizationHeader(),
|
|
@@ -533,12 +604,13 @@ export class Knowledge {
|
|
|
533
604
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
534
605
|
"X-Fern-Language": "JavaScript",
|
|
535
606
|
"X-Fern-SDK-Name": "mavenagi",
|
|
536
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
607
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
608
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
537
609
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
538
610
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
539
611
|
},
|
|
540
612
|
contentType: "application/json",
|
|
541
|
-
|
|
613
|
+
requestType: "json",
|
|
542
614
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
543
615
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
544
616
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -547,30 +619,23 @@ export class Knowledge {
|
|
|
547
619
|
return;
|
|
548
620
|
}
|
|
549
621
|
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, {
|
|
622
|
+
switch (_response.error.statusCode) {
|
|
623
|
+
case 404:
|
|
624
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
560
625
|
unrecognizedObjectKeys: "passthrough",
|
|
561
626
|
allowUnrecognizedUnionMembers: true,
|
|
562
627
|
allowUnrecognizedEnumValues: true,
|
|
563
628
|
breadcrumbsPrefix: ["response"],
|
|
564
629
|
}));
|
|
565
|
-
case
|
|
566
|
-
throw new MavenAGI.
|
|
630
|
+
case 400:
|
|
631
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
567
632
|
unrecognizedObjectKeys: "passthrough",
|
|
568
633
|
allowUnrecognizedUnionMembers: true,
|
|
569
634
|
allowUnrecognizedEnumValues: true,
|
|
570
635
|
breadcrumbsPrefix: ["response"],
|
|
571
636
|
}));
|
|
572
|
-
case
|
|
573
|
-
throw new MavenAGI.
|
|
637
|
+
case 500:
|
|
638
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
574
639
|
unrecognizedObjectKeys: "passthrough",
|
|
575
640
|
allowUnrecognizedUnionMembers: true,
|
|
576
641
|
allowUnrecognizedEnumValues: true,
|