@voicenter-team/events-sdk 0.0.18 → 0.0.20

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.
@@ -191,6 +191,7 @@ export declare enum EventsEnum {
191
191
  ALL_USERS_STATUS = "AllUsersStatus",
192
192
  CONNECT = "connect",
193
193
  DISCONNECT = "disconnect",
194
+ CONNECT_ERROR_EVENT = "connect_error",
194
195
  EXTENSION_EVENT = "ExtensionEvent",
195
196
  KEEP_ALIVE = "keepalive",
196
197
  KEEP_ALIVE_RESPONSE = "keepaliveResponse",
@@ -208,31 +209,33 @@ export declare enum EventsEnum {
208
209
  export declare type EventSpecificCallback<T extends EventTypeNames> = (data: WrappedSocketEvent<T>) => void
209
210
 
210
211
  declare class EventsSdkClass {
211
- constructor(options: EventsSdkOptions);
212
212
  private argumentOptions;
213
213
  readonly options: EventsSdkOptions;
214
214
  servers: Server[];
215
+ URLList: string[];
215
216
  server: Server;
217
+ URL: string | undefined;
216
218
  socket: SocketTyped | undefined;
219
+ private mainServer;
220
+ private alreadyAttemptedOtherServers;
217
221
  authClass: AuthClass;
218
222
  socketIoClass: SocketIoClass;
219
223
  loggerClass: LoggerClass;
220
224
  reconnectOptions: ReconnectOptions;
221
- retryConnection: DebouncedFuncLeading<(server?: ServerParameter, skipLogin?: boolean) => void>;
225
+ retryConnection: DebouncedFuncLeading<(serverParameter: ServerParameter) => void>;
222
226
  private listeners;
223
227
  private allListeners;
228
+ constructor(options: EventsSdkOptions);
224
229
  on<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
225
230
  on(event: '*', callback: (data: GenericEventWrapper) => void): void;
226
231
  off<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
227
232
  off(event: '*', callback: (data: GenericEventWrapper) => void): void;
228
233
  emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
229
- connect(server?: ServerParameter, skipLogin?: boolean): void;
234
+ connect(serverParameter: ServerParameter): void;
230
235
  disconnect(): void;
231
236
  clearKeepAliveInterval(): void;
232
- private findCurrentServer;
233
- private findNextAvailableServer;
234
- private findMaxPriorityServer;
235
- private findMinPriorityServer;
237
+ private findMainServer;
238
+ private findNextServer;
236
239
  getServerWithHighestPriority(servers: Server[]): Server;
237
240
  init(): Promise<boolean>;
238
241
  private getServers;
@@ -241,7 +244,7 @@ export default EventsSdkClass;
241
244
 
242
245
  export declare interface EventsSdkOptions {
243
246
  isNewStack?: boolean;
244
- servers: Server[];
247
+ servers?: Server[];
245
248
  loginUrl: string;
246
249
  getSettingsUrl?: string;
247
250
  fallbackServer: Server;
@@ -511,6 +514,7 @@ declare enum LoginType {
511
514
 
512
515
  export declare interface OnlineStatusEvent {
513
516
  isSocketConnected: boolean
517
+ attemptToConnect?: string
514
518
  }
515
519
 
516
520
  export declare interface OpenSIPSEventMap {
@@ -598,9 +602,8 @@ export declare interface Server {
598
602
  }
599
603
 
600
604
  export declare enum ServerParameter {
601
- DEFAULT = "default",
602
- NEXT = "next",
603
- PREVIOUS = "previous"
605
+ MAIN = "main",
606
+ NEXT = "next"
604
607
  }
605
608
 
606
609
  export declare enum ServerTypesEnum {