@ohos-ports/genesys-cloud-streaming-client 20.1.0-beta.1
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/README.md +47 -0
- package/dist/cjs/alerting-leader.d.ts +29 -0
- package/dist/cjs/alerting-leader.js +163 -0
- package/dist/cjs/client.d.ts +84 -0
- package/dist/cjs/client.js +680 -0
- package/dist/cjs/connection-manager.d.ts +18 -0
- package/dist/cjs/connection-manager.js +120 -0
- package/dist/cjs/connection-transfer.d.ts +7 -0
- package/dist/cjs/connection-transfer.js +20 -0
- package/dist/cjs/http-client.d.ts +18 -0
- package/dist/cjs/http-client.js +230 -0
- package/dist/cjs/index.d.ts +10 -0
- package/dist/cjs/index.js +31 -0
- package/dist/cjs/messenger.d.ts +37 -0
- package/dist/cjs/messenger.js +54 -0
- package/dist/cjs/notifications.d.ts +94 -0
- package/dist/cjs/notifications.js +495 -0
- package/dist/cjs/ping.d.ts +21 -0
- package/dist/cjs/ping.js +60 -0
- package/dist/cjs/polyfills.d.ts +0 -0
- package/dist/cjs/polyfills.js +6 -0
- package/dist/cjs/server-monitor.d.ts +16 -0
- package/dist/cjs/server-monitor.js +44 -0
- package/dist/cjs/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/cjs/stanza-definitions/webrtc-signaling.js +113 -0
- package/dist/cjs/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/cjs/stanza-definitions/xep0051.js +28 -0
- package/dist/cjs/stats-formatter.d.ts +6 -0
- package/dist/cjs/stats-formatter.js +63 -0
- package/dist/cjs/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/cjs/types/genesys-cloud-media-session.js +353 -0
- package/dist/cjs/types/interfaces.d.ts +310 -0
- package/dist/cjs/types/interfaces.js +22 -0
- package/dist/cjs/types/libs.d.ts +32 -0
- package/dist/cjs/types/libs.js +1 -0
- package/dist/cjs/types/media-session.d.ts +76 -0
- package/dist/cjs/types/media-session.js +2 -0
- package/dist/cjs/types/named-agent.d.ts +13 -0
- package/dist/cjs/types/named-agent.js +2 -0
- package/dist/cjs/types/offline-error.d.ts +2 -0
- package/dist/cjs/types/offline-error.js +5 -0
- package/dist/cjs/types/sasl-error.d.ts +8 -0
- package/dist/cjs/types/sasl-error.js +12 -0
- package/dist/cjs/types/stanza-media-session.d.ts +56 -0
- package/dist/cjs/types/stanza-media-session.js +255 -0
- package/dist/cjs/types/streaming-client-extension.d.ts +14 -0
- package/dist/cjs/types/streaming-client-extension.js +2 -0
- package/dist/cjs/types/timeout-error.d.ts +3 -0
- package/dist/cjs/types/timeout-error.js +9 -0
- package/dist/cjs/types/user-cancelled-error.d.ts +2 -0
- package/dist/cjs/types/user-cancelled-error.js +5 -0
- package/dist/cjs/utils.d.ts +34 -0
- package/dist/cjs/utils.js +202 -0
- package/dist/cjs/webrtc.d.ts +126 -0
- package/dist/cjs/webrtc.js +891 -0
- package/dist/deploy-info.json +21 -0
- package/dist/es/alerting-leader.d.ts +29 -0
- package/dist/es/alerting-leader.js +177 -0
- package/dist/es/client.d.ts +84 -0
- package/dist/es/client.js +699 -0
- package/dist/es/connection-manager.d.ts +18 -0
- package/dist/es/connection-manager.js +124 -0
- package/dist/es/connection-transfer.d.ts +7 -0
- package/dist/es/connection-transfer.js +16 -0
- package/dist/es/http-client.d.ts +18 -0
- package/dist/es/http-client.js +194 -0
- package/dist/es/index.bundle.js +39629 -0
- package/dist/es/index.d.ts +10 -0
- package/dist/es/index.js +10 -0
- package/dist/es/messenger.d.ts +37 -0
- package/dist/es/messenger.js +62 -0
- package/dist/es/notifications.d.ts +94 -0
- package/dist/es/notifications.js +507 -0
- package/dist/es/ping.d.ts +21 -0
- package/dist/es/ping.js +68 -0
- package/dist/es/polyfills.d.ts +0 -0
- package/dist/es/polyfills.js +6 -0
- package/dist/es/server-monitor.d.ts +16 -0
- package/dist/es/server-monitor.js +41 -0
- package/dist/es/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/es/stanza-definitions/webrtc-signaling.js +110 -0
- package/dist/es/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/es/stanza-definitions/xep0051.js +25 -0
- package/dist/es/stats-formatter.d.ts +6 -0
- package/dist/es/stats-formatter.js +54 -0
- package/dist/es/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/es/types/genesys-cloud-media-session.js +379 -0
- package/dist/es/types/interfaces.d.ts +310 -0
- package/dist/es/types/interfaces.js +19 -0
- package/dist/es/types/libs.d.ts +32 -0
- package/dist/es/types/libs.js +1 -0
- package/dist/es/types/media-session.d.ts +76 -0
- package/dist/es/types/media-session.js +1 -0
- package/dist/es/types/named-agent.d.ts +13 -0
- package/dist/es/types/named-agent.js +1 -0
- package/dist/es/types/offline-error.d.ts +2 -0
- package/dist/es/types/offline-error.js +2 -0
- package/dist/es/types/sasl-error.d.ts +8 -0
- package/dist/es/types/sasl-error.js +9 -0
- package/dist/es/types/stanza-media-session.d.ts +56 -0
- package/dist/es/types/stanza-media-session.js +264 -0
- package/dist/es/types/streaming-client-extension.d.ts +14 -0
- package/dist/es/types/streaming-client-extension.js +1 -0
- package/dist/es/types/timeout-error.d.ts +3 -0
- package/dist/es/types/timeout-error.js +5 -0
- package/dist/es/types/user-cancelled-error.d.ts +2 -0
- package/dist/es/types/user-cancelled-error.js +2 -0
- package/dist/es/utils.d.ts +34 -0
- package/dist/es/utils.js +192 -0
- package/dist/es/webrtc.d.ts +126 -0
- package/dist/es/webrtc.js +917 -0
- package/dist/manifest.json +19 -0
- package/dist/npm/CHANGELOG.md +637 -0
- package/dist/npm/README.md +47 -0
- package/dist/npm/alerting-leader.d.ts +29 -0
- package/dist/npm/alerting-leader.js +163 -0
- package/dist/npm/client.d.ts +84 -0
- package/dist/npm/client.js +680 -0
- package/dist/npm/connection-manager.d.ts +18 -0
- package/dist/npm/connection-manager.js +120 -0
- package/dist/npm/connection-transfer.d.ts +7 -0
- package/dist/npm/connection-transfer.js +20 -0
- package/dist/npm/http-client.d.ts +18 -0
- package/dist/npm/http-client.js +230 -0
- package/dist/npm/index.d.ts +10 -0
- package/dist/npm/index.js +31 -0
- package/dist/npm/messenger.d.ts +37 -0
- package/dist/npm/messenger.js +54 -0
- package/dist/npm/module.js +10 -0
- package/dist/npm/notifications.d.ts +94 -0
- package/dist/npm/notifications.js +495 -0
- package/dist/npm/ping.d.ts +21 -0
- package/dist/npm/ping.js +60 -0
- package/dist/npm/polyfills.d.ts +0 -0
- package/dist/npm/polyfills.js +6 -0
- package/dist/npm/server-monitor.d.ts +16 -0
- package/dist/npm/server-monitor.js +44 -0
- package/dist/npm/stanza-definitions/webrtc-signaling.d.ts +29 -0
- package/dist/npm/stanza-definitions/webrtc-signaling.js +113 -0
- package/dist/npm/stanza-definitions/xep0051.d.ts +19 -0
- package/dist/npm/stanza-definitions/xep0051.js +28 -0
- package/dist/npm/stats-formatter.d.ts +6 -0
- package/dist/npm/stats-formatter.js +63 -0
- package/dist/npm/types/genesys-cloud-media-session.d.ts +64 -0
- package/dist/npm/types/genesys-cloud-media-session.js +353 -0
- package/dist/npm/types/interfaces.d.ts +310 -0
- package/dist/npm/types/interfaces.js +22 -0
- package/dist/npm/types/libs.d.ts +32 -0
- package/dist/npm/types/libs.js +1 -0
- package/dist/npm/types/media-session.d.ts +76 -0
- package/dist/npm/types/media-session.js +2 -0
- package/dist/npm/types/named-agent.d.ts +13 -0
- package/dist/npm/types/named-agent.js +2 -0
- package/dist/npm/types/offline-error.d.ts +2 -0
- package/dist/npm/types/offline-error.js +5 -0
- package/dist/npm/types/sasl-error.d.ts +8 -0
- package/dist/npm/types/sasl-error.js +12 -0
- package/dist/npm/types/stanza-media-session.d.ts +56 -0
- package/dist/npm/types/stanza-media-session.js +255 -0
- package/dist/npm/types/streaming-client-extension.d.ts +14 -0
- package/dist/npm/types/streaming-client-extension.js +2 -0
- package/dist/npm/types/timeout-error.d.ts +3 -0
- package/dist/npm/types/timeout-error.js +9 -0
- package/dist/npm/types/user-cancelled-error.d.ts +2 -0
- package/dist/npm/types/user-cancelled-error.js +5 -0
- package/dist/npm/utils.d.ts +34 -0
- package/dist/npm/utils.js +207 -0
- package/dist/npm/webrtc.d.ts +126 -0
- package/dist/npm/webrtc.js +893 -0
- package/dist/streaming-client.browser.js +2 -0
- package/dist/streaming-client.browser.js.LICENSE.txt +12 -0
- package/dist/v20/streaming-client.browser.js +2 -0
- package/dist/v20/streaming-client.browser.js.LICENSE.txt +12 -0
- package/dist/v20.1.0/streaming-client.browser.js +2 -0
- package/dist/v20.1.0/streaming-client.browser.js.LICENSE.txt +12 -0
- package/package.json +132 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { ILogger, LogFormatterFn, LogLevel } from 'genesys-cloud-client-logger';
|
|
2
|
+
import { AxiosError, ResponseType } from 'axios';
|
|
3
|
+
import { NamedAgent } from './named-agent';
|
|
4
|
+
import { JingleReasonCondition } from 'stanza/Constants';
|
|
5
|
+
export { ILogger, LogLevel };
|
|
6
|
+
export interface IClientOptions {
|
|
7
|
+
host: string;
|
|
8
|
+
apiHost?: string;
|
|
9
|
+
authToken?: string;
|
|
10
|
+
jwt?: string;
|
|
11
|
+
jid?: string;
|
|
12
|
+
userId?: string;
|
|
13
|
+
jidResource?: string;
|
|
14
|
+
reconnectOnNoLongerSubscribed?: boolean;
|
|
15
|
+
optOutOfWebrtcStatsTelemetry?: boolean;
|
|
16
|
+
allowIPv6?: boolean;
|
|
17
|
+
logger?: ILogger;
|
|
18
|
+
logLevel?: LogLevel;
|
|
19
|
+
logFormatters?: LogFormatterFn[];
|
|
20
|
+
signalIceConnected?: boolean;
|
|
21
|
+
useServerSidePings?: boolean;
|
|
22
|
+
appName?: string;
|
|
23
|
+
appVersion?: string;
|
|
24
|
+
appId?: string;
|
|
25
|
+
customHeaders?: ICustomHeader;
|
|
26
|
+
/** When true, creates a unique log uploader instance rather than sharing a singleton per URL. */
|
|
27
|
+
useUniqueLogUploader?: boolean;
|
|
28
|
+
/** Allow bulk topic resubscribe to succeed or fail per-topic rather than all or nothing */
|
|
29
|
+
enablePartialBulkResubscribe?: boolean;
|
|
30
|
+
/** Genesys internal use only - non-Genesys apps that pass in `alertableInteractionTypes` may experience unexpected behavior */
|
|
31
|
+
alertableInteractionTypes?: AlertableInteractionTypes[];
|
|
32
|
+
}
|
|
33
|
+
export interface ICustomHeader {
|
|
34
|
+
[header: string]: string;
|
|
35
|
+
}
|
|
36
|
+
export declare enum AlertableInteractionTypes {
|
|
37
|
+
voice = "voice"
|
|
38
|
+
}
|
|
39
|
+
/** The alerting status for an interaction type */
|
|
40
|
+
export interface IAlertingStatus {
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether this client should be alerting. This can be because this client is the alerting
|
|
43
|
+
* leader for this interaction type, alerting leader functionality is not configured by an admin,
|
|
44
|
+
* or because setup for alerting leader failed and we fallback to `alerting: true` so interactions
|
|
45
|
+
* don't go unnoticed.
|
|
46
|
+
*/
|
|
47
|
+
alerting: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Indicates if alerting leader functionality is configured by an admin. This will also be `false`
|
|
50
|
+
* if setup for alerting leader failed.
|
|
51
|
+
*/
|
|
52
|
+
configured: boolean;
|
|
53
|
+
/** A string representing the client type of the alerting leader, based on OAuth client ID. */
|
|
54
|
+
clientType?: string;
|
|
55
|
+
}
|
|
56
|
+
/** The alerting leader status for this client. Currently only `voice` interactions are supported. */
|
|
57
|
+
export interface ILeaderStatus {
|
|
58
|
+
voice?: IAlertingStatus;
|
|
59
|
+
}
|
|
60
|
+
export interface IClientConfig {
|
|
61
|
+
host: string;
|
|
62
|
+
apiHost: string;
|
|
63
|
+
authToken?: string;
|
|
64
|
+
jwt?: string;
|
|
65
|
+
userId?: string;
|
|
66
|
+
jid?: string;
|
|
67
|
+
jidResource?: string;
|
|
68
|
+
channelId: string;
|
|
69
|
+
appName?: string;
|
|
70
|
+
appVersion?: string;
|
|
71
|
+
appId?: string;
|
|
72
|
+
logLevel?: LogLevel;
|
|
73
|
+
customHeaders?: ICustomHeader;
|
|
74
|
+
}
|
|
75
|
+
export interface IHttpClientOptions {
|
|
76
|
+
customHeaders?: ICustomHeader;
|
|
77
|
+
}
|
|
78
|
+
export interface ExtendedRTCIceServer extends RTCIceServer {
|
|
79
|
+
type: string;
|
|
80
|
+
}
|
|
81
|
+
export declare type RequestApiOptions = {
|
|
82
|
+
method: 'get' | 'post' | 'patch' | 'put' | 'delete';
|
|
83
|
+
host: string;
|
|
84
|
+
data?: any;
|
|
85
|
+
version?: string;
|
|
86
|
+
responseType?: ResponseType;
|
|
87
|
+
contentType?: string;
|
|
88
|
+
authToken?: string;
|
|
89
|
+
logger?: any;
|
|
90
|
+
noAuthHeader?: boolean;
|
|
91
|
+
requestTimeout?: number;
|
|
92
|
+
customHeaders?: ICustomHeader;
|
|
93
|
+
maxAttempts?: number;
|
|
94
|
+
signal?: AbortSignal;
|
|
95
|
+
};
|
|
96
|
+
export interface IAxiosResponseError extends AxiosError {
|
|
97
|
+
text: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ISuperagentNetworkError extends Error {
|
|
100
|
+
status: number | undefined;
|
|
101
|
+
method: string;
|
|
102
|
+
url: string;
|
|
103
|
+
crossDomain: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface ISuperagentResponseError {
|
|
106
|
+
original?: any;
|
|
107
|
+
status: number;
|
|
108
|
+
response: {
|
|
109
|
+
body: any;
|
|
110
|
+
error: ISuperagentNetworkError;
|
|
111
|
+
header: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
headers: {
|
|
115
|
+
[key: string]: string;
|
|
116
|
+
};
|
|
117
|
+
status: number;
|
|
118
|
+
statusCode: number;
|
|
119
|
+
statusText: string;
|
|
120
|
+
text: string;
|
|
121
|
+
req: {
|
|
122
|
+
method: string;
|
|
123
|
+
_data?: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface INetworkError extends IError {
|
|
128
|
+
status: number;
|
|
129
|
+
method: string;
|
|
130
|
+
url: string;
|
|
131
|
+
crossDomain: boolean;
|
|
132
|
+
}
|
|
133
|
+
export interface IResponseError extends IError {
|
|
134
|
+
status: number;
|
|
135
|
+
correlationId: string;
|
|
136
|
+
responseBody: string;
|
|
137
|
+
method: string;
|
|
138
|
+
requestBody: string;
|
|
139
|
+
url: string;
|
|
140
|
+
}
|
|
141
|
+
export declare enum StreamingClientErrorTypes {
|
|
142
|
+
generic = "generic",
|
|
143
|
+
invalid_token = "invalid_token",
|
|
144
|
+
userCancelled = "user_cancelled"
|
|
145
|
+
}
|
|
146
|
+
export interface IError {
|
|
147
|
+
message: string;
|
|
148
|
+
name: string;
|
|
149
|
+
stack?: string;
|
|
150
|
+
}
|
|
151
|
+
export declare type SessionTypesAsStrings = 'softphone' | 'screenShare' | 'screenRecording' | 'liveScreenMonitoring' | 'collaborateVideo' | 'unknown';
|
|
152
|
+
export declare enum SessionTypes {
|
|
153
|
+
softphone = "softphone",
|
|
154
|
+
collaborateVideo = "collaborateVideo",
|
|
155
|
+
acdScreenShare = "screenShare",
|
|
156
|
+
screenRecording = "screenRecording",
|
|
157
|
+
liveScreenMonitoring = "liveScreenMonitoring",
|
|
158
|
+
unknown = "unknown"
|
|
159
|
+
}
|
|
160
|
+
export interface ISessionInfo extends IPendingSession {
|
|
161
|
+
}
|
|
162
|
+
export interface IPendingSession {
|
|
163
|
+
sessionId: string;
|
|
164
|
+
id: string;
|
|
165
|
+
autoAnswer: boolean;
|
|
166
|
+
toJid: string;
|
|
167
|
+
fromJid: string;
|
|
168
|
+
conversationId: string;
|
|
169
|
+
originalRoomJid?: string;
|
|
170
|
+
sdpOverXmpp?: boolean;
|
|
171
|
+
privAnswerMode?: 'Auto';
|
|
172
|
+
fromUserId?: string;
|
|
173
|
+
roomJid?: string;
|
|
174
|
+
accepted?: boolean;
|
|
175
|
+
meetingId?: string;
|
|
176
|
+
sessionType: SessionTypes | SessionTypesAsStrings;
|
|
177
|
+
}
|
|
178
|
+
export interface StreamingClientExtension {
|
|
179
|
+
handleIq?: Function;
|
|
180
|
+
handleMessage?: Function;
|
|
181
|
+
handleStanzaInstanceChange: (stanzaInstance: NamedAgent) => void;
|
|
182
|
+
expose: any;
|
|
183
|
+
}
|
|
184
|
+
export interface StreamingClientConnectOptions {
|
|
185
|
+
/**
|
|
186
|
+
* @deprecated since version 15.1.1. Please use maxConnectionAttempts instead
|
|
187
|
+
*/
|
|
188
|
+
keepTryingOnFailure?: boolean;
|
|
189
|
+
maxConnectionAttempts?: number;
|
|
190
|
+
maxDelayBetweenConnectionAttempts?: number;
|
|
191
|
+
}
|
|
192
|
+
export interface StreamingSubscriptionErrorDetails {
|
|
193
|
+
missingPermissions?: string[];
|
|
194
|
+
}
|
|
195
|
+
export declare type GenesysWebrtcBaseParams = {
|
|
196
|
+
sessionId: string;
|
|
197
|
+
};
|
|
198
|
+
export declare type GenesysWebrtcSdpParams = GenesysWebrtcBaseParams & {
|
|
199
|
+
sdp: string;
|
|
200
|
+
};
|
|
201
|
+
export declare type GenesysWebrtcOfferParams = GenesysWebrtcSdpParams & {
|
|
202
|
+
conversationId: string;
|
|
203
|
+
reinvite?: boolean;
|
|
204
|
+
};
|
|
205
|
+
export declare type GenesysInfoActiveParams = GenesysWebrtcBaseParams & {
|
|
206
|
+
status: 'active';
|
|
207
|
+
};
|
|
208
|
+
export declare type GenesysSessionTerminateParams = GenesysWebrtcBaseParams & {
|
|
209
|
+
reason?: JingleReasonCondition;
|
|
210
|
+
};
|
|
211
|
+
export declare type GenesysWebrtcMuteParams = GenesysWebrtcBaseParams & {
|
|
212
|
+
type: 'audio' | 'video';
|
|
213
|
+
};
|
|
214
|
+
export declare type TypedJsonRpcMessage<Method extends string, Params> = {
|
|
215
|
+
jsonrpc: string;
|
|
216
|
+
method: Method;
|
|
217
|
+
id?: string;
|
|
218
|
+
params?: Params;
|
|
219
|
+
};
|
|
220
|
+
export declare type JsonRpcMessage = TypedJsonRpcMessage<string, any>;
|
|
221
|
+
export declare type GenesysWebrtcOffer = TypedJsonRpcMessage<'offer', GenesysWebrtcOfferParams>;
|
|
222
|
+
export declare type GenesysWebrtcAnswer = TypedJsonRpcMessage<'answer', GenesysWebrtcSdpParams>;
|
|
223
|
+
export declare type GenesysWebrtcInfo = TypedJsonRpcMessage<'info', GenesysInfoActiveParams>;
|
|
224
|
+
export declare type GenesysWebrtcIceCandidate = TypedJsonRpcMessage<'iceCandidate', GenesysWebrtcSdpParams>;
|
|
225
|
+
export declare type GenesysWebrtcTerminate = TypedJsonRpcMessage<'terminate', GenesysSessionTerminateParams>;
|
|
226
|
+
export declare type GenesysWebrtcMute = TypedJsonRpcMessage<'mute', GenesysWebrtcMuteParams>;
|
|
227
|
+
export declare type GenesysWebrtcUnmute = TypedJsonRpcMessage<'unmute', GenesysWebrtcMuteParams>;
|
|
228
|
+
export declare type GenesysWebrtcJsonRpcMessage = GenesysWebrtcOffer | GenesysWebrtcAnswer | GenesysWebrtcInfo | GenesysWebrtcIceCandidate | GenesysWebrtcTerminate | GenesysWebrtcMute | GenesysWebrtcUnmute;
|
|
229
|
+
export declare type HeadsetControlsRequestType = 'mediaHelper' | 'standard' | 'prioritized';
|
|
230
|
+
export declare type HeadsetControlsRejectionReason = 'activeCall' | 'mediaHelper' | 'priority';
|
|
231
|
+
export declare type HeadsetControlsRejectionParams = {
|
|
232
|
+
requestId: string;
|
|
233
|
+
reason: HeadsetControlsRejectionReason;
|
|
234
|
+
};
|
|
235
|
+
export declare type HeadsetControlsChangedParams = {
|
|
236
|
+
hasControls: boolean;
|
|
237
|
+
};
|
|
238
|
+
export declare type HeadsetControlsRequest = TypedJsonRpcMessage<'headsetControlsRequest', {
|
|
239
|
+
requestType: HeadsetControlsRequestType;
|
|
240
|
+
}>;
|
|
241
|
+
export declare type HeadsetControlsRejection = TypedJsonRpcMessage<'headsetControlsRejection', HeadsetControlsRejectionParams>;
|
|
242
|
+
export declare type HeadsetControlsChanged = TypedJsonRpcMessage<'headsetControlsChanged', HeadsetControlsChangedParams>;
|
|
243
|
+
export declare type GenesysMediaMessage = HeadsetControlsRequest | HeadsetControlsRejection | HeadsetControlsChanged;
|
|
244
|
+
export declare type FlatObject = {
|
|
245
|
+
[key: string]: string | number | boolean | null | Date;
|
|
246
|
+
};
|
|
247
|
+
export declare type GenericAction = {
|
|
248
|
+
_eventType: string;
|
|
249
|
+
};
|
|
250
|
+
export declare type InsightReport = {
|
|
251
|
+
appName: string;
|
|
252
|
+
appVersion: string;
|
|
253
|
+
originAppName?: string;
|
|
254
|
+
originAppVersion?: string;
|
|
255
|
+
actions: InsightAction<any>[];
|
|
256
|
+
};
|
|
257
|
+
export declare type InsightAction<T extends {
|
|
258
|
+
_eventType: string;
|
|
259
|
+
}> = {
|
|
260
|
+
actionName: 'WebrtcStats';
|
|
261
|
+
details: InsightActionDetails<T>;
|
|
262
|
+
};
|
|
263
|
+
export declare type InsightActionDetails<K extends {
|
|
264
|
+
_eventType: string;
|
|
265
|
+
}> = {
|
|
266
|
+
_eventType: K['_eventType'];
|
|
267
|
+
/**
|
|
268
|
+
* This should be ms since epoch, e.g. new Date().getTime()
|
|
269
|
+
*/
|
|
270
|
+
_eventTimestamp: number;
|
|
271
|
+
_appId?: string;
|
|
272
|
+
_appName?: string;
|
|
273
|
+
_appVersion?: string;
|
|
274
|
+
} & K;
|
|
275
|
+
export declare type OnlineStatusStat = InsightAction<{
|
|
276
|
+
_eventType: 'onlineStatus';
|
|
277
|
+
online: boolean;
|
|
278
|
+
}>;
|
|
279
|
+
export declare type FirstProposeStat = InsightAction<{
|
|
280
|
+
_eventType: 'firstPropose';
|
|
281
|
+
sdpViaXmppRequested: boolean;
|
|
282
|
+
sessionType: SessionTypesAsStrings;
|
|
283
|
+
originAppId?: string;
|
|
284
|
+
conversationId: string;
|
|
285
|
+
sessionId: string;
|
|
286
|
+
}>;
|
|
287
|
+
export declare type FirstAlertingConversationStat = InsightAction<{
|
|
288
|
+
_eventType: 'firstAlertingConversationUpdate';
|
|
289
|
+
conversationId: string;
|
|
290
|
+
participantId: string;
|
|
291
|
+
}>;
|
|
292
|
+
export declare type MediaStat = InsightAction<{
|
|
293
|
+
_eventType: 'mediaRequested' | 'mediaStarted' | 'mediaError';
|
|
294
|
+
requestId?: string;
|
|
295
|
+
message?: string;
|
|
296
|
+
audioRequested: boolean;
|
|
297
|
+
videoRequested: boolean;
|
|
298
|
+
displayRequested: boolean;
|
|
299
|
+
conversationId?: string;
|
|
300
|
+
sessionType?: SessionTypesAsStrings;
|
|
301
|
+
sessionId?: string;
|
|
302
|
+
elapsedMsFromInitialRequest?: number;
|
|
303
|
+
}>;
|
|
304
|
+
export declare type NRProxyStat = FirstAlertingConversationStat | MediaStat;
|
|
305
|
+
export declare type SCConnectionData = {
|
|
306
|
+
currentDelayMs: number;
|
|
307
|
+
delayMsAfterNextReduction?: number;
|
|
308
|
+
nextDelayReductionTime?: number;
|
|
309
|
+
timeOfTotalReset?: number;
|
|
310
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionTypes = exports.StreamingClientErrorTypes = exports.AlertableInteractionTypes = void 0;
|
|
4
|
+
var AlertableInteractionTypes;
|
|
5
|
+
(function (AlertableInteractionTypes) {
|
|
6
|
+
AlertableInteractionTypes["voice"] = "voice";
|
|
7
|
+
})(AlertableInteractionTypes = exports.AlertableInteractionTypes || (exports.AlertableInteractionTypes = {}));
|
|
8
|
+
var StreamingClientErrorTypes;
|
|
9
|
+
(function (StreamingClientErrorTypes) {
|
|
10
|
+
StreamingClientErrorTypes["generic"] = "generic";
|
|
11
|
+
StreamingClientErrorTypes["invalid_token"] = "invalid_token";
|
|
12
|
+
StreamingClientErrorTypes["userCancelled"] = "user_cancelled";
|
|
13
|
+
})(StreamingClientErrorTypes = exports.StreamingClientErrorTypes || (exports.StreamingClientErrorTypes = {}));
|
|
14
|
+
var SessionTypes;
|
|
15
|
+
(function (SessionTypes) {
|
|
16
|
+
SessionTypes["softphone"] = "softphone";
|
|
17
|
+
SessionTypes["collaborateVideo"] = "collaborateVideo";
|
|
18
|
+
SessionTypes["acdScreenShare"] = "screenShare";
|
|
19
|
+
SessionTypes["screenRecording"] = "screenRecording";
|
|
20
|
+
SessionTypes["liveScreenMonitoring"] = "liveScreenMonitoring";
|
|
21
|
+
SessionTypes["unknown"] = "unknown";
|
|
22
|
+
})(SessionTypes = exports.SessionTypes || (exports.SessionTypes = {}));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module 'wildemitter' {
|
|
2
|
+
export default class WildEmitter {
|
|
3
|
+
constructor();
|
|
4
|
+
on(event: string, groupNameOrCallback: any, callback?: any): void;
|
|
5
|
+
once(event: string, groupNameOrCallback: any, callback?: any): void;
|
|
6
|
+
off(event: string, groupNameOrCallback?: any, callback?: any): void;
|
|
7
|
+
emit(event: string, ...args: any[]): void;
|
|
8
|
+
emit(event: string, ...args: any[]): void;
|
|
9
|
+
releaseGroup(groupName?: string): void;
|
|
10
|
+
getWildcardCallbacks(): (...args: any[]) => void;
|
|
11
|
+
static mixin(arg: any): void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare module 'backoff-web' {
|
|
15
|
+
export interface Backoff {
|
|
16
|
+
failAfter(attempts: number): void;
|
|
17
|
+
on(evt: 'backoff' | 'ready', callback: (count: number, delay: number) => void): void;
|
|
18
|
+
on(evt: 'fail', callback: (...args: any[]) => void): void;
|
|
19
|
+
backoff(): void;
|
|
20
|
+
reset(): void;
|
|
21
|
+
backoffNumber_: number;
|
|
22
|
+
}
|
|
23
|
+
const backoffInitializer: {
|
|
24
|
+
exponential(options: {
|
|
25
|
+
randomisationFactor: number;
|
|
26
|
+
initialDelay: number;
|
|
27
|
+
maxDelay: number;
|
|
28
|
+
factor: number;
|
|
29
|
+
}): Backoff;
|
|
30
|
+
};
|
|
31
|
+
export default backoffInitializer;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
import Logger from 'genesys-cloud-client-logger';
|
|
4
|
+
import { JingleReasonCondition } from 'stanza/Constants';
|
|
5
|
+
import { SessionOpts } from 'stanza/jingle/Session';
|
|
6
|
+
import StrictEventEmitter from 'stanza/lib/StrictEventEmitter';
|
|
7
|
+
import { JingleInfo, JingleReason } from 'stanza/protocol';
|
|
8
|
+
import { StatsEvent } from 'webrtc-stats-gatherer';
|
|
9
|
+
import { JsonRpcMessage, SessionTypes, SessionTypesAsStrings } from './interfaces';
|
|
10
|
+
export declare type SessionState = 'pending' | 'active' | 'ended';
|
|
11
|
+
export declare type ConnectionState = 'starting' | 'new' | 'connecting' | 'connected' | 'interrupted' | 'disconnected' | 'failed' | 'closed';
|
|
12
|
+
export interface SessionEvents {
|
|
13
|
+
iceConnectionType: ({
|
|
14
|
+
localCandidateType: string;
|
|
15
|
+
relayed: boolean;
|
|
16
|
+
remoteCandidateType: string;
|
|
17
|
+
});
|
|
18
|
+
peerTrackAdded: (track: MediaStreamTrack, stream?: MediaStream) => void;
|
|
19
|
+
peerTrackRemoved: (track: MediaStreamTrack, stream?: MediaStream) => void;
|
|
20
|
+
mute: JingleInfo;
|
|
21
|
+
unmute: JingleInfo;
|
|
22
|
+
sessionState: SessionState;
|
|
23
|
+
connectionState: ConnectionState;
|
|
24
|
+
terminated: JingleReason;
|
|
25
|
+
stats: StatsEvent;
|
|
26
|
+
endOfCandidates: void;
|
|
27
|
+
dataChannelMessage: JsonRpcMessage;
|
|
28
|
+
}
|
|
29
|
+
export interface IMediaSessionParams {
|
|
30
|
+
logger: Logger;
|
|
31
|
+
id: string;
|
|
32
|
+
fromJid: string;
|
|
33
|
+
peerID: string;
|
|
34
|
+
sessionType: SessionTypes | SessionTypesAsStrings;
|
|
35
|
+
allowIPv6?: boolean;
|
|
36
|
+
allowTCP?: boolean;
|
|
37
|
+
ignoreHostCandidatesFromRemote?: boolean;
|
|
38
|
+
optOutOfWebrtcStatsTelemetry?: boolean;
|
|
39
|
+
conversationId?: string;
|
|
40
|
+
fromUserId?: string;
|
|
41
|
+
originalRoomJid?: string;
|
|
42
|
+
meetingId?: string;
|
|
43
|
+
privAnswerMode?: 'Auto';
|
|
44
|
+
}
|
|
45
|
+
export interface IStanzaMediaSessionParams extends IMediaSessionParams {
|
|
46
|
+
options: SessionOpts;
|
|
47
|
+
}
|
|
48
|
+
export interface IGenesysCloudMediaSessionParams extends IMediaSessionParams {
|
|
49
|
+
iceServers: RTCIceServer[];
|
|
50
|
+
iceTransportPolicy: RTCIceTransportPolicy;
|
|
51
|
+
reinvite: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface IMediaSession extends StrictEventEmitter<EventEmitter, SessionEvents> {
|
|
54
|
+
conversationId: string;
|
|
55
|
+
id: string;
|
|
56
|
+
sessionType: SessionTypes;
|
|
57
|
+
fromUserId?: string;
|
|
58
|
+
peerID: string;
|
|
59
|
+
peerConnection: RTCPeerConnection;
|
|
60
|
+
pc: RTCPeerConnection;
|
|
61
|
+
dataChannel?: RTCDataChannel;
|
|
62
|
+
connectionState: ConnectionState | string;
|
|
63
|
+
state: SessionState | string;
|
|
64
|
+
reinvite: boolean;
|
|
65
|
+
meetingId?: string;
|
|
66
|
+
privAnswerMode?: 'Auto';
|
|
67
|
+
setupStatsGatherer(): void;
|
|
68
|
+
accept(opts?: RTCAnswerOptions): Promise<void>;
|
|
69
|
+
end(reason: JingleReasonCondition, silent?: boolean): Promise<void>;
|
|
70
|
+
addTrack(track: MediaStreamTrack, stream?: MediaStream): Promise<void>;
|
|
71
|
+
removeTrack(sender: RTCRtpSender): Promise<void>;
|
|
72
|
+
mute(userId: string, name?: string): Promise<void>;
|
|
73
|
+
unmute(userId: string, name?: string): Promise<void>;
|
|
74
|
+
hold(): Promise<void>;
|
|
75
|
+
resume(): Promise<void>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Agent } from 'stanza';
|
|
2
|
+
import { Ping } from '../ping';
|
|
3
|
+
import { ServerMonitor } from '../server-monitor';
|
|
4
|
+
import { ConnectionTransfer } from '../connection-transfer';
|
|
5
|
+
export interface NamedAgent extends Omit<Agent, 'disconnect'> {
|
|
6
|
+
id: string;
|
|
7
|
+
channelId?: string;
|
|
8
|
+
originalEmitter?: Function;
|
|
9
|
+
pinger?: Ping;
|
|
10
|
+
serverMonitor?: ServerMonitor;
|
|
11
|
+
connectionTransfer?: ConnectionTransfer;
|
|
12
|
+
disconnect: () => Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SASLFailureCondition } from 'stanza/Constants';
|
|
2
|
+
export default class SaslError extends Error {
|
|
3
|
+
condition: SASLFailureCondition;
|
|
4
|
+
channelId: string;
|
|
5
|
+
stanzaInstanceId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
constructor(condition: SASLFailureCondition, channelId: string, stanzaInstanceId: string);
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class SaslError extends Error {
|
|
4
|
+
constructor(condition, channelId, stanzaInstanceId) {
|
|
5
|
+
super();
|
|
6
|
+
this.condition = condition;
|
|
7
|
+
this.channelId = channelId;
|
|
8
|
+
this.stanzaInstanceId = stanzaInstanceId;
|
|
9
|
+
this.name = 'SaslError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.default = SaslError;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MediaSession } from 'stanza/jingle';
|
|
2
|
+
import { JingleReasonCondition } from 'stanza/Constants';
|
|
3
|
+
import { ActionCallback } from 'stanza/jingle/Session';
|
|
4
|
+
import { JingleReason } from 'stanza/protocol';
|
|
5
|
+
import { IMediaSession, IStanzaMediaSessionParams } from './media-session';
|
|
6
|
+
import { SessionTypes } from './interfaces';
|
|
7
|
+
import { Jingle } from 'stanza/protocol/xep0166';
|
|
8
|
+
export declare class StanzaMediaSession extends MediaSession implements IMediaSession {
|
|
9
|
+
private statsGatherer?;
|
|
10
|
+
private iceCandidatesDiscovered;
|
|
11
|
+
private iceCandidatesReceivedFromPeer;
|
|
12
|
+
private interruptionStart?;
|
|
13
|
+
private logger;
|
|
14
|
+
off: any;
|
|
15
|
+
removeAllListeners: any;
|
|
16
|
+
on: any;
|
|
17
|
+
once: any;
|
|
18
|
+
setMaxListeners: any;
|
|
19
|
+
getMaxListeners: any;
|
|
20
|
+
listeners: any;
|
|
21
|
+
rawListeners: any;
|
|
22
|
+
listenerCount: any;
|
|
23
|
+
prependListener: any;
|
|
24
|
+
prependOnceListener: any;
|
|
25
|
+
eventNames: any;
|
|
26
|
+
addListener: any;
|
|
27
|
+
removeListener: any;
|
|
28
|
+
emit: any;
|
|
29
|
+
conversationId: string;
|
|
30
|
+
peerConnection: RTCPeerConnection;
|
|
31
|
+
id: string;
|
|
32
|
+
fromUserId: string;
|
|
33
|
+
meetingId?: string;
|
|
34
|
+
originalRoomJid?: string;
|
|
35
|
+
sessionType: SessionTypes;
|
|
36
|
+
ignoreHostCandidatesFromRemote: boolean;
|
|
37
|
+
allowIPv6: boolean;
|
|
38
|
+
allowTCP: boolean;
|
|
39
|
+
dataChannel?: RTCDataChannel;
|
|
40
|
+
reinvite: boolean;
|
|
41
|
+
privAnswerMode?: 'Auto';
|
|
42
|
+
constructor(params: IStanzaMediaSessionParams);
|
|
43
|
+
private getLogDetails;
|
|
44
|
+
onTransportInfo(changes: Jingle, cb: ActionCallback): Promise<void>;
|
|
45
|
+
protected _log(level: string, message: string, ...data: any[]): void;
|
|
46
|
+
end(reason?: JingleReasonCondition | JingleReason, silent?: boolean): Promise<void>;
|
|
47
|
+
setupStatsGatherer(): void;
|
|
48
|
+
onIceStateChange(): void;
|
|
49
|
+
onConnectionStateChange(): void;
|
|
50
|
+
onIceCandidateError(ev: Event): void;
|
|
51
|
+
onIceCandidate(e: RTCPeerConnectionIceEvent): void;
|
|
52
|
+
onIceEndOfCandidates(): void;
|
|
53
|
+
addTrack(track: MediaStreamTrack, stream?: MediaStream): Promise<void>;
|
|
54
|
+
_setupDataChannel(): void;
|
|
55
|
+
_handleDataChannelMessage(event: MessageEvent): void;
|
|
56
|
+
}
|