mavenagi 1.2.10 → 1.2.12
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 +6 -0
- package/Client.js +32 -22
- package/api/resources/auth/client/Client.d.ts +33 -0
- package/api/resources/auth/client/Client.js +171 -0
- package/api/resources/auth/client/index.d.ts +1 -0
- package/api/resources/auth/client/index.js +2 -0
- package/api/resources/auth/index.d.ts +2 -0
- package/api/resources/auth/index.js +18 -0
- package/api/resources/auth/types/SessionTokenRequest.d.ts +3 -0
- package/api/resources/auth/types/SessionTokenRequest.js +3 -0
- package/api/resources/auth/types/SessionTokenResponse.d.ts +6 -0
- package/api/resources/auth/types/SessionTokenResponse.js +3 -0
- package/api/resources/auth/types/index.d.ts +2 -0
- package/api/resources/auth/types/index.js +18 -0
- package/api/resources/commons/types/ActionBase.d.ts +1 -11
- package/api/resources/commons/types/ActionParameterType.d.ts +3 -0
- package/api/resources/commons/types/ActionParameterType.js +3 -0
- package/api/resources/commons/types/ActionProperties.d.ts +13 -0
- package/api/resources/commons/types/ActionProperties.js +3 -0
- package/api/resources/commons/types/ActionUser.d.ts +46 -0
- package/api/resources/commons/types/ActionUser.js +3 -0
- package/api/resources/commons/types/EntityType.d.ts +1 -0
- package/api/resources/commons/types/EntityType.js +1 -0
- package/api/resources/commons/types/EventField.d.ts +1 -0
- package/api/resources/commons/types/EventField.js +1 -0
- package/api/resources/commons/types/MetadataPrecondition.d.ts +3 -1
- package/api/resources/commons/types/PreconditionOperator.d.ts +20 -0
- package/api/resources/commons/types/PreconditionOperator.js +20 -0
- package/api/resources/commons/types/UserEvent.d.ts +2 -0
- package/api/resources/commons/types/index.d.ts +3 -0
- package/api/resources/commons/types/index.js +3 -0
- package/api/resources/index.d.ts +4 -0
- package/api/resources/index.js +5 -1
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +2 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -1
- package/api/resources/segments/types/SegmentResponse.d.ts +6 -0
- package/api/resources/triggers/types/index.d.ts +0 -1
- package/api/resources/triggers/types/index.js +0 -1
- package/api/resources/websockets/client/Client.d.ts +22 -0
- package/api/resources/websockets/client/Client.js +89 -0
- package/api/resources/websockets/client/Socket.d.ts +48 -0
- package/api/resources/websockets/client/Socket.js +172 -0
- package/api/resources/websockets/client/index.d.ts +1 -0
- package/api/resources/websockets/client/index.js +2 -0
- package/api/resources/websockets/index.d.ts +2 -0
- package/api/resources/websockets/index.js +18 -0
- package/api/resources/websockets/types/AgentAudioChunk.d.ts +9 -0
- package/api/resources/websockets/types/AgentAudioChunk.js +3 -0
- package/api/resources/websockets/types/AgentTranscript.d.ts +9 -0
- package/api/resources/websockets/types/AgentTranscript.js +3 -0
- package/api/resources/websockets/types/AudioFormat.d.ts +7 -0
- package/api/resources/websockets/types/AudioFormat.js +10 -0
- package/api/resources/websockets/types/Config.d.ts +15 -0
- package/api/resources/websockets/types/Config.js +3 -0
- package/api/resources/websockets/types/ConversationEnded.d.ts +7 -0
- package/api/resources/websockets/types/ConversationEnded.js +3 -0
- package/api/resources/websockets/types/ConversationReady.d.ts +6 -0
- package/api/resources/websockets/types/ConversationReady.js +3 -0
- package/api/resources/websockets/types/Error_.d.ts +9 -0
- package/api/resources/websockets/types/Error_.js +3 -0
- package/api/resources/websockets/types/ServerEventBase.d.ts +6 -0
- package/api/resources/websockets/types/ServerEventBase.js +3 -0
- package/api/resources/websockets/types/UserAudioChunk.d.ts +8 -0
- package/api/resources/websockets/types/UserAudioChunk.js +3 -0
- package/api/resources/websockets/types/UserFinishedSpeaking.d.ts +7 -0
- package/api/resources/websockets/types/UserFinishedSpeaking.js +3 -0
- package/api/resources/websockets/types/UserStartedSpeaking.d.ts +7 -0
- package/api/resources/websockets/types/UserStartedSpeaking.js +3 -0
- package/api/resources/websockets/types/UserTranscript.d.ts +9 -0
- package/api/resources/websockets/types/UserTranscript.js +3 -0
- package/api/resources/websockets/types/index.d.ts +12 -0
- package/api/resources/websockets/types/index.js +28 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/websocket/events.d.ts +36 -0
- package/core/websocket/events.js +27 -0
- package/core/websocket/index.d.ts +1 -0
- package/core/websocket/index.js +17 -0
- package/core/websocket/ws.d.ts +147 -0
- package/core/websocket/ws.js +444 -0
- package/dist/Client.d.ts +6 -0
- package/dist/Client.js +32 -22
- package/dist/api/resources/auth/client/Client.d.ts +33 -0
- package/dist/api/resources/auth/client/Client.js +171 -0
- package/dist/api/resources/auth/client/index.d.ts +1 -0
- package/dist/api/resources/auth/client/index.js +2 -0
- package/dist/api/resources/auth/index.d.ts +2 -0
- package/dist/api/resources/auth/index.js +18 -0
- package/dist/api/resources/auth/types/SessionTokenRequest.d.ts +3 -0
- package/dist/api/resources/auth/types/SessionTokenRequest.js +3 -0
- package/dist/api/resources/auth/types/SessionTokenResponse.d.ts +6 -0
- package/dist/api/resources/auth/types/SessionTokenResponse.js +3 -0
- package/dist/api/resources/auth/types/index.d.ts +2 -0
- package/dist/api/resources/auth/types/index.js +18 -0
- package/dist/api/resources/commons/types/ActionBase.d.ts +1 -11
- package/dist/api/resources/commons/types/ActionParameterType.d.ts +3 -0
- package/dist/api/resources/commons/types/ActionParameterType.js +3 -0
- package/dist/api/resources/commons/types/ActionProperties.d.ts +13 -0
- package/dist/api/resources/commons/types/ActionProperties.js +3 -0
- package/dist/api/resources/commons/types/ActionUser.d.ts +46 -0
- package/dist/api/resources/commons/types/ActionUser.js +3 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +1 -0
- package/dist/api/resources/commons/types/EntityType.js +1 -0
- package/dist/api/resources/commons/types/EventField.d.ts +1 -0
- package/dist/api/resources/commons/types/EventField.js +1 -0
- package/dist/api/resources/commons/types/MetadataPrecondition.d.ts +3 -1
- package/dist/api/resources/commons/types/PreconditionOperator.d.ts +20 -0
- package/dist/api/resources/commons/types/PreconditionOperator.js +20 -0
- package/dist/api/resources/commons/types/UserEvent.d.ts +2 -0
- package/dist/api/resources/commons/types/index.d.ts +3 -0
- package/dist/api/resources/commons/types/index.js +3 -0
- package/dist/api/resources/index.d.ts +4 -0
- package/dist/api/resources/index.js +5 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +2 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -1
- package/dist/api/resources/segments/types/SegmentResponse.d.ts +6 -0
- package/dist/api/resources/triggers/types/index.d.ts +0 -1
- package/dist/api/resources/triggers/types/index.js +0 -1
- package/dist/api/resources/websockets/client/Client.d.ts +22 -0
- package/dist/api/resources/websockets/client/Client.js +89 -0
- package/dist/api/resources/websockets/client/Socket.d.ts +48 -0
- package/dist/api/resources/websockets/client/Socket.js +172 -0
- package/dist/api/resources/websockets/client/index.d.ts +1 -0
- package/dist/api/resources/websockets/client/index.js +2 -0
- package/dist/api/resources/websockets/index.d.ts +2 -0
- package/dist/api/resources/websockets/index.js +18 -0
- package/dist/api/resources/websockets/types/AgentAudioChunk.d.ts +9 -0
- package/dist/api/resources/websockets/types/AgentAudioChunk.js +3 -0
- package/dist/api/resources/websockets/types/AgentTranscript.d.ts +9 -0
- package/dist/api/resources/websockets/types/AgentTranscript.js +3 -0
- package/dist/api/resources/websockets/types/AudioFormat.d.ts +7 -0
- package/dist/api/resources/websockets/types/AudioFormat.js +10 -0
- package/dist/api/resources/websockets/types/Config.d.ts +15 -0
- package/dist/api/resources/websockets/types/Config.js +3 -0
- package/dist/api/resources/websockets/types/ConversationEnded.d.ts +7 -0
- package/dist/api/resources/websockets/types/ConversationEnded.js +3 -0
- package/dist/api/resources/websockets/types/ConversationReady.d.ts +6 -0
- package/dist/api/resources/websockets/types/ConversationReady.js +3 -0
- package/dist/api/resources/websockets/types/Error_.d.ts +9 -0
- package/dist/api/resources/websockets/types/Error_.js +3 -0
- package/dist/api/resources/websockets/types/ServerEventBase.d.ts +6 -0
- package/dist/api/resources/websockets/types/ServerEventBase.js +3 -0
- package/dist/api/resources/websockets/types/UserAudioChunk.d.ts +8 -0
- package/dist/api/resources/websockets/types/UserAudioChunk.js +3 -0
- package/dist/api/resources/websockets/types/UserFinishedSpeaking.d.ts +7 -0
- package/dist/api/resources/websockets/types/UserFinishedSpeaking.js +3 -0
- package/dist/api/resources/websockets/types/UserStartedSpeaking.d.ts +7 -0
- package/dist/api/resources/websockets/types/UserStartedSpeaking.js +3 -0
- package/dist/api/resources/websockets/types/UserTranscript.d.ts +9 -0
- package/dist/api/resources/websockets/types/UserTranscript.js +3 -0
- package/dist/api/resources/websockets/types/index.d.ts +12 -0
- package/dist/api/resources/websockets/types/index.js +28 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/websocket/events.d.ts +36 -0
- package/dist/core/websocket/events.js +27 -0
- package/dist/core/websocket/index.d.ts +1 -0
- package/dist/core/websocket/index.js +17 -0
- package/dist/core/websocket/ws.d.ts +147 -0
- package/dist/core/websocket/ws.js +444 -0
- package/dist/serialization/resources/auth/index.d.ts +1 -0
- package/dist/serialization/resources/auth/index.js +17 -0
- package/dist/serialization/resources/auth/types/SessionTokenRequest.d.ts +9 -0
- package/dist/serialization/resources/auth/types/SessionTokenRequest.js +41 -0
- package/dist/serialization/resources/auth/types/SessionTokenResponse.d.ts +10 -0
- package/dist/serialization/resources/auth/types/SessionTokenResponse.js +42 -0
- package/dist/serialization/resources/auth/types/index.d.ts +2 -0
- package/dist/serialization/resources/auth/types/index.js +18 -0
- package/dist/serialization/resources/commons/types/ActionBase.d.ts +3 -8
- package/dist/serialization/resources/commons/types/ActionBase.js +5 -9
- package/dist/serialization/resources/commons/types/ActionParameterType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/ActionParameterType.js +1 -0
- package/dist/serialization/resources/commons/types/ActionProperties.d.ts +14 -0
- package/dist/serialization/resources/commons/types/ActionProperties.js +47 -0
- package/dist/serialization/resources/commons/types/ActionUser.d.ts +17 -0
- package/dist/serialization/resources/commons/types/ActionUser.js +49 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +1 -0
- package/dist/serialization/resources/commons/types/EventField.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EventField.js +1 -0
- package/dist/serialization/resources/commons/types/MetadataPrecondition.d.ts +1 -0
- package/dist/serialization/resources/commons/types/MetadataPrecondition.js +1 -0
- package/dist/serialization/resources/commons/types/PreconditionOperator.d.ts +1 -1
- package/dist/serialization/resources/commons/types/PreconditionOperator.js +9 -1
- package/dist/serialization/resources/commons/types/UserEvent.d.ts +1 -0
- package/dist/serialization/resources/commons/types/UserEvent.js +1 -0
- package/dist/serialization/resources/commons/types/index.d.ts +3 -0
- package/dist/serialization/resources/commons/types/index.js +3 -0
- package/dist/serialization/resources/index.d.ts +5 -0
- package/dist/serialization/resources/index.js +6 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -1
- package/dist/serialization/resources/segments/types/SegmentResponse.d.ts +2 -0
- package/dist/serialization/resources/segments/types/SegmentResponse.js +2 -0
- package/dist/serialization/resources/triggers/types/EventTriggerBase.d.ts +1 -1
- package/dist/serialization/resources/triggers/types/EventTriggerBase.js +1 -1
- package/dist/serialization/resources/triggers/types/index.d.ts +0 -1
- package/dist/serialization/resources/triggers/types/index.js +0 -1
- package/dist/serialization/resources/websockets/client/index.d.ts +1 -0
- package/dist/serialization/resources/websockets/client/index.js +17 -0
- package/dist/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +15 -0
- package/dist/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +56 -0
- package/dist/serialization/resources/websockets/client/socket/index.d.ts +1 -0
- package/dist/serialization/resources/websockets/client/socket/index.js +5 -0
- package/dist/serialization/resources/websockets/index.d.ts +2 -0
- package/dist/serialization/resources/websockets/index.js +18 -0
- package/dist/serialization/resources/websockets/types/AgentAudioChunk.d.ts +11 -0
- package/dist/serialization/resources/websockets/types/AgentAudioChunk.js +45 -0
- package/dist/serialization/resources/websockets/types/AgentTranscript.d.ts +11 -0
- package/dist/serialization/resources/websockets/types/AgentTranscript.js +45 -0
- package/dist/serialization/resources/websockets/types/AudioFormat.d.ts +7 -0
- package/dist/serialization/resources/websockets/types/AudioFormat.js +39 -0
- package/dist/serialization/resources/websockets/types/Config.d.ts +14 -0
- package/dist/serialization/resources/websockets/types/Config.js +46 -0
- package/dist/serialization/resources/websockets/types/ConversationEnded.d.ts +10 -0
- package/dist/serialization/resources/websockets/types/ConversationEnded.js +44 -0
- package/dist/serialization/resources/websockets/types/ConversationReady.d.ts +9 -0
- package/dist/serialization/resources/websockets/types/ConversationReady.js +41 -0
- package/dist/serialization/resources/websockets/types/Error_.d.ts +12 -0
- package/dist/serialization/resources/websockets/types/Error_.js +46 -0
- package/dist/serialization/resources/websockets/types/ServerEventBase.d.ts +9 -0
- package/dist/serialization/resources/websockets/types/ServerEventBase.js +41 -0
- package/dist/serialization/resources/websockets/types/UserAudioChunk.d.ts +10 -0
- package/dist/serialization/resources/websockets/types/UserAudioChunk.js +42 -0
- package/dist/serialization/resources/websockets/types/UserFinishedSpeaking.d.ts +10 -0
- package/dist/serialization/resources/websockets/types/UserFinishedSpeaking.js +44 -0
- package/dist/serialization/resources/websockets/types/UserStartedSpeaking.d.ts +10 -0
- package/dist/serialization/resources/websockets/types/UserStartedSpeaking.js +44 -0
- package/dist/serialization/resources/websockets/types/UserTranscript.d.ts +11 -0
- package/dist/serialization/resources/websockets/types/UserTranscript.js +45 -0
- package/dist/serialization/resources/websockets/types/index.d.ts +12 -0
- package/dist/serialization/resources/websockets/types/index.js +28 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
- package/reference.md +73 -5
- package/serialization/resources/auth/index.d.ts +1 -0
- package/serialization/resources/auth/index.js +17 -0
- package/serialization/resources/auth/types/SessionTokenRequest.d.ts +9 -0
- package/serialization/resources/auth/types/SessionTokenRequest.js +41 -0
- package/serialization/resources/auth/types/SessionTokenResponse.d.ts +10 -0
- package/serialization/resources/auth/types/SessionTokenResponse.js +42 -0
- package/serialization/resources/auth/types/index.d.ts +2 -0
- package/serialization/resources/auth/types/index.js +18 -0
- package/serialization/resources/commons/types/ActionBase.d.ts +3 -8
- package/serialization/resources/commons/types/ActionBase.js +5 -9
- package/serialization/resources/commons/types/ActionParameterType.d.ts +1 -1
- package/serialization/resources/commons/types/ActionParameterType.js +1 -0
- package/serialization/resources/commons/types/ActionProperties.d.ts +14 -0
- package/serialization/resources/commons/types/ActionProperties.js +47 -0
- package/serialization/resources/commons/types/ActionUser.d.ts +17 -0
- package/serialization/resources/commons/types/ActionUser.js +49 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/serialization/resources/commons/types/EventField.d.ts +1 -1
- package/serialization/resources/commons/types/EventField.js +1 -0
- package/serialization/resources/commons/types/MetadataPrecondition.d.ts +1 -0
- package/serialization/resources/commons/types/MetadataPrecondition.js +1 -0
- package/serialization/resources/commons/types/PreconditionOperator.d.ts +1 -1
- package/serialization/resources/commons/types/PreconditionOperator.js +9 -1
- package/serialization/resources/commons/types/UserEvent.d.ts +1 -0
- package/serialization/resources/commons/types/UserEvent.js +1 -0
- package/serialization/resources/commons/types/index.d.ts +3 -0
- package/serialization/resources/commons/types/index.js +3 -0
- package/serialization/resources/index.d.ts +5 -0
- package/serialization/resources/index.js +6 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -1
- package/serialization/resources/segments/types/SegmentResponse.d.ts +2 -0
- package/serialization/resources/segments/types/SegmentResponse.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerBase.d.ts +1 -1
- package/serialization/resources/triggers/types/EventTriggerBase.js +1 -1
- package/serialization/resources/triggers/types/index.d.ts +0 -1
- package/serialization/resources/triggers/types/index.js +0 -1
- package/serialization/resources/websockets/client/index.d.ts +1 -0
- package/serialization/resources/websockets/client/index.js +17 -0
- package/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +15 -0
- package/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +56 -0
- package/serialization/resources/websockets/client/socket/index.d.ts +1 -0
- package/serialization/resources/websockets/client/socket/index.js +5 -0
- package/serialization/resources/websockets/index.d.ts +2 -0
- package/serialization/resources/websockets/index.js +18 -0
- package/serialization/resources/websockets/types/AgentAudioChunk.d.ts +11 -0
- package/serialization/resources/websockets/types/AgentAudioChunk.js +45 -0
- package/serialization/resources/websockets/types/AgentTranscript.d.ts +11 -0
- package/serialization/resources/websockets/types/AgentTranscript.js +45 -0
- package/serialization/resources/websockets/types/AudioFormat.d.ts +7 -0
- package/serialization/resources/websockets/types/AudioFormat.js +39 -0
- package/serialization/resources/websockets/types/Config.d.ts +14 -0
- package/serialization/resources/websockets/types/Config.js +46 -0
- package/serialization/resources/websockets/types/ConversationEnded.d.ts +10 -0
- package/serialization/resources/websockets/types/ConversationEnded.js +44 -0
- package/serialization/resources/websockets/types/ConversationReady.d.ts +9 -0
- package/serialization/resources/websockets/types/ConversationReady.js +41 -0
- package/serialization/resources/websockets/types/Error_.d.ts +12 -0
- package/serialization/resources/websockets/types/Error_.js +46 -0
- package/serialization/resources/websockets/types/ServerEventBase.d.ts +9 -0
- package/serialization/resources/websockets/types/ServerEventBase.js +41 -0
- package/serialization/resources/websockets/types/UserAudioChunk.d.ts +10 -0
- package/serialization/resources/websockets/types/UserAudioChunk.js +42 -0
- package/serialization/resources/websockets/types/UserFinishedSpeaking.d.ts +10 -0
- package/serialization/resources/websockets/types/UserFinishedSpeaking.js +44 -0
- package/serialization/resources/websockets/types/UserStartedSpeaking.d.ts +10 -0
- package/serialization/resources/websockets/types/UserStartedSpeaking.js +44 -0
- package/serialization/resources/websockets/types/UserTranscript.d.ts +11 -0
- package/serialization/resources/websockets/types/UserTranscript.js +45 -0
- package/serialization/resources/websockets/types/index.d.ts +12 -0
- package/serialization/resources/websockets/types/index.js +28 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
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.Websockets = void 0;
|
|
47
|
+
const core = __importStar(require("../../../../core"));
|
|
48
|
+
const headers_1 = require("../../../../core/headers");
|
|
49
|
+
const environments = __importStar(require("../../../../environments"));
|
|
50
|
+
const Socket_1 = require("./Socket");
|
|
51
|
+
class Websockets {
|
|
52
|
+
constructor(_options) {
|
|
53
|
+
this._options = _options;
|
|
54
|
+
}
|
|
55
|
+
connect(args) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const { version, headers, debug, reconnectAttempts } = args;
|
|
59
|
+
const _queryParams = {};
|
|
60
|
+
if (version != null) {
|
|
61
|
+
_queryParams.version = version;
|
|
62
|
+
}
|
|
63
|
+
const _headers = (0, headers_1.mergeHeaders)((0, headers_1.mergeOnlyDefinedHeaders)({ Authorization: args.Authorization }), headers);
|
|
64
|
+
const socket = new core.ReconnectingWebSocket({
|
|
65
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/realtime/conversations"),
|
|
66
|
+
protocols: [],
|
|
67
|
+
queryParameters: _queryParams,
|
|
68
|
+
headers: _headers,
|
|
69
|
+
options: { debug: debug !== null && debug !== void 0 ? debug : false, maxRetries: reconnectAttempts !== null && reconnectAttempts !== void 0 ? reconnectAttempts : 30 },
|
|
70
|
+
});
|
|
71
|
+
return new Socket_1.WebsocketsSocket({ socket });
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
_getAuthorizationHeader() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
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;
|
|
78
|
+
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;
|
|
79
|
+
if (appId != null && appSecret != null) {
|
|
80
|
+
return core.BasicAuth.toAuthorizationHeader({
|
|
81
|
+
username: appId,
|
|
82
|
+
password: appSecret,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.Websockets = Websockets;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as core from "../../../../core";
|
|
2
|
+
import type * as MavenAGI from "../../../index";
|
|
3
|
+
export declare namespace WebsocketsSocket {
|
|
4
|
+
interface Args {
|
|
5
|
+
socket: core.ReconnectingWebSocket;
|
|
6
|
+
}
|
|
7
|
+
type Response = MavenAGI.ConversationReady | MavenAGI.AgentAudioChunk | MavenAGI.UserTranscript | MavenAGI.AgentTranscript | MavenAGI.ConversationEnded | MavenAGI.UserStartedSpeaking | MavenAGI.UserFinishedSpeaking | MavenAGI.Error_;
|
|
8
|
+
type EventHandlers = {
|
|
9
|
+
open?: () => void;
|
|
10
|
+
message?: (message: Response) => void;
|
|
11
|
+
close?: (event: core.CloseEvent) => void;
|
|
12
|
+
error?: (error: Error) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare class WebsocketsSocket {
|
|
16
|
+
readonly socket: core.ReconnectingWebSocket;
|
|
17
|
+
protected readonly eventHandlers: WebsocketsSocket.EventHandlers;
|
|
18
|
+
private handleOpen;
|
|
19
|
+
private handleMessage;
|
|
20
|
+
private handleClose;
|
|
21
|
+
private handleError;
|
|
22
|
+
constructor(args: WebsocketsSocket.Args);
|
|
23
|
+
/** The current state of the connection; this is one of the readyState constants. */
|
|
24
|
+
get readyState(): number;
|
|
25
|
+
/**
|
|
26
|
+
* @param event - The event to attach to.
|
|
27
|
+
* @param callback - The callback to run when the event is triggered.
|
|
28
|
+
* Usage:
|
|
29
|
+
* ```typescript
|
|
30
|
+
* this.on('open', () => {
|
|
31
|
+
* console.log('The websocket is open');
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
on<T extends keyof WebsocketsSocket.EventHandlers>(event: T, callback: WebsocketsSocket.EventHandlers[T]): void;
|
|
36
|
+
sendConfig(message: MavenAGI.Config): void;
|
|
37
|
+
sendUserAudioChunk(message: MavenAGI.UserAudioChunk): void;
|
|
38
|
+
/** Connect to the websocket and register event handlers. */
|
|
39
|
+
connect(): WebsocketsSocket;
|
|
40
|
+
/** Close the websocket and unregister event handlers. */
|
|
41
|
+
close(): void;
|
|
42
|
+
/** Returns a promise that resolves when the websocket is open. */
|
|
43
|
+
waitForOpen(): Promise<core.ReconnectingWebSocket>;
|
|
44
|
+
/** Asserts that the websocket is open. */
|
|
45
|
+
private assertSocketIsOpen;
|
|
46
|
+
/** Send a binary payload to the websocket. */
|
|
47
|
+
protected sendBinary(payload: ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
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.WebsocketsSocket = void 0;
|
|
47
|
+
const core = __importStar(require("../../../../core"));
|
|
48
|
+
const json_1 = require("../../../../core/json");
|
|
49
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
50
|
+
const Config_1 = require("../../../../serialization/resources/websockets/types/Config");
|
|
51
|
+
const UserAudioChunk_1 = require("../../../../serialization/resources/websockets/types/UserAudioChunk");
|
|
52
|
+
class WebsocketsSocket {
|
|
53
|
+
constructor(args) {
|
|
54
|
+
this.eventHandlers = {};
|
|
55
|
+
this.handleOpen = () => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
(_b = (_a = this.eventHandlers).open) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
58
|
+
};
|
|
59
|
+
this.handleMessage = (event) => {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
const data = (0, json_1.fromJson)(event.data);
|
|
62
|
+
const parsedResponse = serializers.WebsocketsSocketResponse.parse(data, {
|
|
63
|
+
unrecognizedObjectKeys: "passthrough",
|
|
64
|
+
allowUnrecognizedUnionMembers: true,
|
|
65
|
+
allowUnrecognizedEnumValues: true,
|
|
66
|
+
});
|
|
67
|
+
if (parsedResponse.ok) {
|
|
68
|
+
(_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, parsedResponse.value);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
(_d = (_c = this.eventHandlers).error) === null || _d === void 0 ? void 0 : _d.call(_c, new Error("Received unknown message type"));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this.handleClose = (event) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
(_b = (_a = this.eventHandlers).close) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
77
|
+
};
|
|
78
|
+
this.handleError = (event) => {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const message = event.message;
|
|
81
|
+
(_b = (_a = this.eventHandlers).error) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(message));
|
|
82
|
+
};
|
|
83
|
+
this.socket = args.socket;
|
|
84
|
+
this.socket.addEventListener("open", this.handleOpen);
|
|
85
|
+
this.socket.addEventListener("message", this.handleMessage);
|
|
86
|
+
this.socket.addEventListener("close", this.handleClose);
|
|
87
|
+
this.socket.addEventListener("error", this.handleError);
|
|
88
|
+
}
|
|
89
|
+
/** The current state of the connection; this is one of the readyState constants. */
|
|
90
|
+
get readyState() {
|
|
91
|
+
return this.socket.readyState;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @param event - The event to attach to.
|
|
95
|
+
* @param callback - The callback to run when the event is triggered.
|
|
96
|
+
* Usage:
|
|
97
|
+
* ```typescript
|
|
98
|
+
* this.on('open', () => {
|
|
99
|
+
* console.log('The websocket is open');
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
on(event, callback) {
|
|
104
|
+
this.eventHandlers[event] = callback;
|
|
105
|
+
}
|
|
106
|
+
sendConfig(message) {
|
|
107
|
+
this.assertSocketIsOpen();
|
|
108
|
+
const jsonPayload = Config_1.Config.jsonOrThrow(message, {
|
|
109
|
+
unrecognizedObjectKeys: "passthrough",
|
|
110
|
+
allowUnrecognizedUnionMembers: true,
|
|
111
|
+
allowUnrecognizedEnumValues: true,
|
|
112
|
+
});
|
|
113
|
+
this.socket.send(JSON.stringify(jsonPayload));
|
|
114
|
+
}
|
|
115
|
+
sendUserAudioChunk(message) {
|
|
116
|
+
this.assertSocketIsOpen();
|
|
117
|
+
const jsonPayload = UserAudioChunk_1.UserAudioChunk.jsonOrThrow(message, {
|
|
118
|
+
unrecognizedObjectKeys: "passthrough",
|
|
119
|
+
allowUnrecognizedUnionMembers: true,
|
|
120
|
+
allowUnrecognizedEnumValues: true,
|
|
121
|
+
});
|
|
122
|
+
this.socket.send(JSON.stringify(jsonPayload));
|
|
123
|
+
}
|
|
124
|
+
/** Connect to the websocket and register event handlers. */
|
|
125
|
+
connect() {
|
|
126
|
+
this.socket.reconnect();
|
|
127
|
+
this.socket.addEventListener("open", this.handleOpen);
|
|
128
|
+
this.socket.addEventListener("message", this.handleMessage);
|
|
129
|
+
this.socket.addEventListener("close", this.handleClose);
|
|
130
|
+
this.socket.addEventListener("error", this.handleError);
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
/** Close the websocket and unregister event handlers. */
|
|
134
|
+
close() {
|
|
135
|
+
this.socket.close();
|
|
136
|
+
this.handleClose({ code: 1000 });
|
|
137
|
+
this.socket.removeEventListener("open", this.handleOpen);
|
|
138
|
+
this.socket.removeEventListener("message", this.handleMessage);
|
|
139
|
+
this.socket.removeEventListener("close", this.handleClose);
|
|
140
|
+
this.socket.removeEventListener("error", this.handleError);
|
|
141
|
+
}
|
|
142
|
+
/** Returns a promise that resolves when the websocket is open. */
|
|
143
|
+
waitForOpen() {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
if (this.socket.readyState === core.ReconnectingWebSocket.OPEN) {
|
|
146
|
+
return this.socket;
|
|
147
|
+
}
|
|
148
|
+
return new Promise((resolve, reject) => {
|
|
149
|
+
this.socket.addEventListener("open", () => {
|
|
150
|
+
resolve(this.socket);
|
|
151
|
+
});
|
|
152
|
+
this.socket.addEventListener("error", (event) => {
|
|
153
|
+
reject(event);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/** Asserts that the websocket is open. */
|
|
159
|
+
assertSocketIsOpen() {
|
|
160
|
+
if (!this.socket) {
|
|
161
|
+
throw new Error("Socket is not connected.");
|
|
162
|
+
}
|
|
163
|
+
if (this.socket.readyState !== core.ReconnectingWebSocket.OPEN) {
|
|
164
|
+
throw new Error("Socket is not open.");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** Send a binary payload to the websocket. */
|
|
168
|
+
sendBinary(payload) {
|
|
169
|
+
this.socket.send(payload);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.WebsocketsSocket = WebsocketsSocket;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AudioFormat = void 0;
|
|
5
|
+
exports.AudioFormat = {
|
|
6
|
+
Pcm44100: "PCM_44100",
|
|
7
|
+
Pcm16000: "PCM_16000",
|
|
8
|
+
Pcm8000: "PCM_8000",
|
|
9
|
+
Mulaw8000: "MULAW_8000",
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* Initialize conversation with configuration parameters
|
|
4
|
+
*/
|
|
5
|
+
export interface Config {
|
|
6
|
+
type: "config";
|
|
7
|
+
/** The user text to send into the conversation. */
|
|
8
|
+
inputFormat: MavenAGI.AudioFormat;
|
|
9
|
+
/** The user text to send into the conversation. */
|
|
10
|
+
outputFormat: MavenAGI.AudioFormat;
|
|
11
|
+
/** The conversation ID which was created prior to starting this conversation. */
|
|
12
|
+
conversationId: string;
|
|
13
|
+
/** The app ID this conversation ID is associated with. */
|
|
14
|
+
appId: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./AgentAudioChunk";
|
|
2
|
+
export * from "./AgentTranscript";
|
|
3
|
+
export * from "./AudioFormat";
|
|
4
|
+
export * from "./Config";
|
|
5
|
+
export * from "./ConversationEnded";
|
|
6
|
+
export * from "./ConversationReady";
|
|
7
|
+
export * from "./Error_";
|
|
8
|
+
export * from "./ServerEventBase";
|
|
9
|
+
export * from "./UserAudioChunk";
|
|
10
|
+
export * from "./UserFinishedSpeaking";
|
|
11
|
+
export * from "./UserStartedSpeaking";
|
|
12
|
+
export * from "./UserTranscript";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AgentAudioChunk"), exports);
|
|
18
|
+
__exportStar(require("./AgentTranscript"), exports);
|
|
19
|
+
__exportStar(require("./AudioFormat"), exports);
|
|
20
|
+
__exportStar(require("./Config"), exports);
|
|
21
|
+
__exportStar(require("./ConversationEnded"), exports);
|
|
22
|
+
__exportStar(require("./ConversationReady"), exports);
|
|
23
|
+
__exportStar(require("./Error_"), exports);
|
|
24
|
+
__exportStar(require("./ServerEventBase"), exports);
|
|
25
|
+
__exportStar(require("./UserAudioChunk"), exports);
|
|
26
|
+
__exportStar(require("./UserFinishedSpeaking"), exports);
|
|
27
|
+
__exportStar(require("./UserStartedSpeaking"), exports);
|
|
28
|
+
__exportStar(require("./UserTranscript"), exports);
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare class Event {
|
|
2
|
+
target: any;
|
|
3
|
+
type: string;
|
|
4
|
+
constructor(type: string, target: any);
|
|
5
|
+
}
|
|
6
|
+
export declare class ErrorEvent extends Event {
|
|
7
|
+
message: string;
|
|
8
|
+
error: Error;
|
|
9
|
+
constructor(error: Error, target: any);
|
|
10
|
+
}
|
|
11
|
+
export declare class CloseEvent extends Event {
|
|
12
|
+
code: number;
|
|
13
|
+
reason: string;
|
|
14
|
+
wasClean: boolean;
|
|
15
|
+
constructor(code: number | undefined, reason: string | undefined, target: any);
|
|
16
|
+
}
|
|
17
|
+
export interface WebSocketEventMap {
|
|
18
|
+
close: CloseEvent;
|
|
19
|
+
error: ErrorEvent;
|
|
20
|
+
message: MessageEvent;
|
|
21
|
+
open: Event;
|
|
22
|
+
}
|
|
23
|
+
export interface WebSocketEventListenerMap {
|
|
24
|
+
close: (event: CloseEvent) => void | {
|
|
25
|
+
handleEvent: (event: CloseEvent) => void;
|
|
26
|
+
};
|
|
27
|
+
error: (event: ErrorEvent) => void | {
|
|
28
|
+
handleEvent: (event: ErrorEvent) => void;
|
|
29
|
+
};
|
|
30
|
+
message: (event: MessageEvent) => void | {
|
|
31
|
+
handleEvent: (event: MessageEvent) => void;
|
|
32
|
+
};
|
|
33
|
+
open: (event: Event) => void | {
|
|
34
|
+
handleEvent: (event: Event) => void;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloseEvent = exports.ErrorEvent = exports.Event = void 0;
|
|
4
|
+
class Event {
|
|
5
|
+
constructor(type, target) {
|
|
6
|
+
this.target = target;
|
|
7
|
+
this.type = type;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Event = Event;
|
|
11
|
+
class ErrorEvent extends Event {
|
|
12
|
+
constructor(error, target) {
|
|
13
|
+
super("error", target);
|
|
14
|
+
this.message = error.message;
|
|
15
|
+
this.error = error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ErrorEvent = ErrorEvent;
|
|
19
|
+
class CloseEvent extends Event {
|
|
20
|
+
constructor(code = 1000, reason = "", target) {
|
|
21
|
+
super("close", target);
|
|
22
|
+
this.wasClean = true;
|
|
23
|
+
this.code = code;
|
|
24
|
+
this.reason = reason;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.CloseEvent = CloseEvent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ws";
|