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
package/Client.d.ts
CHANGED
|
@@ -3,28 +3,49 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
+
import { Actions } from "./api/resources/actions/client/Client";
|
|
7
|
+
import { AppSettings } from "./api/resources/appSettings/client/Client";
|
|
6
8
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
7
9
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
10
|
+
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
11
|
+
import { Users } from "./api/resources/users/client/Client";
|
|
8
12
|
export declare namespace MavenAGIClient {
|
|
9
13
|
interface Options {
|
|
10
14
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
11
15
|
appId?: core.Supplier<string | undefined>;
|
|
12
16
|
appSecret?: core.Supplier<string | undefined>;
|
|
17
|
+
/** Override the X-Organization-Id header */
|
|
13
18
|
organizationId: core.Supplier<string>;
|
|
19
|
+
/** Override the X-Agent-Id header */
|
|
14
20
|
agentId: core.Supplier<string>;
|
|
15
21
|
fetcher?: core.FetchFunction;
|
|
16
22
|
}
|
|
17
23
|
interface RequestOptions {
|
|
24
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
25
|
timeoutInSeconds?: number;
|
|
26
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
27
|
maxRetries?: number;
|
|
28
|
+
/** A hook to abort the request. */
|
|
20
29
|
abortSignal?: AbortSignal;
|
|
30
|
+
/** Override the X-Organization-Id header */
|
|
31
|
+
organizationId?: string;
|
|
32
|
+
/** Override the X-Agent-Id header */
|
|
33
|
+
agentId?: string;
|
|
21
34
|
}
|
|
22
35
|
}
|
|
23
36
|
export declare class MavenAGIClient {
|
|
24
37
|
protected readonly _options: MavenAGIClient.Options;
|
|
25
38
|
constructor(_options: MavenAGIClient.Options);
|
|
39
|
+
protected _actions: Actions | undefined;
|
|
40
|
+
get actions(): Actions;
|
|
41
|
+
protected _appSettings: AppSettings | undefined;
|
|
42
|
+
get appSettings(): AppSettings;
|
|
26
43
|
protected _conversation: Conversation | undefined;
|
|
27
44
|
get conversation(): Conversation;
|
|
28
45
|
protected _knowledge: Knowledge | undefined;
|
|
29
46
|
get knowledge(): Knowledge;
|
|
47
|
+
protected _triggers: Triggers | undefined;
|
|
48
|
+
get triggers(): Triggers;
|
|
49
|
+
protected _users: Users | undefined;
|
|
50
|
+
get users(): Users;
|
|
30
51
|
}
|
package/Client.js
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import { Actions } from "./api/resources/actions/client/Client";
|
|
5
|
+
import { AppSettings } from "./api/resources/appSettings/client/Client";
|
|
4
6
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
5
7
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
8
|
+
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
9
|
+
import { Users } from "./api/resources/users/client/Client";
|
|
6
10
|
export class MavenAGIClient {
|
|
7
11
|
constructor(_options) {
|
|
8
12
|
this._options = _options;
|
|
9
13
|
}
|
|
14
|
+
get actions() {
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Actions(this._options)));
|
|
17
|
+
}
|
|
18
|
+
get appSettings() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = this._appSettings) !== null && _a !== void 0 ? _a : (this._appSettings = new AppSettings(this._options)));
|
|
21
|
+
}
|
|
10
22
|
get conversation() {
|
|
11
23
|
var _a;
|
|
12
24
|
return ((_a = this._conversation) !== null && _a !== void 0 ? _a : (this._conversation = new Conversation(this._options)));
|
|
@@ -15,4 +27,12 @@ export class MavenAGIClient {
|
|
|
15
27
|
var _a;
|
|
16
28
|
return ((_a = this._knowledge) !== null && _a !== void 0 ? _a : (this._knowledge = new Knowledge(this._options)));
|
|
17
29
|
}
|
|
30
|
+
get triggers() {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
33
|
+
}
|
|
34
|
+
get users() {
|
|
35
|
+
var _a;
|
|
36
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Users(this._options)));
|
|
37
|
+
}
|
|
18
38
|
}
|
package/README.md
CHANGED
|
@@ -18,16 +18,43 @@ Instantiate and use the client with the following:
|
|
|
18
18
|
```typescript
|
|
19
19
|
import { MavenAGIClient } from "mavenagi";
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const client = new MavenAGIClient({
|
|
22
22
|
appId: "YOUR_APP_ID",
|
|
23
23
|
appSecret: "YOUR_APP_SECRET",
|
|
24
24
|
organizationId: "YOUR_ORGANIZATION_ID",
|
|
25
25
|
agentId: "YOUR_AGENT_ID",
|
|
26
26
|
});
|
|
27
|
-
await
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
await client.conversation.initialize({
|
|
28
|
+
conversationId: {
|
|
29
|
+
referenceId: "string",
|
|
30
|
+
},
|
|
31
|
+
messages: [
|
|
32
|
+
{
|
|
33
|
+
conversationMessageId: {
|
|
34
|
+
referenceId: "string",
|
|
35
|
+
},
|
|
36
|
+
userId: {
|
|
37
|
+
referenceId: "string",
|
|
38
|
+
},
|
|
39
|
+
text: "string",
|
|
40
|
+
userMessageType: "USER",
|
|
41
|
+
createdAt: "2024-01-15T09:30:00Z",
|
|
42
|
+
updatedAt: "2024-01-15T09:30:00Z",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
responseConfig: {
|
|
46
|
+
capabilities: ["MARKDOWN"],
|
|
47
|
+
isCopilot: true,
|
|
48
|
+
responseLength: "SHORT",
|
|
49
|
+
},
|
|
50
|
+
subject: "string",
|
|
51
|
+
url: "string",
|
|
52
|
+
createdAt: "2024-01-15T09:30:00Z",
|
|
53
|
+
updatedAt: "2024-01-15T09:30:00Z",
|
|
54
|
+
tags: new Set(["string"]),
|
|
55
|
+
metadata: {
|
|
56
|
+
string: "string",
|
|
57
|
+
},
|
|
31
58
|
});
|
|
32
59
|
```
|
|
33
60
|
|
|
@@ -37,10 +64,10 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
|
|
|
37
64
|
will be thrown.
|
|
38
65
|
|
|
39
66
|
```typescript
|
|
40
|
-
import { MavenAGIError } from
|
|
67
|
+
import { MavenAGIError } from "mavenagi";
|
|
41
68
|
|
|
42
69
|
try {
|
|
43
|
-
await
|
|
70
|
+
await client.conversation.initialize(...);
|
|
44
71
|
} catch (err) {
|
|
45
72
|
if (err instanceof MavenAGIError) {
|
|
46
73
|
console.log(err.statusCode);
|
|
@@ -50,7 +77,47 @@ try {
|
|
|
50
77
|
}
|
|
51
78
|
```
|
|
52
79
|
|
|
53
|
-
##
|
|
80
|
+
## Aborting Requests
|
|
81
|
+
|
|
82
|
+
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const controller = new AbortController();
|
|
86
|
+
const response = await client.initialize(..., {
|
|
87
|
+
abortSignal: controller.signal
|
|
88
|
+
});
|
|
89
|
+
controller.abort(); // aborts the request
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Runtime Compatibility
|
|
93
|
+
|
|
94
|
+
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
95
|
+
runtimes:
|
|
96
|
+
|
|
97
|
+
- Node.js 18+
|
|
98
|
+
- Vercel
|
|
99
|
+
- Cloudflare Workers
|
|
100
|
+
- Deno v1.25+
|
|
101
|
+
- Bun 1.0+
|
|
102
|
+
- React Native
|
|
103
|
+
|
|
104
|
+
### Customizing Fetch Client
|
|
105
|
+
|
|
106
|
+
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
107
|
+
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
import { MavenAGIClient } from "mavenagi";
|
|
111
|
+
|
|
112
|
+
const client = new MavenAGIClient({
|
|
113
|
+
...
|
|
114
|
+
fetcher: // provide your implementation here
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Advanced
|
|
119
|
+
|
|
120
|
+
### Retries
|
|
54
121
|
|
|
55
122
|
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
56
123
|
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
|
|
@@ -65,34 +132,34 @@ A request is deemed retriable when any of the following HTTP status codes is ret
|
|
|
65
132
|
Use the `maxRetries` request option to configure this behavior.
|
|
66
133
|
|
|
67
134
|
```typescript
|
|
68
|
-
const response = await
|
|
135
|
+
const response = await client.conversation.initialize(..., {
|
|
69
136
|
maxRetries: 0 // override maxRetries at the request level
|
|
70
137
|
});
|
|
71
138
|
```
|
|
72
139
|
|
|
73
|
-
|
|
140
|
+
### Timeouts
|
|
74
141
|
|
|
75
142
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
76
143
|
|
|
77
144
|
```typescript
|
|
78
|
-
const response = await
|
|
145
|
+
const response = await client.conversation.initialize(..., {
|
|
79
146
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
80
147
|
});
|
|
81
148
|
```
|
|
82
149
|
|
|
83
|
-
|
|
150
|
+
### Aborting Requests
|
|
84
151
|
|
|
85
152
|
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
86
153
|
|
|
87
154
|
```typescript
|
|
88
155
|
const controller = new AbortController();
|
|
89
|
-
const response = await
|
|
156
|
+
const response = await client.conversation.initialize(..., {
|
|
90
157
|
abortSignal: controller.signal
|
|
91
158
|
});
|
|
92
159
|
controller.abort(); // aborts the request
|
|
93
160
|
```
|
|
94
161
|
|
|
95
|
-
|
|
162
|
+
### Runtime Compatibility
|
|
96
163
|
|
|
97
164
|
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
98
165
|
runtimes:
|
|
@@ -110,9 +177,9 @@ The SDK provides a way for your to customize the underlying HTTP client / Fetch
|
|
|
110
177
|
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
111
178
|
|
|
112
179
|
```typescript
|
|
113
|
-
import { MavenAGIClient } from
|
|
180
|
+
import { MavenAGIClient } from "mavenagi";
|
|
114
181
|
|
|
115
|
-
const
|
|
182
|
+
const client = new MavenAGIClient({
|
|
116
183
|
...
|
|
117
184
|
fetcher: // provide your implementation here
|
|
118
185
|
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as MavenAGI from "../../../index";
|
|
7
|
+
export declare namespace Actions {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
|
+
appId?: core.Supplier<string | undefined>;
|
|
11
|
+
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Organization-Id header */
|
|
13
|
+
organizationId: core.Supplier<string>;
|
|
14
|
+
/** Override the X-Agent-Id header */
|
|
15
|
+
agentId: core.Supplier<string>;
|
|
16
|
+
fetcher?: core.FetchFunction;
|
|
17
|
+
}
|
|
18
|
+
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
20
|
+
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
|
+
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
24
|
+
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-Organization-Id header */
|
|
26
|
+
organizationId?: string;
|
|
27
|
+
/** Override the X-Agent-Id header */
|
|
28
|
+
agentId?: string;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export declare class Actions {
|
|
32
|
+
protected readonly _options: Actions.Options;
|
|
33
|
+
constructor(_options: Actions.Options);
|
|
34
|
+
/**
|
|
35
|
+
* Update an action or create it if it doesn't exist
|
|
36
|
+
*
|
|
37
|
+
* @param {MavenAGI.ActionRequest} request
|
|
38
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
41
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
42
|
+
* @throws {@link MavenAGI.ServerError}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.actions.createOrUpdate({
|
|
46
|
+
* actionId: {
|
|
47
|
+
* referenceId: "get-balance"
|
|
48
|
+
* },
|
|
49
|
+
* name: "Get the user's balance",
|
|
50
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
51
|
+
* userInteractionRequired: false,
|
|
52
|
+
* userFormParameters: [],
|
|
53
|
+
* precondition: {
|
|
54
|
+
* preconditionType: "group",
|
|
55
|
+
* operator: "AND",
|
|
56
|
+
* preconditions: [{
|
|
57
|
+
* preconditionType: "user",
|
|
58
|
+
* key: "userKey"
|
|
59
|
+
* }, {
|
|
60
|
+
* preconditionType: "user",
|
|
61
|
+
* key: "userKey2"
|
|
62
|
+
* }]
|
|
63
|
+
* }
|
|
64
|
+
* })
|
|
65
|
+
*/
|
|
66
|
+
createOrUpdate(request: MavenAGI.ActionRequest, requestOptions?: Actions.RequestOptions): Promise<MavenAGI.ActionResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Get an action by its supplied ID
|
|
69
|
+
*
|
|
70
|
+
* @param {string} actionReferenceId - The reference ID of the action to get. All other entity ID fields are inferred from the request.
|
|
71
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
74
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
75
|
+
* @throws {@link MavenAGI.ServerError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.actions.get("get-balance")
|
|
79
|
+
*/
|
|
80
|
+
get(actionReferenceId: string, requestOptions?: Actions.RequestOptions): Promise<MavenAGI.ActionResponse>;
|
|
81
|
+
/**
|
|
82
|
+
* Delete an action
|
|
83
|
+
*
|
|
84
|
+
* @param {string} actionReferenceId - The reference ID of the action to unregister. All other entity ID fields are inferred from the request.
|
|
85
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
88
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
89
|
+
* @throws {@link MavenAGI.ServerError}
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* await client.actions.delete("get-balance")
|
|
93
|
+
*/
|
|
94
|
+
delete(actionReferenceId: string, requestOptions?: Actions.RequestOptions): Promise<void>;
|
|
95
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments";
|
|
14
|
+
import * as core from "../../../../core";
|
|
15
|
+
import * as MavenAGI from "../../../index";
|
|
16
|
+
import * as serializers from "../../../../serialization/index";
|
|
17
|
+
import urlJoin from "url-join";
|
|
18
|
+
import * as errors from "../../../../errors/index";
|
|
19
|
+
export class Actions {
|
|
20
|
+
constructor(_options) {
|
|
21
|
+
this._options = _options;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Update an action or create it if it doesn't exist
|
|
25
|
+
*
|
|
26
|
+
* @param {MavenAGI.ActionRequest} request
|
|
27
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
+
* @throws {@link MavenAGI.ServerError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.actions.createOrUpdate({
|
|
35
|
+
* actionId: {
|
|
36
|
+
* referenceId: "get-balance"
|
|
37
|
+
* },
|
|
38
|
+
* name: "Get the user's balance",
|
|
39
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
40
|
+
* userInteractionRequired: false,
|
|
41
|
+
* userFormParameters: [],
|
|
42
|
+
* precondition: {
|
|
43
|
+
* preconditionType: "group",
|
|
44
|
+
* operator: "AND",
|
|
45
|
+
* preconditions: [{
|
|
46
|
+
* preconditionType: "user",
|
|
47
|
+
* key: "userKey"
|
|
48
|
+
* }, {
|
|
49
|
+
* preconditionType: "user",
|
|
50
|
+
* key: "userKey2"
|
|
51
|
+
* }]
|
|
52
|
+
* }
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
createOrUpdate(request, requestOptions) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
59
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions"),
|
|
60
|
+
method: "PUT",
|
|
61
|
+
headers: {
|
|
62
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
63
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
64
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
65
|
+
"X-Fern-Language": "JavaScript",
|
|
66
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
67
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
68
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
69
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
70
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
71
|
+
},
|
|
72
|
+
contentType: "application/json",
|
|
73
|
+
requestType: "json",
|
|
74
|
+
body: serializers.ActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
75
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
76
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
77
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
78
|
+
});
|
|
79
|
+
if (_response.ok) {
|
|
80
|
+
return serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
81
|
+
unrecognizedObjectKeys: "passthrough",
|
|
82
|
+
allowUnrecognizedUnionMembers: true,
|
|
83
|
+
allowUnrecognizedEnumValues: true,
|
|
84
|
+
breadcrumbsPrefix: ["response"],
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (_response.error.reason === "status-code") {
|
|
88
|
+
switch (_response.error.statusCode) {
|
|
89
|
+
case 404:
|
|
90
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
91
|
+
unrecognizedObjectKeys: "passthrough",
|
|
92
|
+
allowUnrecognizedUnionMembers: true,
|
|
93
|
+
allowUnrecognizedEnumValues: true,
|
|
94
|
+
breadcrumbsPrefix: ["response"],
|
|
95
|
+
}));
|
|
96
|
+
case 400:
|
|
97
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
breadcrumbsPrefix: ["response"],
|
|
102
|
+
}));
|
|
103
|
+
case 500:
|
|
104
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
breadcrumbsPrefix: ["response"],
|
|
109
|
+
}));
|
|
110
|
+
default:
|
|
111
|
+
throw new errors.MavenAGIError({
|
|
112
|
+
statusCode: _response.error.statusCode,
|
|
113
|
+
body: _response.error.body,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
switch (_response.error.reason) {
|
|
118
|
+
case "non-json":
|
|
119
|
+
throw new errors.MavenAGIError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.rawBody,
|
|
122
|
+
});
|
|
123
|
+
case "timeout":
|
|
124
|
+
throw new errors.MavenAGITimeoutError();
|
|
125
|
+
case "unknown":
|
|
126
|
+
throw new errors.MavenAGIError({
|
|
127
|
+
message: _response.error.errorMessage,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get an action by its supplied ID
|
|
134
|
+
*
|
|
135
|
+
* @param {string} actionReferenceId - The reference ID of the action to get. All other entity ID fields are inferred from the request.
|
|
136
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
137
|
+
*
|
|
138
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
139
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
140
|
+
* @throws {@link MavenAGI.ServerError}
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* await client.actions.get("get-balance")
|
|
144
|
+
*/
|
|
145
|
+
get(actionReferenceId, requestOptions) {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
149
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionReferenceId)}`),
|
|
150
|
+
method: "GET",
|
|
151
|
+
headers: {
|
|
152
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
153
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
154
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
155
|
+
"X-Fern-Language": "JavaScript",
|
|
156
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
157
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
158
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
159
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
160
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
161
|
+
},
|
|
162
|
+
contentType: "application/json",
|
|
163
|
+
requestType: "json",
|
|
164
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
170
|
+
unrecognizedObjectKeys: "passthrough",
|
|
171
|
+
allowUnrecognizedUnionMembers: true,
|
|
172
|
+
allowUnrecognizedEnumValues: true,
|
|
173
|
+
breadcrumbsPrefix: ["response"],
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (_response.error.reason === "status-code") {
|
|
177
|
+
switch (_response.error.statusCode) {
|
|
178
|
+
case 404:
|
|
179
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
180
|
+
unrecognizedObjectKeys: "passthrough",
|
|
181
|
+
allowUnrecognizedUnionMembers: true,
|
|
182
|
+
allowUnrecognizedEnumValues: true,
|
|
183
|
+
breadcrumbsPrefix: ["response"],
|
|
184
|
+
}));
|
|
185
|
+
case 400:
|
|
186
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
187
|
+
unrecognizedObjectKeys: "passthrough",
|
|
188
|
+
allowUnrecognizedUnionMembers: true,
|
|
189
|
+
allowUnrecognizedEnumValues: true,
|
|
190
|
+
breadcrumbsPrefix: ["response"],
|
|
191
|
+
}));
|
|
192
|
+
case 500:
|
|
193
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
194
|
+
unrecognizedObjectKeys: "passthrough",
|
|
195
|
+
allowUnrecognizedUnionMembers: true,
|
|
196
|
+
allowUnrecognizedEnumValues: true,
|
|
197
|
+
breadcrumbsPrefix: ["response"],
|
|
198
|
+
}));
|
|
199
|
+
default:
|
|
200
|
+
throw new errors.MavenAGIError({
|
|
201
|
+
statusCode: _response.error.statusCode,
|
|
202
|
+
body: _response.error.body,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
switch (_response.error.reason) {
|
|
207
|
+
case "non-json":
|
|
208
|
+
throw new errors.MavenAGIError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.rawBody,
|
|
211
|
+
});
|
|
212
|
+
case "timeout":
|
|
213
|
+
throw new errors.MavenAGITimeoutError();
|
|
214
|
+
case "unknown":
|
|
215
|
+
throw new errors.MavenAGIError({
|
|
216
|
+
message: _response.error.errorMessage,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Delete an action
|
|
223
|
+
*
|
|
224
|
+
* @param {string} actionReferenceId - The reference ID of the action to unregister. All other entity ID fields are inferred from the request.
|
|
225
|
+
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
+
*
|
|
227
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
228
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
229
|
+
* @throws {@link MavenAGI.ServerError}
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* await client.actions.delete("get-balance")
|
|
233
|
+
*/
|
|
234
|
+
delete(actionReferenceId, requestOptions) {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
238
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionReferenceId)}`),
|
|
239
|
+
method: "DELETE",
|
|
240
|
+
headers: {
|
|
241
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
242
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
243
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
244
|
+
"X-Fern-Language": "JavaScript",
|
|
245
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
246
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.21",
|
|
247
|
+
"User-Agent": "mavenagi/0.0.0-alpha.21",
|
|
248
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
249
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
250
|
+
},
|
|
251
|
+
contentType: "application/json",
|
|
252
|
+
requestType: "json",
|
|
253
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
254
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
255
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
256
|
+
});
|
|
257
|
+
if (_response.ok) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (_response.error.reason === "status-code") {
|
|
261
|
+
switch (_response.error.statusCode) {
|
|
262
|
+
case 404:
|
|
263
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
264
|
+
unrecognizedObjectKeys: "passthrough",
|
|
265
|
+
allowUnrecognizedUnionMembers: true,
|
|
266
|
+
allowUnrecognizedEnumValues: true,
|
|
267
|
+
breadcrumbsPrefix: ["response"],
|
|
268
|
+
}));
|
|
269
|
+
case 400:
|
|
270
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
271
|
+
unrecognizedObjectKeys: "passthrough",
|
|
272
|
+
allowUnrecognizedUnionMembers: true,
|
|
273
|
+
allowUnrecognizedEnumValues: true,
|
|
274
|
+
breadcrumbsPrefix: ["response"],
|
|
275
|
+
}));
|
|
276
|
+
case 500:
|
|
277
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
278
|
+
unrecognizedObjectKeys: "passthrough",
|
|
279
|
+
allowUnrecognizedUnionMembers: true,
|
|
280
|
+
allowUnrecognizedEnumValues: true,
|
|
281
|
+
breadcrumbsPrefix: ["response"],
|
|
282
|
+
}));
|
|
283
|
+
default:
|
|
284
|
+
throw new errors.MavenAGIError({
|
|
285
|
+
statusCode: _response.error.statusCode,
|
|
286
|
+
body: _response.error.body,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
switch (_response.error.reason) {
|
|
291
|
+
case "non-json":
|
|
292
|
+
throw new errors.MavenAGIError({
|
|
293
|
+
statusCode: _response.error.statusCode,
|
|
294
|
+
body: _response.error.rawBody,
|
|
295
|
+
});
|
|
296
|
+
case "timeout":
|
|
297
|
+
throw new errors.MavenAGITimeoutError();
|
|
298
|
+
case "unknown":
|
|
299
|
+
throw new errors.MavenAGIError({
|
|
300
|
+
message: _response.error.errorMessage,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
_getAuthorizationHeader() {
|
|
306
|
+
var _a, _b;
|
|
307
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
308
|
+
const appId = (_a = (yield core.Supplier.get(this._options.appId))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_ID"];
|
|
309
|
+
const appSecret = (_b = (yield core.Supplier.get(this._options.appSecret))) !== null && _b !== void 0 ? _b : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_SECRET"];
|
|
310
|
+
if (appId != null && appSecret != null) {
|
|
311
|
+
return core.BasicAuth.toAuthorizationHeader({
|
|
312
|
+
username: appId,
|
|
313
|
+
password: appSecret,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return undefined;
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|