mavenagi 1.2.64 → 1.2.66
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/BaseClient.d.ts +4 -2
- package/BaseClient.js +8 -3
- package/README.md +2 -2
- package/api/resources/actions/client/Client.js +3 -3
- package/api/resources/agents/client/Client.js +5 -5
- package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +10 -2
- package/api/resources/agents/types/Agent.d.ts +3 -1
- package/api/resources/agents/types/AgentPrompting.d.ts +12 -2
- package/api/resources/analytics/client/Client.d.ts +0 -38
- package/api/resources/analytics/client/Client.js +0 -120
- package/api/resources/analytics/types/AgentUserGroupBy.d.ts +15 -0
- package/api/resources/analytics/types/AgentUserRowIdentifier.d.ts +2 -0
- package/api/resources/analytics/types/AgentUserTableRequest.d.ts +7 -0
- package/api/resources/analytics/types/AgentUserTableResponse.d.ts +4 -1
- package/api/resources/analytics/types/index.d.ts +1 -10
- package/api/resources/analytics/types/index.js +1 -10
- package/api/resources/appDirectory/client/Client.js +5 -5
- package/api/resources/assets/client/Client.js +1 -1
- package/api/resources/capabilities/client/Client.d.ts +33 -0
- package/api/resources/capabilities/client/Client.js +126 -3
- package/api/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +0 -4
- package/api/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +5 -0
- package/api/resources/capabilities/client/requests/SimulateCapabilityByTypeRequest.d.ts +14 -0
- package/api/resources/capabilities/client/requests/index.d.ts +1 -0
- package/api/resources/capabilities/types/ActionSimulationInput.d.ts +5 -0
- package/api/resources/capabilities/types/CapabilityExecutionBase.d.ts +5 -0
- package/api/resources/capabilities/types/CapabilityExecutionsSearchResponse.d.ts +3 -1
- package/api/resources/capabilities/types/CapabilitySimulationInput.d.ts +11 -0
- package/api/resources/capabilities/types/CapabilitySimulationResult.d.ts +10 -0
- package/api/resources/capabilities/types/ConversationContextSimulationInput.d.ts +14 -0
- package/api/resources/capabilities/types/SimulatedUser.d.ts +9 -0
- package/api/resources/capabilities/types/SimulatedUserData.d.ts +6 -0
- package/api/resources/capabilities/types/index.d.ts +6 -0
- package/api/resources/capabilities/types/index.js +6 -0
- package/api/resources/charters/client/Client.js +4 -4
- package/api/resources/charters/types/CharterBase.d.ts +5 -1
- package/api/resources/charters/types/CharterChildrenExclusionPolicy.d.ts +2 -0
- package/api/resources/charters/types/CharterChildrenExclusionPolicy.js +2 -0
- package/api/resources/charters/types/CharterContent.d.ts +2 -0
- package/api/resources/charters/types/CharterPatchReferences.d.ts +2 -0
- package/api/resources/charters/types/CharterReferences.d.ts +2 -0
- package/api/resources/charters/types/CharterResponse.d.ts +5 -1
- package/api/resources/charters/types/CharterStatus.d.ts +4 -0
- package/api/resources/charters/types/CharterStatus.js +4 -0
- package/api/resources/charters/types/CharterSummary.d.ts +5 -1
- package/api/resources/charters/types/index.d.ts +0 -1
- package/api/resources/charters/types/index.js +0 -1
- package/api/resources/commons/types/ActionExecutionStatus.d.ts +6 -0
- package/api/resources/commons/types/ActionExecutionStatus.js +9 -0
- package/api/resources/commons/types/ActionProperties.d.ts +1 -1
- package/api/resources/commons/types/AdditionalDataKey.d.ts +84 -3
- package/api/resources/commons/types/AdditionalDataKey.js +84 -3
- package/api/resources/commons/types/AppUserRequest.d.ts +11 -0
- package/api/resources/commons/types/BaseConversationResponse.d.ts +6 -0
- package/api/resources/commons/types/BotLogicCharterDetail.d.ts +2 -0
- package/api/resources/commons/types/BotMessage.d.ts +6 -1
- package/api/resources/commons/types/BotMessageStatusReason.d.ts +13 -0
- package/api/resources/commons/types/BotMessageStatusReason.js +16 -0
- package/api/resources/commons/types/Capability.d.ts +4 -0
- package/api/resources/commons/types/Capability.js +4 -0
- package/api/resources/commons/types/CapabilityStatus.d.ts +2 -2
- package/api/resources/commons/types/CapabilityStatus.js +2 -2
- package/api/resources/commons/types/ConversationAnalysis.d.ts +1 -1
- package/api/resources/commons/types/ConversationMetadataValueSource.d.ts +7 -0
- package/api/resources/commons/types/ConversationResponse.d.ts +1 -0
- package/api/resources/commons/types/ConversationSummary.d.ts +5 -3
- package/api/resources/commons/types/ConversationValueSource.d.ts +13 -0
- package/api/resources/commons/types/EntityType.d.ts +5 -0
- package/api/resources/commons/types/EntityType.js +5 -0
- package/api/resources/commons/types/ErrorReason.d.ts +5 -2
- package/api/resources/commons/types/ErrorReason.js +5 -2
- package/api/resources/commons/types/EventBaseNoId.d.ts +6 -0
- package/api/resources/commons/types/EventFilter.d.ts +3 -0
- package/api/resources/commons/types/EventTriggerType.d.ts +7 -0
- package/api/resources/commons/types/EventTriggerType.js +7 -0
- package/api/resources/commons/types/ExecuteActionResponse.d.ts +14 -0
- package/api/resources/commons/types/ExecutionMode.d.ts +10 -0
- package/api/resources/commons/types/ExecutionMode.js +13 -0
- package/api/resources/commons/types/FunctionVersionBinding.d.ts +11 -0
- package/api/resources/commons/types/FunctionVersionBinding.js +3 -0
- package/api/resources/commons/types/InboxItemDuplicateDocuments.d.ts +1 -1
- package/api/resources/commons/types/InboxItemStatus.d.ts +1 -1
- package/api/resources/commons/types/InboxItemStatus.js +1 -1
- package/api/resources/commons/types/InitializeConversationResponse.d.ts +40 -0
- package/api/resources/commons/types/LlmInclusionStatus.d.ts +3 -0
- package/api/resources/commons/types/LlmInclusionStatus.js +3 -0
- package/api/resources/commons/types/MetadataConversationValueFilter.d.ts +15 -0
- package/api/resources/commons/types/MetadataConversationValueFilter.js +3 -0
- package/api/resources/commons/types/MetadataFilter.d.ts +33 -6
- package/api/resources/commons/types/Quality.d.ts +2 -0
- package/api/resources/commons/types/Quality.js +2 -0
- package/api/resources/commons/types/QualityReason.d.ts +4 -0
- package/api/resources/commons/types/QualityReason.js +4 -0
- package/api/resources/commons/types/RelationshipType.d.ts +2 -2
- package/api/resources/commons/types/RelationshipType.js +2 -2
- package/api/resources/commons/types/ResolutionStatus.d.ts +2 -0
- package/api/resources/commons/types/ResolutionStatus.js +2 -0
- package/api/resources/commons/types/ResponseConfig.d.ts +2 -0
- package/api/resources/commons/types/SimulationActionBehavior.d.ts +19 -0
- package/api/resources/commons/types/SimulationActionBehavior.js +3 -0
- package/api/resources/commons/types/SimulationActionCallApp.d.ts +1 -0
- package/api/resources/commons/types/SimulationActionCallApp.js +3 -0
- package/api/resources/commons/types/SimulationActionMock.d.ts +7 -0
- package/api/resources/commons/types/SimulationActionMock.js +3 -0
- package/api/resources/commons/types/SimulationContext.d.ts +19 -0
- package/api/resources/commons/types/SystemEventName.d.ts +5 -2
- package/api/resources/commons/types/SystemEventName.js +5 -2
- package/api/resources/commons/types/UserDataValueSource.d.ts +8 -0
- package/api/resources/commons/types/UserDataValueSource.js +3 -0
- package/api/resources/commons/types/UserEvent.d.ts +1 -1
- package/api/resources/commons/types/UserEventName.d.ts +80 -5
- package/api/resources/commons/types/UserEventName.js +80 -5
- package/api/resources/commons/types/index.d.ts +14 -0
- package/api/resources/commons/types/index.js +14 -0
- package/api/resources/conversation/client/Client.d.ts +53 -29
- package/api/resources/conversation/client/Client.js +65 -40
- package/api/resources/conversation/client/requests/ConversationDeleteRequest.d.ts +1 -1
- package/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +2 -0
- package/api/resources/conversation/types/BillableFilterField.d.ts +3 -3
- package/api/resources/conversation/types/BillableFilterField.js +3 -3
- package/api/resources/conversation/types/ConversationField.d.ts +8 -0
- package/api/resources/conversation/types/ConversationField.js +8 -0
- package/api/resources/conversation/types/ConversationFilter.d.ts +7 -1
- package/api/resources/conversation/types/ConversationPatchRequest.d.ts +1 -1
- package/api/resources/conversation/types/ConversationRequest.d.ts +45 -0
- package/api/resources/conversation/types/DeliverConversationMessageRequest.d.ts +1 -1
- package/api/resources/conversation/types/index.d.ts +0 -3
- package/api/resources/conversation/types/index.js +0 -3
- package/api/resources/customers/client/Client.js +2 -2
- package/api/resources/customers/types/CustomerFilter.d.ts +2 -0
- package/api/resources/customers/types/CustomerResponse.d.ts +2 -2
- package/api/resources/developersCommons/types/BaseDetailApp.d.ts +13 -4
- package/api/resources/developersCommons/types/Link.d.ts +1 -1
- package/api/resources/developersCommons/types/MarketplaceAppDetail.d.ts +2 -1
- package/api/resources/events/client/Client.js +1 -1
- package/api/resources/inbox/client/Client.js +6 -6
- package/api/resources/integrations/client/Client.js +1 -1
- package/api/resources/intelligentFields/client/Client.d.ts +3 -2
- package/api/resources/intelligentFields/client/Client.js +6 -5
- package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +0 -2
- package/api/resources/intelligentFields/types/EnumOption.d.ts +1 -1
- package/api/resources/intelligentFields/types/IntelligentFieldBase.d.ts +1 -1
- package/api/resources/intelligentFields/types/IntelligentFieldCore.d.ts +5 -1
- package/api/resources/intelligentFields/types/IntelligentFieldType.d.ts +1 -1
- package/api/resources/intelligentFields/types/IntelligentFieldType.js +1 -1
- package/api/resources/knowledge/client/Client.js +13 -13
- package/api/resources/knowledge/types/KnowledgeBaseFunctionBindings.d.ts +12 -0
- package/api/resources/knowledge/types/KnowledgeBaseFunctionBindings.js +3 -0
- package/api/resources/knowledge/types/KnowledgeBaseIndexingStatus.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseIndexingStatus.js +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +3 -1
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +2 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.js +2 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +2 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersionStatus.d.ts +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersionStatus.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +1 -1
- package/api/resources/knowledge/types/index.d.ts +1 -0
- package/api/resources/knowledge/types/index.js +1 -0
- package/api/resources/organizations/client/Client.d.ts +13 -15
- package/api/resources/organizations/client/Client.js +17 -19
- package/api/resources/segments/client/Client.d.ts +1 -1
- package/api/resources/segments/client/Client.js +4 -4
- package/api/resources/segments/types/SegmentStatus.d.ts +4 -0
- package/api/resources/segments/types/SegmentStatus.js +4 -0
- package/api/resources/triggers/client/Client.js +3 -3
- package/api/resources/triggers/types/EventTriggerBase.d.ts +2 -0
- package/api/resources/users/client/Client.d.ts +42 -1
- package/api/resources/users/client/Client.js +116 -4
- package/api/resources/users/types/AgentUser.d.ts +3 -0
- package/api/resources/users/types/AgentUserField.d.ts +8 -0
- package/api/resources/users/types/AgentUserField.js +8 -0
- package/api/resources/users/types/AgentUserFilter.d.ts +4 -0
- package/api/resources/users/types/AgentUserSearchRequest.d.ts +4 -0
- package/api/resources/voiceConversations/client/Client.d.ts +1 -1
- package/api/resources/voiceConversations/client/Socket.d.ts +2 -2
- package/api/resources/voiceConversations/client/Socket.js +16 -17
- package/auth/AnyAuthProvider.d.ts +23 -0
- package/auth/AnyAuthProvider.js +46 -0
- package/auth/BearerAuthProvider.d.ts +20 -0
- package/auth/BearerAuthProvider.js +82 -0
- package/auth/index.d.ts +2 -0
- package/auth/index.js +5 -1
- package/core/fetcher/Fetcher.js +33 -3
- package/core/fetcher/getErrorResponseBody.js +20 -7
- package/core/fetcher/getResponseBody.d.ts +16 -0
- package/core/fetcher/getResponseBody.js +27 -22
- package/core/fetcher/makePassthroughRequest.js +20 -4
- package/core/fetcher/makeRequest.d.ts +6 -1
- package/core/fetcher/makeRequest.js +38 -5
- package/core/fetcher/requestWithRetries.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +23 -2
- package/core/fetcher/signals.d.ts +1 -0
- package/core/fetcher/signals.js +3 -2
- package/core/stream/Stream.d.ts +3 -0
- package/core/stream/Stream.js +5 -0
- package/core/url/encodePathParam.d.ts +3 -1
- package/core/url/encodePathParam.js +8 -2
- package/core/websocket/ws.d.ts +16 -2
- package/core/websocket/ws.js +110 -20
- package/errors/MavenAGIError.js +16 -2
- package/package.json +1 -1
- package/reference.md +207 -128
- package/serialization/resources/analytics/types/AgentUserGroupBy.d.ts +15 -0
- package/serialization/resources/analytics/types/{FeedbackTableResponse.js → AgentUserGroupBy.js} +10 -6
- package/serialization/resources/analytics/types/AgentUserRowIdentifier.d.ts +2 -0
- package/serialization/resources/analytics/types/AgentUserRowIdentifier.js +2 -0
- package/serialization/resources/analytics/types/AgentUserTableRequest.d.ts +2 -0
- package/serialization/resources/analytics/types/AgentUserTableRequest.js +2 -0
- package/serialization/resources/analytics/types/index.d.ts +1 -10
- package/serialization/resources/analytics/types/index.js +1 -10
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +0 -2
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.js +0 -2
- package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +2 -0
- package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.js +2 -0
- package/serialization/resources/capabilities/types/ActionSimulationInput.d.ts +10 -0
- package/serialization/resources/{analytics/types/FeedbackRowIdentifier.js → capabilities/types/ActionSimulationInput.js} +5 -6
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.d.ts +2 -0
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.js +2 -0
- package/serialization/resources/capabilities/types/CapabilitySimulationInput.d.ts +11 -0
- package/serialization/resources/{analytics/types/FeedbackMetric.js → capabilities/types/CapabilitySimulationInput.js} +5 -7
- package/serialization/resources/capabilities/types/CapabilitySimulationResult.d.ts +11 -0
- package/serialization/resources/{analytics/types/FeedbackGroupBy.js → capabilities/types/CapabilitySimulationResult.js} +9 -7
- package/serialization/resources/capabilities/types/ConversationContextSimulationInput.d.ts +12 -0
- package/serialization/resources/capabilities/types/ConversationContextSimulationInput.js +46 -0
- package/serialization/resources/capabilities/types/SimulatedUser.d.ts +10 -0
- package/serialization/resources/{analytics/types/FeedbackAnalyticsRequest.js → capabilities/types/SimulatedUser.js} +6 -5
- package/serialization/resources/capabilities/types/SimulatedUserData.d.ts +10 -0
- package/serialization/resources/capabilities/types/SimulatedUserData.js +42 -0
- package/serialization/resources/capabilities/types/index.d.ts +6 -0
- package/serialization/resources/capabilities/types/index.js +6 -0
- package/serialization/resources/charters/types/CharterContent.d.ts +1 -1
- package/serialization/resources/charters/types/CharterContent.js +1 -1
- package/serialization/resources/charters/types/CharterResponse.d.ts +1 -1
- package/serialization/resources/charters/types/CharterResponse.js +1 -1
- package/serialization/resources/charters/types/CharterSummary.d.ts +1 -1
- package/serialization/resources/charters/types/CharterSummary.js +1 -1
- package/serialization/resources/charters/types/index.d.ts +0 -1
- package/serialization/resources/charters/types/index.js +0 -1
- package/serialization/resources/commons/types/ActionExecutionStatus.d.ts +7 -0
- package/serialization/resources/{conversation/types/FeedbackField.js → commons/types/ActionExecutionStatus.js} +2 -2
- package/serialization/resources/commons/types/AdditionalDataKey.d.ts +1 -1
- package/serialization/resources/commons/types/AdditionalDataKey.js +27 -0
- package/serialization/resources/commons/types/AppUserRequest.d.ts +2 -0
- package/serialization/resources/commons/types/AppUserRequest.js +2 -0
- package/serialization/resources/commons/types/BaseConversationResponse.d.ts +2 -0
- package/serialization/resources/commons/types/BaseConversationResponse.js +2 -0
- package/serialization/resources/commons/types/BotLogicCharterDetail.d.ts +2 -0
- package/serialization/resources/commons/types/BotLogicCharterDetail.js +2 -0
- package/serialization/resources/commons/types/BotMessage.d.ts +2 -0
- package/serialization/resources/commons/types/BotMessage.js +2 -0
- package/serialization/resources/commons/types/BotMessageStatusReason.d.ts +7 -0
- package/serialization/resources/commons/types/BotMessageStatusReason.js +43 -0
- package/serialization/resources/commons/types/ConversationMetadataValueSource.d.ts +9 -0
- package/serialization/resources/commons/types/ConversationMetadataValueSource.js +41 -0
- package/serialization/resources/commons/types/ConversationValueSource.d.ts +15 -0
- package/serialization/resources/commons/types/ConversationValueSource.js +49 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +5 -0
- package/serialization/resources/commons/types/ErrorReason.d.ts +1 -1
- package/serialization/resources/commons/types/ErrorReason.js +1 -0
- package/serialization/resources/commons/types/EventBaseNoId.d.ts +2 -0
- package/serialization/resources/commons/types/EventBaseNoId.js +2 -0
- package/serialization/resources/commons/types/EventFilter.d.ts +2 -0
- package/serialization/resources/commons/types/EventFilter.js +2 -0
- package/serialization/resources/commons/types/ExecuteActionResponse.d.ts +13 -0
- package/serialization/resources/commons/types/ExecuteActionResponse.js +45 -0
- package/serialization/resources/commons/types/ExecutionMode.d.ts +7 -0
- package/serialization/resources/commons/types/ExecutionMode.js +39 -0
- package/serialization/resources/commons/types/FunctionVersionBinding.d.ts +11 -0
- package/serialization/resources/{analytics/types/FeedbackDistinctCount.js → commons/types/FunctionVersionBinding.js} +5 -4
- package/serialization/resources/commons/types/MetadataConversationValueFilter.d.ts +11 -0
- package/serialization/resources/commons/types/MetadataConversationValueFilter.js +43 -0
- package/serialization/resources/commons/types/MetadataFilter.d.ts +5 -1
- package/serialization/resources/commons/types/MetadataFilter.js +2 -0
- package/serialization/resources/commons/types/SimulationActionBehavior.d.ts +15 -0
- package/serialization/resources/commons/types/SimulationActionBehavior.js +49 -0
- package/serialization/resources/commons/types/SimulationActionCallApp.d.ts +7 -0
- package/serialization/resources/{analytics/types/FeedbackCount.js → commons/types/SimulationActionCallApp.js} +2 -2
- package/serialization/resources/commons/types/SimulationActionMock.d.ts +12 -0
- package/serialization/resources/{analytics/types/FeedbackColumnDefinition.js → commons/types/SimulationActionMock.js} +7 -8
- package/serialization/resources/commons/types/SimulationContext.d.ts +4 -0
- package/serialization/resources/commons/types/SimulationContext.js +4 -0
- package/serialization/resources/commons/types/SystemEventName.d.ts +1 -1
- package/serialization/resources/commons/types/SystemEventName.js +1 -0
- package/serialization/resources/commons/types/UserDataValueSource.d.ts +9 -0
- package/serialization/resources/commons/types/UserDataValueSource.js +41 -0
- package/serialization/resources/commons/types/UserEventName.d.ts +1 -1
- package/serialization/resources/commons/types/UserEventName.js +25 -0
- package/serialization/resources/commons/types/index.d.ts +14 -0
- package/serialization/resources/commons/types/index.js +14 -0
- package/serialization/resources/conversation/types/ConversationFilter.d.ts +1 -1
- package/serialization/resources/conversation/types/ConversationFilter.js +1 -1
- package/serialization/resources/conversation/types/index.d.ts +0 -3
- package/serialization/resources/conversation/types/index.js +0 -3
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +0 -1
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseFunctionBindings.d.ts +12 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseFunctionBindings.js +44 -0
- package/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/serialization/resources/knowledge/types/index.js +1 -0
- package/serialization/resources/users/types/AgentUser.d.ts +2 -0
- package/serialization/resources/users/types/AgentUser.js +2 -0
- package/serialization/resources/users/types/AgentUserField.d.ts +1 -1
- package/serialization/resources/users/types/AgentUserField.js +1 -1
- package/serialization/resources/users/types/AgentUserFilter.d.ts +2 -0
- package/serialization/resources/users/types/AgentUserFilter.js +2 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/analytics/types/FeedbackAnalyticsRequest.d.ts +0 -11
- package/api/resources/analytics/types/FeedbackColumnDefinition.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackCount.d.ts +0 -4
- package/api/resources/analytics/types/FeedbackDistinctCount.d.ts +0 -9
- package/api/resources/analytics/types/FeedbackGroupBy.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackMetric.d.ts +0 -13
- package/api/resources/analytics/types/FeedbackRow.d.ts +0 -11
- package/api/resources/analytics/types/FeedbackRowIdentifier.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackTableRequest.d.ts +0 -38
- package/api/resources/analytics/types/FeedbackTableResponse.d.ts +0 -56
- package/api/resources/conversation/types/FeedbackField.d.ts +0 -7
- package/api/resources/conversation/types/FeedbackField.js +0 -10
- package/api/resources/conversation/types/FeedbackFilter.d.ts +0 -9
- package/serialization/resources/analytics/types/FeedbackAnalyticsRequest.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackColumnDefinition.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackCount.d.ts +0 -7
- package/serialization/resources/analytics/types/FeedbackDistinctCount.d.ts +0 -10
- package/serialization/resources/analytics/types/FeedbackGroupBy.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackMetric.d.ts +0 -15
- package/serialization/resources/analytics/types/FeedbackRow.d.ts +0 -14
- package/serialization/resources/analytics/types/FeedbackRow.js +0 -48
- package/serialization/resources/analytics/types/FeedbackRowIdentifier.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackTableRequest.d.ts +0 -15
- package/serialization/resources/analytics/types/FeedbackTableRequest.js +0 -49
- package/serialization/resources/analytics/types/FeedbackTableResponse.d.ts +0 -11
- package/serialization/resources/conversation/types/FeedbackField.d.ts +0 -7
- package/serialization/resources/conversation/types/FeedbackFilter.d.ts +0 -15
- package/serialization/resources/conversation/types/FeedbackFilter.js +0 -47
- /package/api/resources/analytics/types/{FeedbackAnalyticsRequest.js → AgentUserGroupBy.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackColumnDefinition.js → capabilities/client/requests/SimulateCapabilityByTypeRequest.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackCount.js → capabilities/types/ActionSimulationInput.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackDistinctCount.js → capabilities/types/CapabilitySimulationInput.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackGroupBy.js → capabilities/types/CapabilitySimulationResult.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackMetric.js → capabilities/types/ConversationContextSimulationInput.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackRow.js → capabilities/types/SimulatedUser.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackRowIdentifier.js → capabilities/types/SimulatedUserData.js} +0 -0
- /package/api/resources/{charters → commons}/types/CharterType.d.ts +0 -0
- /package/api/resources/{charters → commons}/types/CharterType.js +0 -0
- /package/api/resources/{analytics/types/FeedbackTableRequest.js → commons/types/ConversationMetadataValueSource.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackTableResponse.js → commons/types/ConversationValueSource.js} +0 -0
- /package/api/resources/{conversation/types/FeedbackFilter.js → commons/types/ExecuteActionResponse.js} +0 -0
- /package/api/resources/{conversation → commons}/types/SimulationFilter.d.ts +0 -0
- /package/api/resources/{conversation → commons}/types/SimulationFilter.js +0 -0
- /package/serialization/resources/{charters → commons}/types/CharterType.d.ts +0 -0
- /package/serialization/resources/{charters → commons}/types/CharterType.js +0 -0
- /package/serialization/resources/{conversation → commons}/types/SimulationFilter.d.ts +0 -0
- /package/serialization/resources/{conversation → commons}/types/SimulationFilter.js +0 -0
|
@@ -191,7 +191,7 @@ class UsersClient {
|
|
|
191
191
|
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
192
192
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
193
193
|
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
194
|
-
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/agentusers/${core.url.encodePathParam(agentUserId)}`),
|
|
194
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/agentusers/${core.url.encodePathParam(agentUserId, errors.MavenAGIError)}`),
|
|
195
195
|
method: "GET",
|
|
196
196
|
headers: _headers,
|
|
197
197
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
@@ -260,6 +260,113 @@ class UsersClient {
|
|
|
260
260
|
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/agentusers/{agentUserId}");
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* @beta This endpoint is in development and may change.
|
|
265
|
+
*
|
|
266
|
+
* Deletes the identifiers and user data that every app has saved for an agent user.
|
|
267
|
+
* This is the same as calling `DELETE /users/{userId}` for each of the agent user's app users.
|
|
268
|
+
*
|
|
269
|
+
* The agent user and its app users still exist afterwards, with no identifiers or user data.
|
|
270
|
+
* Apps can keep writing to them; a later create or update adds data back to the same users.
|
|
271
|
+
*
|
|
272
|
+
* Conversations, their messages and events are not modified, apart from the intelligent field values below. To wipe a conversation, use `DELETE /conversations/{conversationId}`.
|
|
273
|
+
*
|
|
274
|
+
* If the ID belongs to an agent user that has been merged into another, the agent user it was merged into is wiped.
|
|
275
|
+
*
|
|
276
|
+
* <Warning>This is a destructive operation and cannot be undone.</Warning>
|
|
277
|
+
*
|
|
278
|
+
* ### Intelligent fields
|
|
279
|
+
*
|
|
280
|
+
* The agent user's intelligent field values are deleted too, and removed from their `INTELLIGENT_FIELD_VALUE_CHANGED` events; the events themselves are kept.
|
|
281
|
+
* Unlike `DELETE /users/{userId}`, the wipe does not recompute the values. They can be computed again later from the user's remaining conversations, for example after the user sends another message; wipe those conversations first to prevent that.
|
|
282
|
+
*
|
|
283
|
+
* @param {string} agentUserId - The ID of the agent user to wipe.
|
|
284
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
285
|
+
*
|
|
286
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
287
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
288
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
289
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
290
|
+
* @throws {@link MavenAGI.ServerError}
|
|
291
|
+
* @throws {@link errors.MavenAGIError}
|
|
292
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* await client.users.deleteAgentUser("aus_1234567890")
|
|
296
|
+
*/
|
|
297
|
+
deleteAgentUser(agentUserId, requestOptions) {
|
|
298
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteAgentUser(agentUserId, requestOptions));
|
|
299
|
+
}
|
|
300
|
+
__deleteAgentUser(agentUserId, requestOptions) {
|
|
301
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
302
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
303
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
304
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
305
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
306
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
307
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
308
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
309
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/agentusers/${core.url.encodePathParam(agentUserId, errors.MavenAGIError)}`),
|
|
310
|
+
method: "DELETE",
|
|
311
|
+
headers: _headers,
|
|
312
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
313
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
314
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
315
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
316
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
317
|
+
logging: this._options.logging,
|
|
318
|
+
});
|
|
319
|
+
if (_response.ok) {
|
|
320
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
321
|
+
}
|
|
322
|
+
if (_response.error.reason === "status-code") {
|
|
323
|
+
switch (_response.error.statusCode) {
|
|
324
|
+
case 404:
|
|
325
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
326
|
+
unrecognizedObjectKeys: "passthrough",
|
|
327
|
+
allowUnrecognizedUnionMembers: true,
|
|
328
|
+
allowUnrecognizedEnumValues: true,
|
|
329
|
+
breadcrumbsPrefix: ["response"],
|
|
330
|
+
}), _response.rawResponse);
|
|
331
|
+
case 400:
|
|
332
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
333
|
+
unrecognizedObjectKeys: "passthrough",
|
|
334
|
+
allowUnrecognizedUnionMembers: true,
|
|
335
|
+
allowUnrecognizedEnumValues: true,
|
|
336
|
+
breadcrumbsPrefix: ["response"],
|
|
337
|
+
}), _response.rawResponse);
|
|
338
|
+
case 413:
|
|
339
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
340
|
+
unrecognizedObjectKeys: "passthrough",
|
|
341
|
+
allowUnrecognizedUnionMembers: true,
|
|
342
|
+
allowUnrecognizedEnumValues: true,
|
|
343
|
+
breadcrumbsPrefix: ["response"],
|
|
344
|
+
}), _response.rawResponse);
|
|
345
|
+
case 429:
|
|
346
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
347
|
+
unrecognizedObjectKeys: "passthrough",
|
|
348
|
+
allowUnrecognizedUnionMembers: true,
|
|
349
|
+
allowUnrecognizedEnumValues: true,
|
|
350
|
+
breadcrumbsPrefix: ["response"],
|
|
351
|
+
}), _response.rawResponse);
|
|
352
|
+
case 500:
|
|
353
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
354
|
+
unrecognizedObjectKeys: "passthrough",
|
|
355
|
+
allowUnrecognizedUnionMembers: true,
|
|
356
|
+
allowUnrecognizedEnumValues: true,
|
|
357
|
+
breadcrumbsPrefix: ["response"],
|
|
358
|
+
}), _response.rawResponse);
|
|
359
|
+
default:
|
|
360
|
+
throw new errors.MavenAGIError({
|
|
361
|
+
statusCode: _response.error.statusCode,
|
|
362
|
+
body: _response.error.body,
|
|
363
|
+
rawResponse: _response.rawResponse,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/agentusers/{agentUserId}");
|
|
368
|
+
});
|
|
369
|
+
}
|
|
263
370
|
/**
|
|
264
371
|
* Update an app user or create it if it doesn't exist.
|
|
265
372
|
*
|
|
@@ -409,7 +516,7 @@ class UsersClient {
|
|
|
409
516
|
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
410
517
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
411
518
|
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
412
|
-
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/users/${core.url.encodePathParam(userId)}`),
|
|
519
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/users/${core.url.encodePathParam(userId, errors.MavenAGIError)}`),
|
|
413
520
|
method: "GET",
|
|
414
521
|
headers: _headers,
|
|
415
522
|
queryString: core.url
|
|
@@ -483,9 +590,14 @@ class UsersClient {
|
|
|
483
590
|
});
|
|
484
591
|
}
|
|
485
592
|
/**
|
|
486
|
-
* Deletes all identifiers and user data saved by the specified app.
|
|
593
|
+
* Deletes all identifiers and user data saved by the specified app for this user.
|
|
487
594
|
* Does not modify data or identifiers saved by other apps.
|
|
488
595
|
*
|
|
596
|
+
* The app user still exists afterwards, with no identifiers or user data, and the app can keep writing to it.
|
|
597
|
+
* Conversations, their messages and events are not modified.
|
|
598
|
+
* The agent user's intelligent field values are not deleted; they are recomputed without this app's data.
|
|
599
|
+
* To wipe a conversation, use `DELETE /conversations/{conversationId}`. To wipe every app's data for a user, use `DELETE /agentusers/{agentUserId}`.
|
|
600
|
+
*
|
|
489
601
|
* If this user is linked to a user from another app, it will not be unlinked. Unlinking of users is not yet supported.
|
|
490
602
|
*
|
|
491
603
|
* <Warning>This is a destructive operation and cannot be undone.</Warning>
|
|
@@ -521,7 +633,7 @@ class UsersClient {
|
|
|
521
633
|
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
522
634
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
523
635
|
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
524
|
-
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/users/${core.url.encodePathParam(userId)}`),
|
|
636
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/users/${core.url.encodePathParam(userId, errors.MavenAGIError)}`),
|
|
525
637
|
method: "DELETE",
|
|
526
638
|
headers: _headers,
|
|
527
639
|
queryString: core.url
|
|
@@ -10,6 +10,7 @@ import type * as MavenAGI from "../../../index";
|
|
|
10
10
|
* type: MavenAGI.AppUserIdentifyingPropertyType.Email
|
|
11
11
|
* }],
|
|
12
12
|
* defaultName: "Joe",
|
|
13
|
+
* executionMode: MavenAGI.ExecutionMode.Live,
|
|
13
14
|
* users: [{
|
|
14
15
|
* userId: {
|
|
15
16
|
* type: MavenAGI.EntityType.UserProfile,
|
|
@@ -61,4 +62,6 @@ export interface AgentUser {
|
|
|
61
62
|
users: MavenAGI.AppUserSummary[];
|
|
62
63
|
/** Latest successful values of the agent user's intelligent fields. */
|
|
63
64
|
intelligentFieldValues?: MavenAGI.IntelligentFieldValueResponse[];
|
|
65
|
+
/** The execution mode the agent user lives in. Its app users all share it. */
|
|
66
|
+
executionMode: MavenAGI.ExecutionMode;
|
|
64
67
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export declare const AgentUserField: {
|
|
2
2
|
readonly CreatedAt: "CreatedAt";
|
|
3
3
|
readonly UpdatedAt: "UpdatedAt";
|
|
4
|
+
/**
|
|
5
|
+
* Whether the user is anonymous, as `isAnonymous` filters on. Groups as a `boolean` value. */
|
|
6
|
+
readonly Anonymous: "Anonymous";
|
|
7
|
+
/**
|
|
8
|
+
* Selects a user-level intelligent field. When used, `intelligentFieldId` must also be set
|
|
9
|
+
* to identify which field. Grouping by it splits that field's users by value; a user without
|
|
10
|
+
* a value for it is left out. */
|
|
11
|
+
readonly IntelligentField: "IntelligentField";
|
|
4
12
|
};
|
|
5
13
|
export type AgentUserField = (typeof AgentUserField)[keyof typeof AgentUserField] | string;
|
|
@@ -5,4 +5,12 @@ exports.AgentUserField = void 0;
|
|
|
5
5
|
exports.AgentUserField = {
|
|
6
6
|
CreatedAt: "CreatedAt",
|
|
7
7
|
UpdatedAt: "UpdatedAt",
|
|
8
|
+
/**
|
|
9
|
+
* Whether the user is anonymous, as `isAnonymous` filters on. Groups as a `boolean` value. */
|
|
10
|
+
Anonymous: "Anonymous",
|
|
11
|
+
/**
|
|
12
|
+
* Selects a user-level intelligent field. When used, `intelligentFieldId` must also be set
|
|
13
|
+
* to identify which field. Grouping by it splits that field's users by value; a user without
|
|
14
|
+
* a value for it is left out. */
|
|
15
|
+
IntelligentField: "IntelligentField",
|
|
8
16
|
};
|
|
@@ -3,6 +3,8 @@ export interface AgentUserFilter {
|
|
|
3
3
|
/**
|
|
4
4
|
* Full-text search query for matching agent users by content.
|
|
5
5
|
* When you search with this parameter, you're performing a full-text search across the user identifiers.
|
|
6
|
+
*
|
|
7
|
+
* Shown in Agent Designer as "Content includes".
|
|
6
8
|
*/
|
|
7
9
|
search?: string;
|
|
8
10
|
/** Filter by identifiers */
|
|
@@ -19,4 +21,6 @@ export interface AgentUserFilter {
|
|
|
19
21
|
isAnonymous?: boolean;
|
|
20
22
|
/** Filter by intelligent field values. All conditions are ANDed together. */
|
|
21
23
|
intelligentFields?: MavenAGI.IntelligentFieldFilter;
|
|
24
|
+
/** Whether to include simulation users in search results. Defaults to only non-simulation users. */
|
|
25
|
+
simulationFilter?: MavenAGI.SimulationFilter;
|
|
22
26
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type * as MavenAGI from "../../../index";
|
|
2
2
|
export interface AgentUserSearchRequest extends MavenAGI.BasePaginatedRequest {
|
|
3
|
+
/**
|
|
4
|
+
* Field to sort results by. `IntelligentField` is not supported here; intelligent fields
|
|
5
|
+
* can be filtered on via `filter.intelligentFields` and grouped through the analytics APIs.
|
|
6
|
+
*/
|
|
3
7
|
sort?: MavenAGI.AgentUserField;
|
|
4
8
|
filter?: MavenAGI.AgentUserFilter;
|
|
5
9
|
}
|
|
@@ -21,7 +21,7 @@ export declare namespace VoiceConversationsClient {
|
|
|
21
21
|
connectionTimeoutInSeconds?: number;
|
|
22
22
|
/** A signal to abort the WebSocket connection. */
|
|
23
23
|
abortSignal?: AbortSignal;
|
|
24
|
-
/** Decides whether a close event should trigger a reconnect. Return false to treat the close as terminal. Defaults to reconnecting on any close code other than 1000. */
|
|
24
|
+
/** Decides whether a server close event should trigger a reconnect. Not consulted for connection errors, timeouts, or internal closes. Return false to treat the close as terminal. Defaults to reconnecting on any server close code other than 1000. */
|
|
25
25
|
shouldReconnect?: (event: core.CloseEvent) => boolean;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -46,11 +46,11 @@ export declare class VoiceConversationsSocket {
|
|
|
46
46
|
off<T extends keyof VoiceConversationsSocket.EventHandlers>(event: T, callback: VoiceConversationsSocket.EventHandlers[T]): void;
|
|
47
47
|
sendConfig(message: MavenAGI.Config): void;
|
|
48
48
|
sendUserAudioChunk(message: MavenAGI.UserAudioChunk): void;
|
|
49
|
-
/** Connect to the websocket and register event handlers. */
|
|
49
|
+
/** Connect to the websocket and register event handlers. Safe to call multiple times: each handler is only registered if it is not already attached. */
|
|
50
50
|
connect(): VoiceConversationsSocket;
|
|
51
51
|
/** Close the websocket and unregister event handlers. */
|
|
52
52
|
close(): void;
|
|
53
|
-
/** Returns a promise that resolves when the websocket is open. */
|
|
53
|
+
/** Returns a promise that resolves when the websocket is open, and rejects if it errors or closes before opening. */
|
|
54
54
|
waitForOpen(): Promise<core.ReconnectingWebSocket>;
|
|
55
55
|
/** Asserts that the websocket is open. */
|
|
56
56
|
private assertSocketIsOpen;
|
|
@@ -136,13 +136,21 @@ class VoiceConversationsSocket {
|
|
|
136
136
|
});
|
|
137
137
|
this.socket.send(JSON.stringify(jsonPayload));
|
|
138
138
|
}
|
|
139
|
-
/** Connect to the websocket and register event handlers. */
|
|
139
|
+
/** Connect to the websocket and register event handlers. Safe to call multiple times: each handler is only registered if it is not already attached. */
|
|
140
140
|
connect() {
|
|
141
141
|
this.socket.reconnect();
|
|
142
|
-
this.socket.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.socket.
|
|
142
|
+
if (!this.socket.hasEventListener("open", this.handleOpen)) {
|
|
143
|
+
this.socket.addEventListener("open", this.handleOpen);
|
|
144
|
+
}
|
|
145
|
+
if (!this.socket.hasEventListener("message", this.handleMessage)) {
|
|
146
|
+
this.socket.addEventListener("message", this.handleMessage);
|
|
147
|
+
}
|
|
148
|
+
if (!this.socket.hasEventListener("close", this.handleClose)) {
|
|
149
|
+
this.socket.addEventListener("close", this.handleClose);
|
|
150
|
+
}
|
|
151
|
+
if (!this.socket.hasEventListener("error", this.handleError)) {
|
|
152
|
+
this.socket.addEventListener("error", this.handleError);
|
|
153
|
+
}
|
|
146
154
|
return this;
|
|
147
155
|
}
|
|
148
156
|
/** Close the websocket and unregister event handlers. */
|
|
@@ -154,20 +162,11 @@ class VoiceConversationsSocket {
|
|
|
154
162
|
this.socket.removeEventListener("close", this.handleClose);
|
|
155
163
|
this.socket.removeEventListener("error", this.handleError);
|
|
156
164
|
}
|
|
157
|
-
/** Returns a promise that resolves when the websocket is open. */
|
|
165
|
+
/** Returns a promise that resolves when the websocket is open, and rejects if it errors or closes before opening. */
|
|
158
166
|
waitForOpen() {
|
|
159
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
return new Promise((resolve, reject) => {
|
|
164
|
-
this.socket.addEventListener("open", () => {
|
|
165
|
-
resolve(this.socket);
|
|
166
|
-
});
|
|
167
|
-
this.socket.addEventListener("error", (event) => {
|
|
168
|
-
reject(event);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
168
|
+
yield this.socket.waitForOpen();
|
|
169
|
+
return this.socket;
|
|
171
170
|
});
|
|
172
171
|
}
|
|
173
172
|
/** Asserts that the websocket is open. */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NormalizedClientOptions } from "../BaseClient";
|
|
2
|
+
import type * as core from "../core";
|
|
3
|
+
export declare class AnyAuthProvider implements core.AuthProvider {
|
|
4
|
+
private readonly authProviders;
|
|
5
|
+
constructor(authProviders: core.AuthProvider[]);
|
|
6
|
+
getAuthRequest(arg?: {
|
|
7
|
+
endpointMetadata?: core.EndpointMetadata;
|
|
8
|
+
}): Promise<core.AuthRequest>;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace AnyAuthProvider {
|
|
11
|
+
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
12
|
+
type AtLeastOneOf<T extends readonly any[]> = {
|
|
13
|
+
[K in keyof T]: T[K] & Partial<UnionToIntersection<T[number]>>;
|
|
14
|
+
}[number];
|
|
15
|
+
export type AuthOptions<TAuthProviders extends readonly any[]> = AtLeastOneOf<TAuthProviders>;
|
|
16
|
+
export type Options<TOptions extends readonly any[]> = Partial<UnionToIntersection<TOptions[number]>>;
|
|
17
|
+
type InstantiatableAuthProvider = {
|
|
18
|
+
canCreate: (opts: NormalizedClientOptions) => boolean;
|
|
19
|
+
createInstance: (opts: NormalizedClientOptions) => core.AuthProvider;
|
|
20
|
+
};
|
|
21
|
+
export function createInstance(options: NormalizedClientOptions, authProviderClasses: InstantiatableAuthProvider[]): core.AuthProvider;
|
|
22
|
+
export {};
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AnyAuthProvider = void 0;
|
|
14
|
+
class AnyAuthProvider {
|
|
15
|
+
constructor(authProviders) {
|
|
16
|
+
this.authProviders = authProviders;
|
|
17
|
+
}
|
|
18
|
+
getAuthRequest(arg) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const availableProviders = this.authProviders;
|
|
21
|
+
for (const provider of availableProviders) {
|
|
22
|
+
try {
|
|
23
|
+
const authRequest = yield provider.getAuthRequest(arg);
|
|
24
|
+
if (authRequest.headers.Authorization != null || Object.keys(authRequest.headers).length > 0) {
|
|
25
|
+
return authRequest;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (_e) {
|
|
29
|
+
// Continue to next auth provider
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// No auth credentials found
|
|
33
|
+
return { headers: {} };
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.AnyAuthProvider = AnyAuthProvider;
|
|
38
|
+
(function (AnyAuthProvider) {
|
|
39
|
+
function createInstance(options, authProviderClasses) {
|
|
40
|
+
const authProviders = authProviderClasses
|
|
41
|
+
.filter((providerClass) => providerClass.canCreate(options))
|
|
42
|
+
.map((providerClass) => providerClass.createInstance(options));
|
|
43
|
+
return new AnyAuthProvider(authProviders);
|
|
44
|
+
}
|
|
45
|
+
AnyAuthProvider.createInstance = createInstance;
|
|
46
|
+
})(AnyAuthProvider || (exports.AnyAuthProvider = AnyAuthProvider = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as core from "../core";
|
|
2
|
+
declare const TOKEN_PARAM: "token";
|
|
3
|
+
export declare class BearerAuthProvider implements core.AuthProvider {
|
|
4
|
+
private readonly options;
|
|
5
|
+
constructor(options: BearerAuthProvider.Options);
|
|
6
|
+
static canCreate(options: Partial<BearerAuthProvider.Options>): boolean;
|
|
7
|
+
getAuthRequest({ endpointMetadata, }?: {
|
|
8
|
+
endpointMetadata?: core.EndpointMetadata;
|
|
9
|
+
}): Promise<core.AuthRequest>;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace BearerAuthProvider {
|
|
12
|
+
const AUTH_SCHEME: "Bearer";
|
|
13
|
+
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
14
|
+
type Options = AuthOptions;
|
|
15
|
+
type AuthOptions = {
|
|
16
|
+
[TOKEN_PARAM]?: core.Supplier<core.BearerToken> | undefined;
|
|
17
|
+
};
|
|
18
|
+
function createInstance(options: Options): core.AuthProvider;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.BearerAuthProvider = void 0;
|
|
47
|
+
const core = __importStar(require("../core"));
|
|
48
|
+
const errors = __importStar(require("../errors/index"));
|
|
49
|
+
const TOKEN_PARAM = "token";
|
|
50
|
+
const ENV_TOKEN = "MAVENAGI_TOKEN";
|
|
51
|
+
class BearerAuthProvider {
|
|
52
|
+
constructor(options) {
|
|
53
|
+
this.options = options;
|
|
54
|
+
}
|
|
55
|
+
static canCreate(options) {
|
|
56
|
+
var _a;
|
|
57
|
+
return (options === null || options === void 0 ? void 0 : options[TOKEN_PARAM]) != null || ((_a = process.env) === null || _a === void 0 ? void 0 : _a[ENV_TOKEN]) != null;
|
|
58
|
+
}
|
|
59
|
+
getAuthRequest() {
|
|
60
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const token = (_a = (yield core.Supplier.get(this.options[TOKEN_PARAM]))) !== null && _a !== void 0 ? _a : (_b = process.env) === null || _b === void 0 ? void 0 : _b[ENV_TOKEN];
|
|
63
|
+
if (token == null) {
|
|
64
|
+
throw new errors.MavenAGIError({
|
|
65
|
+
message: BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.BearerAuthProvider = BearerAuthProvider;
|
|
75
|
+
(function (BearerAuthProvider) {
|
|
76
|
+
BearerAuthProvider.AUTH_SCHEME = "Bearer";
|
|
77
|
+
BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${TOKEN_PARAM}' when initializing the client, or set the '${ENV_TOKEN}' environment variable`;
|
|
78
|
+
function createInstance(options) {
|
|
79
|
+
return new BearerAuthProvider(options);
|
|
80
|
+
}
|
|
81
|
+
BearerAuthProvider.createInstance = createInstance;
|
|
82
|
+
})(BearerAuthProvider || (exports.BearerAuthProvider = BearerAuthProvider = {}));
|
package/auth/index.d.ts
CHANGED
package/auth/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BasicAuthProvider = void 0;
|
|
3
|
+
exports.BearerAuthProvider = exports.BasicAuthProvider = exports.AnyAuthProvider = void 0;
|
|
4
|
+
var AnyAuthProvider_1 = require("./AnyAuthProvider");
|
|
5
|
+
Object.defineProperty(exports, "AnyAuthProvider", { enumerable: true, get: function () { return AnyAuthProvider_1.AnyAuthProvider; } });
|
|
4
6
|
var BasicAuthProvider_1 = require("./BasicAuthProvider");
|
|
5
7
|
Object.defineProperty(exports, "BasicAuthProvider", { enumerable: true, get: function () { return BasicAuthProvider_1.BasicAuthProvider; } });
|
|
8
|
+
var BearerAuthProvider_1 = require("./BearerAuthProvider");
|
|
9
|
+
Object.defineProperty(exports, "BearerAuthProvider", { enumerable: true, get: function () { return BearerAuthProvider_1.BearerAuthProvider; } });
|
package/core/fetcher/Fetcher.js
CHANGED
|
@@ -24,6 +24,7 @@ const makeRequest_1 = require("./makeRequest");
|
|
|
24
24
|
const RawResponse_1 = require("./RawResponse");
|
|
25
25
|
const redactUrl_1 = require("./redactUrl");
|
|
26
26
|
const requestWithRetries_1 = require("./requestWithRetries");
|
|
27
|
+
const signals_1 = require("./signals");
|
|
27
28
|
const SENSITIVE_HEADERS = new Set([
|
|
28
29
|
"authorization",
|
|
29
30
|
"www-authenticate",
|
|
@@ -95,6 +96,11 @@ function getHeaders(args) {
|
|
|
95
96
|
return newHeaders;
|
|
96
97
|
});
|
|
97
98
|
}
|
|
99
|
+
function isJsonContentType(contentType) {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
const mediaType = (_b = (_a = contentType === null || contentType === void 0 ? void 0 : contentType.split(";")[0]) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) !== null && _b !== void 0 ? _b : "";
|
|
102
|
+
return mediaType === "application/json" || mediaType === "text/json" || mediaType.endsWith("+json");
|
|
103
|
+
}
|
|
98
104
|
function fetcherImpl(args) {
|
|
99
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
106
|
var _a, _b, _c;
|
|
@@ -122,10 +128,19 @@ function fetcherImpl(args) {
|
|
|
122
128
|
};
|
|
123
129
|
logger.debug("Making HTTP request", metadata);
|
|
124
130
|
}
|
|
131
|
+
// Bodies that are read in full here stay covered by the timeout; streamed bodies are read by the caller.
|
|
132
|
+
const keepTimeoutUntilBodyRead = args.responseType !== "streaming" && args.responseType !== "sse" && args.responseType !== "binary-response";
|
|
133
|
+
const attemptResponses = [];
|
|
125
134
|
try {
|
|
126
135
|
const response = yield (0, requestWithRetries_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
// A retry means the previous attempt is over; stop its timer now rather than at the end.
|
|
137
|
+
for (const previousResponse of attemptResponses) {
|
|
138
|
+
(0, makeRequest_1.clearResponseTimeout)(previousResponse);
|
|
139
|
+
}
|
|
140
|
+
const attemptResponse = yield (0, makeRequest_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex, args.responseType === "streaming" || args.responseType === "sse", keepTimeoutUntilBodyRead);
|
|
141
|
+
attemptResponses.push(attemptResponse);
|
|
142
|
+
return attemptResponse;
|
|
143
|
+
}), args.maxRetries, args.abortSignal);
|
|
129
144
|
if (response.status >= 200 && response.status < 400) {
|
|
130
145
|
if (logger.isDebug()) {
|
|
131
146
|
const metadata = {
|
|
@@ -137,6 +152,16 @@ function fetcherImpl(args) {
|
|
|
137
152
|
logger.debug("HTTP request succeeded", metadata);
|
|
138
153
|
}
|
|
139
154
|
const body = yield (0, getResponseBody_1.getResponseBody)(response, args.responseType);
|
|
155
|
+
// Only a body the server labelled as JSON is an error here; void endpoints may return plain text.
|
|
156
|
+
if ((0, getResponseBody_1.isResponseBodyError)(body) &&
|
|
157
|
+
body.error.reason === "non-json" &&
|
|
158
|
+
isJsonContentType(response.headers.get("Content-Type"))) {
|
|
159
|
+
return {
|
|
160
|
+
ok: false,
|
|
161
|
+
error: body.error,
|
|
162
|
+
rawResponse: (0, RawResponse_1.toRawResponse)(response),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
140
165
|
return {
|
|
141
166
|
ok: true,
|
|
142
167
|
body: body,
|
|
@@ -184,7 +209,7 @@ function fetcherImpl(args) {
|
|
|
184
209
|
rawResponse: RawResponse_1.abortRawResponse,
|
|
185
210
|
};
|
|
186
211
|
}
|
|
187
|
-
else if (error instanceof Error && error.name === "AbortError") {
|
|
212
|
+
else if (error === signals_1.TIMEOUT || (error instanceof Error && error.name === "AbortError")) {
|
|
188
213
|
if (logger.isError()) {
|
|
189
214
|
const metadata = {
|
|
190
215
|
method: args.method,
|
|
@@ -239,6 +264,11 @@ function fetcherImpl(args) {
|
|
|
239
264
|
rawResponse: RawResponse_1.unknownRawResponse,
|
|
240
265
|
};
|
|
241
266
|
}
|
|
267
|
+
finally {
|
|
268
|
+
for (const attemptResponse of attemptResponses) {
|
|
269
|
+
(0, makeRequest_1.clearResponseTimeout)(attemptResponse);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
242
272
|
});
|
|
243
273
|
}
|
|
244
274
|
exports.fetcher = fetcherImpl;
|
|
@@ -12,12 +12,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getErrorResponseBody = getErrorResponseBody;
|
|
13
13
|
const json_1 = require("../json");
|
|
14
14
|
const getResponseBody_1 = require("./getResponseBody");
|
|
15
|
+
/** Parses a JSON error body, falling back to the raw text so the status and body are never lost. */
|
|
16
|
+
function parseJsonErrorBody(text) {
|
|
17
|
+
if (text.length === 0) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return (0, json_1.fromJson)(text);
|
|
22
|
+
}
|
|
23
|
+
catch (_a) {
|
|
24
|
+
return text;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
15
27
|
function getErrorResponseBody(response) {
|
|
16
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
29
|
var _a, _b, _c;
|
|
18
30
|
let contentType = (_a = response.headers.get("Content-Type")) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
19
31
|
if (contentType == null || contentType.length === 0) {
|
|
20
|
-
|
|
32
|
+
const body = yield (0, getResponseBody_1.getResponseBody)(response);
|
|
33
|
+
if ((0, getResponseBody_1.isResponseBodyError)(body)) {
|
|
34
|
+
return body.error.reason === "non-json" ? body.error.rawBody : undefined;
|
|
35
|
+
}
|
|
36
|
+
return body;
|
|
21
37
|
}
|
|
22
38
|
if (contentType.indexOf(";") !== -1) {
|
|
23
39
|
contentType = (_c = (_b = contentType.split(";")[0]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : "";
|
|
@@ -28,14 +44,11 @@ function getErrorResponseBody(response) {
|
|
|
28
44
|
case "application/ld+json":
|
|
29
45
|
case "application/problem+json":
|
|
30
46
|
case "application/vnd.api+json":
|
|
31
|
-
case "text/json":
|
|
32
|
-
|
|
33
|
-
return text.length > 0 ? (0, json_1.fromJson)(text) : undefined;
|
|
34
|
-
}
|
|
47
|
+
case "text/json":
|
|
48
|
+
return parseJsonErrorBody(yield response.text());
|
|
35
49
|
default:
|
|
36
50
|
if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) {
|
|
37
|
-
|
|
38
|
-
return text.length > 0 ? (0, json_1.fromJson)(text) : undefined;
|
|
51
|
+
return parseJsonErrorBody(yield response.text());
|
|
39
52
|
}
|
|
40
53
|
// Fallback to plain text if content type is not recognized
|
|
41
54
|
// Even if no body is present, the response will be an empty string
|