mavenagi 1.2.10 → 1.2.11
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/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/KnowledgeDocumentRequest.d.ts +1 -1
- 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/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/KnowledgeDocumentRequest.d.ts +1 -1
- 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/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/KnowledgeDocumentRequest.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -1
- 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/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/KnowledgeDocumentRequest.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -1
- 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,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/core/index.d.ts
CHANGED
package/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";
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./ws"), exports);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as Events from "./events";
|
|
2
|
+
export type Event = Events.Event;
|
|
3
|
+
export type ErrorEvent = Events.ErrorEvent;
|
|
4
|
+
export type CloseEvent = Events.CloseEvent;
|
|
5
|
+
export declare namespace ReconnectingWebSocket {
|
|
6
|
+
interface Args {
|
|
7
|
+
url: string;
|
|
8
|
+
protocols?: string | string[];
|
|
9
|
+
options?: ReconnectingWebSocket.Options;
|
|
10
|
+
headers?: Record<string, unknown>;
|
|
11
|
+
queryParameters?: Record<string, string | string[] | object | object[] | null | undefined>;
|
|
12
|
+
}
|
|
13
|
+
type Options = {
|
|
14
|
+
WebSocket?: any;
|
|
15
|
+
maxReconnectionDelay?: number;
|
|
16
|
+
minReconnectionDelay?: number;
|
|
17
|
+
reconnectionDelayGrowFactor?: number;
|
|
18
|
+
minUptime?: number;
|
|
19
|
+
connectionTimeout?: number;
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
maxEnqueuedMessages?: number;
|
|
22
|
+
startClosed?: boolean;
|
|
23
|
+
debug?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type UrlProvider = string | (() => string) | (() => Promise<string>);
|
|
26
|
+
type Message = string | ArrayBuffer | Blob | ArrayBufferView;
|
|
27
|
+
type ListenersMap = {
|
|
28
|
+
error: Array<Events.WebSocketEventListenerMap["error"]>;
|
|
29
|
+
message: Array<Events.WebSocketEventListenerMap["message"]>;
|
|
30
|
+
open: Array<Events.WebSocketEventListenerMap["open"]>;
|
|
31
|
+
close: Array<Events.WebSocketEventListenerMap["close"]>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare class ReconnectingWebSocket {
|
|
35
|
+
private _ws?;
|
|
36
|
+
private _listeners;
|
|
37
|
+
private _retryCount;
|
|
38
|
+
private _uptimeTimeout;
|
|
39
|
+
private _connectTimeout;
|
|
40
|
+
private _shouldReconnect;
|
|
41
|
+
private _connectLock;
|
|
42
|
+
private _binaryType;
|
|
43
|
+
private _closeCalled;
|
|
44
|
+
private _messageQueue;
|
|
45
|
+
private readonly _url;
|
|
46
|
+
private readonly _protocols?;
|
|
47
|
+
private readonly _options;
|
|
48
|
+
private readonly _headers?;
|
|
49
|
+
private readonly _queryParameters?;
|
|
50
|
+
constructor({ url, protocols, options, headers, queryParameters }: ReconnectingWebSocket.Args);
|
|
51
|
+
static readonly CONNECTING = 0;
|
|
52
|
+
static readonly OPEN = 1;
|
|
53
|
+
static readonly CLOSING = 2;
|
|
54
|
+
static readonly CLOSED = 3;
|
|
55
|
+
readonly CONNECTING: typeof ReconnectingWebSocket.CONNECTING;
|
|
56
|
+
readonly OPEN: typeof ReconnectingWebSocket.OPEN;
|
|
57
|
+
readonly CLOSING: typeof ReconnectingWebSocket.CLOSING;
|
|
58
|
+
readonly CLOSED: typeof ReconnectingWebSocket.CLOSED;
|
|
59
|
+
get binaryType(): BinaryType;
|
|
60
|
+
set binaryType(value: BinaryType);
|
|
61
|
+
/**
|
|
62
|
+
* Returns the number or connection retries
|
|
63
|
+
*/
|
|
64
|
+
get retryCount(): number;
|
|
65
|
+
/**
|
|
66
|
+
* The number of bytes of data that have been queued using calls to send() but not yet
|
|
67
|
+
* transmitted to the network. This value resets to zero once all queued data has been sent.
|
|
68
|
+
* This value does not reset to zero when the connection is closed; if you keep calling send(),
|
|
69
|
+
* this will continue to climb. Read only
|
|
70
|
+
*/
|
|
71
|
+
get bufferedAmount(): number;
|
|
72
|
+
/**
|
|
73
|
+
* The extensions selected by the server. This is currently only the empty string or a list of
|
|
74
|
+
* extensions as negotiated by the connection
|
|
75
|
+
*/
|
|
76
|
+
get extensions(): string;
|
|
77
|
+
/**
|
|
78
|
+
* A string indicating the name of the sub-protocol the server selected;
|
|
79
|
+
* this will be one of the strings specified in the protocols parameter when creating the
|
|
80
|
+
* WebSocket object
|
|
81
|
+
*/
|
|
82
|
+
get protocol(): string;
|
|
83
|
+
/**
|
|
84
|
+
* The current state of the connection; this is one of the Ready state constants
|
|
85
|
+
*/
|
|
86
|
+
get readyState(): number;
|
|
87
|
+
/**
|
|
88
|
+
* The URL as resolved by the constructor
|
|
89
|
+
*/
|
|
90
|
+
get url(): string;
|
|
91
|
+
/**
|
|
92
|
+
* An event listener to be called when the WebSocket connection's readyState changes to CLOSED
|
|
93
|
+
*/
|
|
94
|
+
onclose: ((event: Events.CloseEvent) => void) | null;
|
|
95
|
+
/**
|
|
96
|
+
* An event listener to be called when an error occurs
|
|
97
|
+
*/
|
|
98
|
+
onerror: ((event: Events.ErrorEvent) => void) | null;
|
|
99
|
+
/**
|
|
100
|
+
* An event listener to be called when a message is received from the server
|
|
101
|
+
*/
|
|
102
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
103
|
+
/**
|
|
104
|
+
* An event listener to be called when the WebSocket connection's readyState changes to OPEN;
|
|
105
|
+
* this indicates that the connection is ready to send and receive data
|
|
106
|
+
*/
|
|
107
|
+
onopen: ((event: Event) => void) | null;
|
|
108
|
+
/**
|
|
109
|
+
* Closes the WebSocket connection or connection attempt, if any. If the connection is already
|
|
110
|
+
* CLOSED, this method does nothing
|
|
111
|
+
*/
|
|
112
|
+
close(code?: number, reason?: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Closes the WebSocket connection or connection attempt and connects again.
|
|
115
|
+
* Resets retry counter;
|
|
116
|
+
*/
|
|
117
|
+
reconnect(code?: number, reason?: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* Enqueue specified data to be transmitted to the server over the WebSocket connection
|
|
120
|
+
*/
|
|
121
|
+
send(data: ReconnectingWebSocket.Message): void;
|
|
122
|
+
/**
|
|
123
|
+
* Register an event handler of a specific event type
|
|
124
|
+
*/
|
|
125
|
+
addEventListener<T extends keyof Events.WebSocketEventListenerMap>(type: T, listener: Events.WebSocketEventListenerMap[T]): void;
|
|
126
|
+
dispatchEvent(event: Event): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Removes an event listener
|
|
129
|
+
*/
|
|
130
|
+
removeEventListener<T extends keyof Events.WebSocketEventListenerMap>(type: T, listener: Events.WebSocketEventListenerMap[T]): void;
|
|
131
|
+
private _debug;
|
|
132
|
+
private _getNextDelay;
|
|
133
|
+
private _wait;
|
|
134
|
+
private _getNextUrl;
|
|
135
|
+
private _connect;
|
|
136
|
+
private _handleTimeout;
|
|
137
|
+
private _disconnect;
|
|
138
|
+
private _acceptOpen;
|
|
139
|
+
private _callEventListener;
|
|
140
|
+
private _handleOpen;
|
|
141
|
+
private _handleMessage;
|
|
142
|
+
private _handleError;
|
|
143
|
+
private _handleClose;
|
|
144
|
+
private _removeListeners;
|
|
145
|
+
private _addListeners;
|
|
146
|
+
private _clearTimeouts;
|
|
147
|
+
}
|