@genesislcap/foundation-comms 14.184.0 → 14.186.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/dts/auth/auth.types.d.ts +1 -1
  2. package/dist/dts/auth/auth.types.d.ts.map +1 -1
  3. package/dist/dts/connect/connect.d.ts +14 -6
  4. package/dist/dts/connect/connect.d.ts.map +1 -1
  5. package/dist/dts/connect/connect.events.d.ts +28 -2
  6. package/dist/dts/connect/connect.events.d.ts.map +1 -1
  7. package/dist/dts/connect/connect.types.d.ts +5 -52
  8. package/dist/dts/connect/connect.types.d.ts.map +1 -1
  9. package/dist/dts/connect/http.connect.d.ts +4 -8
  10. package/dist/dts/connect/http.connect.d.ts.map +1 -1
  11. package/dist/dts/connect/http.connect.types.d.ts +62 -0
  12. package/dist/dts/connect/http.connect.types.d.ts.map +1 -0
  13. package/dist/dts/connect/index.d.ts +1 -0
  14. package/dist/dts/connect/index.d.ts.map +1 -1
  15. package/dist/dts/connect/message.d.ts +6 -2
  16. package/dist/dts/connect/message.d.ts.map +1 -1
  17. package/dist/dts/connect/socket.d.ts +3 -56
  18. package/dist/dts/connect/socket.d.ts.map +1 -1
  19. package/dist/dts/connect/socket.types.d.ts +57 -0
  20. package/dist/dts/connect/socket.types.d.ts.map +1 -0
  21. package/dist/dts/connect/updateState.d.ts +3 -0
  22. package/dist/dts/connect/updateState.d.ts.map +1 -0
  23. package/dist/dts/networkMonitor/service.d.ts.map +1 -1
  24. package/dist/dts/testing/mocks/auth/auth.d.ts +1 -1
  25. package/dist/dts/testing/mocks/auth/auth.d.ts.map +1 -1
  26. package/dist/dts/testing/mocks/connect/connect.d.ts +3 -1
  27. package/dist/dts/testing/mocks/connect/connect.d.ts.map +1 -1
  28. package/dist/dts/testing/mocks/connect/socket.d.ts +1 -1
  29. package/dist/dts/testing/mocks/connect/socket.d.ts.map +1 -1
  30. package/dist/dts/testing/mocks/datasource/datasource.d.ts +1 -1
  31. package/dist/dts/testing/mocks/datasource/datasource.d.ts.map +1 -1
  32. package/dist/esm/connect/connect.events.js +21 -2
  33. package/dist/esm/connect/connect.js +26 -28
  34. package/dist/esm/connect/connect.types.js +21 -5
  35. package/dist/esm/connect/http.connect.js +11 -23
  36. package/dist/esm/connect/http.connect.types.js +24 -0
  37. package/dist/esm/connect/index.js +1 -0
  38. package/dist/esm/connect/message.js +3 -2
  39. package/dist/esm/connect/socket.js +10 -5
  40. package/dist/esm/connect/socket.types.js +1 -0
  41. package/dist/esm/connect/updateState.js +26 -0
  42. package/dist/esm/networkMonitor/service.js +18 -8
  43. package/dist/esm/testing/mocks/connect/connect.js +3 -0
  44. package/dist/esm/testing/mocks/connect/socket.js +1 -1
  45. package/dist/foundation-comms.api.json +823 -384
  46. package/dist/foundation-comms.d.ts +63 -16
  47. package/docs/api/foundation-comms.connect.md +1 -0
  48. package/docs/api/foundation-comms.connect.streamstate.md +30 -0
  49. package/docs/api/foundation-comms.connectconfig.iswebsocketexpression.md +13 -0
  50. package/docs/api/foundation-comms.connectconfig.md +1 -0
  51. package/docs/api/foundation-comms.connectevents.addstreamlistener.md +2 -1
  52. package/docs/api/foundation-comms.connectevents.md +1 -1
  53. package/docs/api/foundation-comms.connecteventsemitter.md +1 -0
  54. package/docs/api/foundation-comms.connecteventsemitter.onstreamerrorevent.md +26 -0
  55. package/docs/api/foundation-comms.defaultconnect._constructor_.md +2 -2
  56. package/docs/api/foundation-comms.defaultconnect.md +1 -0
  57. package/docs/api/foundation-comms.defaultconnect.streamstate.md +26 -0
  58. package/docs/api/foundation-comms.defaultconnectevents.addstreamlistener.md +2 -1
  59. package/docs/api/foundation-comms.defaultconnectevents.md +2 -1
  60. package/docs/api/foundation-comms.defaultconnectevents.onstreamerrorevent.md +26 -0
  61. package/docs/api/foundation-comms.defaulthttpconnect._constructor_.md +2 -2
  62. package/docs/api/foundation-comms.defaulthttpconnect.md +1 -0
  63. package/docs/api/foundation-comms.defaulthttpconnect.streamstate.md +26 -0
  64. package/docs/api/foundation-comms.md +3 -4
  65. package/docs/api/foundation-comms.pingmessage.md +1 -1
  66. package/docs/api/foundation-comms.streamerrorevent.md +14 -0
  67. package/docs/api/foundation-comms.streamerroreventdetail.md +16 -0
  68. package/docs/api/foundation-comms.streamerroreventtype.md +12 -0
  69. package/docs/api-report.md +36 -38
  70. package/package.json +21 -13
  71. package/docs/api/foundation-comms.defaulthttpconnectconfig.md +0 -13
  72. package/docs/api/foundation-comms.httpconnectconfig.md +0 -20
  73. package/docs/api/foundation-comms.httpconnectconfig.polling.md +0 -13
  74. package/docs/api/foundation-comms.httppollingconfig.md +0 -22
  75. package/docs/api/foundation-comms.httppollingconfig.polling_frequency.md +0 -13
  76. package/docs/api/foundation-comms.httppollingconfig.polling_interval_map.md +0 -15
  77. package/docs/api/foundation-comms.httppollingconfig.polling_map.md +0 -15
  78. package/docs/api/foundation-comms.pollingconfiguration.amount_of_polls.md +0 -18
  79. package/docs/api/foundation-comms.pollingconfiguration.md +0 -22
  80. package/docs/api/foundation-comms.pollingconfiguration.queries.md +0 -13
  81. package/docs/api/foundation-comms.pollingconfiguration.temp_frequency.md +0 -13
@@ -257,8 +257,20 @@ export declare interface Connect {
257
257
  * @returns An observable that emits messages received from the server.
258
258
  */
259
259
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
260
+ /**
261
+ * Starts listening for updates on the specified resource.
262
+ * @public
263
+ * @param resourceName - The name of the resource to listen for updates on.
264
+ * @param onMessage - A callback function to handle received messages.
265
+ * @param onError - A callback function to handle errors.
266
+ * @param params - Additional parameters to pass to the server.
267
+ * @param initialState - State of the list to start with, defaults to empty array.
268
+ * @returns An observable that emits latest state of the list it subscribes to.
269
+ */
270
+ streamState(resourceName: string, onMessage: Function, onError: Function, params?: any, initialState?: any[]): Observable<any[]>;
260
271
  /**
261
272
  * Starts listening for updates on the specified resource without auto-teardown.
273
+ * @deprecated - Use `stream` instead. Will be removed in v15.
262
274
  * @alpha
263
275
  * @param resourceName - The name of the resource to listen for updates on.
264
276
  * @param onMessage - A callback function to handle received messages.
@@ -346,6 +358,10 @@ export declare interface ConnectConfig {
346
358
  * Options for automatic reconnection on connection loss.
347
359
  */
348
360
  reconnect: SocketReconnectOptions;
361
+ /**
362
+ * Check for web socket url pattern.
363
+ */
364
+ isWebSocketExpression: RegExp;
349
365
  }
350
366
 
351
367
  /**
@@ -364,8 +380,9 @@ export declare interface ConnectEvents {
364
380
  * Add a stream listener.
365
381
  * @param listener - A listener callback function.
366
382
  * @param complete - A complete listener callback function.
383
+ * @param error - A error listener callback function.
367
384
  */
368
- addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>): () => void;
385
+ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>, error: Listener<StreamErrorEvent>): () => void;
369
386
  /**
370
387
  * Add a commit listener.
371
388
  * @param listener - A listener callback function.
@@ -402,6 +419,13 @@ export declare interface ConnectEventsEmitter extends ConnectEvents {
402
419
  * @param functions - Any functions provided.
403
420
  */
404
421
  onStreamEvent(resourceName: string, message: Message<MessageDetails.DataserverRequest>, stream: SocketObservable<any>, functions: StreamEventFunctions): void;
422
+ /**
423
+ * Called by Connect.
424
+ * @param resourceName - The name of the resource.
425
+ * @param stream - The actual stream itself.
426
+ * @param error - The error that occurred.
427
+ */
428
+ onStreamErrorEvent(resourceName: string, stream: SocketObservable<any>, error: any): void;
405
429
  /**
406
430
  * Called by Connect.
407
431
  * @param resourceName - The name of the resource.
@@ -456,6 +480,7 @@ export declare class ConnectMock implements Connect {
456
480
  nextJSONSchema: any;
457
481
  nextMessage: Message;
458
482
  requestParams: RequestParams;
483
+ nextListState: any[];
459
484
  commitEvent(eventName: string, params?: CommitParams): Promise<Message>;
460
485
  connect(host: string): Promise<boolean>;
461
486
  disconnect(): void;
@@ -464,6 +489,7 @@ export declare class ConnectMock implements Connect {
464
489
  getAvailableResources(params?: RequestParams): Promise<Message>;
465
490
  snapshot(resourceName: string, params?: any): Promise<Message>;
466
491
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
492
+ streamState(resourceName: string, onMessage: Function, onError: Function, params?: any, initialState?: any[]): Observable<any[]>;
467
493
  streamWithoutAutoTeardown(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
468
494
  getMoreRows(sourceRef: string): Promise<Message<any>>;
469
495
  getMoreColumns(sourceRef: string): Promise<Message<any>>;
@@ -1140,7 +1166,7 @@ export declare class DefaultConnect implements Connect {
1140
1166
  get isConnected(): boolean;
1141
1167
  get isConnectedSubject(): BehaviorSubject<boolean>;
1142
1168
  get isConnected$(): Observable<boolean>;
1143
- constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config?: ConnectConfig);
1169
+ constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig);
1144
1170
  httpMode(): boolean;
1145
1171
  /**
1146
1172
  * @deprecated - Please reference {@link @genesislcap/foundation-user#User} instead.',
@@ -1151,6 +1177,7 @@ export declare class DefaultConnect implements Connect {
1151
1177
  disconnect(): void;
1152
1178
  snapshot(resourceName: string, params?: any): Promise<Message>;
1153
1179
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
1180
+ streamState(resourceName: string, onMessage?: Function, onError?: Function, params?: any, initialState?: any[]): Observable<any[]>;
1154
1181
  streamWithoutAutoTeardown(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
1155
1182
  getMoreRows(sourceRef: string): Promise<Message>;
1156
1183
  getMoreColumns(sourceRef: string): Promise<Message>;
@@ -1177,10 +1204,14 @@ export declare class DefaultConnectEvents implements ConnectEventsEmitter {
1177
1204
  protected streamListeners: Observer<StreamEvent>;
1178
1205
  /** @internal */
1179
1206
  protected streamCompleteListeners: Observer<StreamCompleteEvent>;
1207
+ /** @internal */
1208
+ protected streamErrorListeners: Observer<StreamErrorEvent>;
1180
1209
  /** {@inheritDoc ConnectEvents.addStreamListener} */
1181
- addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>): () => void;
1210
+ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>, error: Listener<StreamErrorEvent>): () => void;
1182
1211
  /** {@inheritDoc ConnectEventsEmitter.onStreamEvent} */
1183
1212
  onStreamEvent(resourceName: string, message: Message<MessageDetails.DataserverRequest>, stream: SocketObservable<any>, functions: StreamEventFunctions): void;
1213
+ /** {@inheritDoc ConnectEventsEmitter.onStreamErrorEvent} */
1214
+ onStreamErrorEvent(resourceName: string, stream: SocketObservable<any>, error: any): void;
1184
1215
  /** {@inheritDoc ConnectEventsEmitter.onStreamCompleteEvent} */
1185
1216
  onStreamCompleteEvent(resourceName: string, stream: SocketObservable<any>): void;
1186
1217
  /** @internal */
@@ -1367,7 +1398,7 @@ export declare class DefaultHttpConnect implements Connect {
1367
1398
  * @internal
1368
1399
  */
1369
1400
  private streams;
1370
- constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config?: HttpConnectConfig);
1401
+ constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig);
1371
1402
  /**
1372
1403
  * Checks if the host is available by sending a heartbeat ping message and waiting for the response.
1373
1404
  * @internal
@@ -1381,6 +1412,7 @@ export declare class DefaultHttpConnect implements Connect {
1381
1412
  disconnect(): void;
1382
1413
  snapshot(resourceName: string, params?: any): Promise<Message>;
1383
1414
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
1415
+ streamState(resourceName: string, onMessage?: Function, onError?: Function, params?: any, initialState?: any[]): Observable<any[]>;
1384
1416
  streamWithoutAutoTeardown(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message<any>>;
1385
1417
  private getMessage;
1386
1418
  getMoreRows(sourceRef: string): Promise<Message>;
@@ -1398,12 +1430,6 @@ export declare class DefaultHttpConnect implements Connect {
1398
1430
  private static getUrl;
1399
1431
  }
1400
1432
 
1401
- /**
1402
- * The default configuration for connecting to an HTTP service.
1403
- * @public
1404
- */
1405
- export declare const defaultHttpConnectConfig: HttpConnectConfig;
1406
-
1407
1433
  /**
1408
1434
  * The default implementation for the KVStorage interface.
1409
1435
  * @alpha
@@ -2217,7 +2243,7 @@ export declare const HttpConnect: InterfaceSymbol<Connect>;
2217
2243
  * Configuration options for the Connect (HTTP) instance.
2218
2244
  * @public
2219
2245
  */
2220
- export declare interface HttpConnectConfig {
2246
+ declare interface HttpConnectConfig {
2221
2247
  /**
2222
2248
  * Configuration options for http polling.
2223
2249
  */
@@ -2228,13 +2254,13 @@ export declare interface HttpConnectConfig {
2228
2254
  * Configuration options for the Connect (HTTP) instance.
2229
2255
  * @internal
2230
2256
  */
2231
- export declare const HttpConnectConfig: InterfaceSymbol<HttpConnectConfig>;
2257
+ declare const HttpConnectConfig: InterfaceSymbol<HttpConnectConfig>;
2232
2258
 
2233
2259
  /**
2234
2260
  * Configuration options for http connection.
2235
2261
  * @public
2236
2262
  */
2237
- export declare interface HttpPollingConfig {
2263
+ declare interface HttpPollingConfig {
2238
2264
  /**
2239
2265
  * The frequency of polling.
2240
2266
  */
@@ -2535,6 +2561,10 @@ export declare type Message<T = void | any> = {
2535
2561
 
2536
2562
  /**
2537
2563
  * A utility class for building different types of messages.
2564
+ *
2565
+ * @privateRemarks
2566
+ * The SESSION_AUTH_TOKEN etc in messages should probably be removed with the move to cookies.
2567
+ *
2538
2568
  * @public
2539
2569
  */
2540
2570
  export declare interface MessageBuilder {
@@ -2848,7 +2878,7 @@ export declare type MessageError = {
2848
2878
  /**
2849
2879
  * Check if the message contains an error code.
2850
2880
  * @param message - The message object.
2851
- * @param code - The error code.
2881
+ * @param code - The error code. Either a {@link http-status-codes#StatusCodes | StatusCodes} number or an entire status code string.
2852
2882
  * @public
2853
2883
  */
2854
2884
  export declare const messageHasErrorCode: (message: Message, code: string | number) => boolean;
@@ -3136,7 +3166,7 @@ export declare function normaliseCriteria(criteria: string, delimiter?: string):
3136
3166
  /**
3137
3167
  * @public
3138
3168
  */
3139
- export declare type PingMessage = Pick<Message, 'MESSAGE_TYPE' | 'SOURCE_REF' | 'DETAILS'> & {
3169
+ export declare type PingMessage = Pick<Message, 'MESSAGE_TYPE' | 'SOURCE_REF' | 'DETAILS' | 'SESSION_AUTH_TOKEN'> & {
3140
3170
  VERBOSE?: boolean;
3141
3171
  [key: string]: any;
3142
3172
  };
@@ -3145,7 +3175,7 @@ export declare type PingMessage = Pick<Message, 'MESSAGE_TYPE' | 'SOURCE_REF' |
3145
3175
  * Configuration options for http polling.
3146
3176
  * @public
3147
3177
  */
3148
- export declare interface PollingConfiguration {
3178
+ declare interface PollingConfiguration {
3149
3179
  /**
3150
3180
  * The temporary polling frequency.
3151
3181
  */
@@ -3766,6 +3796,23 @@ export declare type StreamCompleteEventDetail = Pick<StreamEventDetail, 'resourc
3766
3796
  */
3767
3797
  export declare const StreamCompleteEventType = "connect-stream-complete-event";
3768
3798
 
3799
+ /**
3800
+ * @public
3801
+ */
3802
+ export declare type StreamErrorEvent = CustomEvent<StreamErrorEventDetail>;
3803
+
3804
+ /**
3805
+ * @public
3806
+ */
3807
+ export declare type StreamErrorEventDetail = Pick<StreamEventDetail, 'resourceName' | 'stream'> & {
3808
+ error: any;
3809
+ };
3810
+
3811
+ /**
3812
+ * @public
3813
+ */
3814
+ export declare const StreamErrorEventType = "connect-stream-error-event";
3815
+
3769
3816
  /**
3770
3817
  * @public
3771
3818
  */
@@ -37,4 +37,5 @@ export interface Connect
37
37
  | [request(resourceName, params)](./foundation-comms.connect.request.md) | Sends a request to the server to retrieve data or perform an action. |
38
38
  | [snapshot(resourceName, params)](./foundation-comms.connect.snapshot.md) | Retrieves a snapshot of data for the specified resource. |
39
39
  | [stream(resourceName, onMessage, onError, params)](./foundation-comms.connect.stream.md) | Starts listening for updates on the specified resource. |
40
+ | [streamState(resourceName, onMessage, onError, params, initialState)](./foundation-comms.connect.streamstate.md) | Starts listening for updates on the specified resource. |
40
41
 
@@ -0,0 +1,30 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [Connect](./foundation-comms.connect.md) &gt; [streamState](./foundation-comms.connect.streamstate.md)
4
+
5
+ ## Connect.streamState() method
6
+
7
+ Starts listening for updates on the specified resource.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ streamState(resourceName: string, onMessage: Function, onError: Function, params?: any, initialState?: any[]): Observable<any[]>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | resourceName | string | The name of the resource to listen for updates on. |
20
+ | onMessage | Function | A callback function to handle received messages. |
21
+ | onError | Function | A callback function to handle errors. |
22
+ | params | any | _(Optional)_ Additional parameters to pass to the server. |
23
+ | initialState | any\[\] | _(Optional)_ State of the list to start with, defaults to empty array. |
24
+
25
+ **Returns:**
26
+
27
+ Observable&lt;any\[\]&gt;
28
+
29
+ An observable that emits latest state of the list it subscribes to.
30
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [ConnectConfig](./foundation-comms.connectconfig.md) &gt; [isWebSocketExpression](./foundation-comms.connectconfig.iswebsocketexpression.md)
4
+
5
+ ## ConnectConfig.isWebSocketExpression property
6
+
7
+ Check for web socket url pattern.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ isWebSocketExpression: RegExp;
13
+ ```
@@ -17,5 +17,6 @@ export interface ConnectConfig
17
17
  | Property | Modifiers | Type | Description |
18
18
  | --- | --- | --- | --- |
19
19
  | [connect](./foundation-comms.connectconfig.connect.md) | | [SocketConnectOptions](./foundation-comms.socketconnectoptions.md) | Options for the initial connection. |
20
+ | [isWebSocketExpression](./foundation-comms.connectconfig.iswebsocketexpression.md) | | RegExp | Check for web socket url pattern. |
20
21
  | [reconnect](./foundation-comms.connectconfig.reconnect.md) | | [SocketReconnectOptions](./foundation-comms.socketreconnectoptions.md) | Options for automatic reconnection on connection loss. |
21
22
 
@@ -9,7 +9,7 @@ Add a stream listener.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>): () => void;
12
+ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>, error: Listener<StreamErrorEvent>): () => void;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -18,6 +18,7 @@ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamComp
18
18
  | --- | --- | --- |
19
19
  | listener | Listener&lt;[StreamEvent](./foundation-comms.streamevent.md)<!-- -->&gt; | A listener callback function. |
20
20
  | complete | Listener&lt;[StreamCompleteEvent](./foundation-comms.streamcompleteevent.md)<!-- -->&gt; | A complete listener callback function. |
21
+ | error | Listener&lt;[StreamErrorEvent](./foundation-comms.streamerrorevent.md)<!-- -->&gt; | A error listener callback function. |
21
22
 
22
23
  **Returns:**
23
24
 
@@ -18,5 +18,5 @@ export interface ConnectEvents
18
18
  | --- | --- |
19
19
  | [addCommitListener(listener)](./foundation-comms.connectevents.addcommitlistener.md) | Add a commit listener. |
20
20
  | [addMetadataListener(listener)](./foundation-comms.connectevents.addmetadatalistener.md) | Add a metadata listener. |
21
- | [addStreamListener(listener, complete)](./foundation-comms.connectevents.addstreamlistener.md) | Add a stream listener. |
21
+ | [addStreamListener(listener, complete, error)](./foundation-comms.connectevents.addstreamlistener.md) | Add a stream listener. |
22
22
 
@@ -20,5 +20,6 @@ export interface ConnectEventsEmitter extends ConnectEvents
20
20
  | [onCommitEvent(eventName, message)](./foundation-comms.connecteventsemitter.oncommitevent.md) | Called by Connect. |
21
21
  | [onMetadataEvent(resourceName, message, error)](./foundation-comms.connecteventsemitter.onmetadataevent.md) | Called by Connect. |
22
22
  | [onStreamCompleteEvent(resourceName, stream)](./foundation-comms.connecteventsemitter.onstreamcompleteevent.md) | Called by Connect. |
23
+ | [onStreamErrorEvent(resourceName, stream, error)](./foundation-comms.connecteventsemitter.onstreamerrorevent.md) | Called by Connect. |
23
24
  | [onStreamEvent(resourceName, message, stream, functions)](./foundation-comms.connecteventsemitter.onstreamevent.md) | Called by Connect. |
24
25
 
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [ConnectEventsEmitter](./foundation-comms.connecteventsemitter.md) &gt; [onStreamErrorEvent](./foundation-comms.connecteventsemitter.onstreamerrorevent.md)
4
+
5
+ ## ConnectEventsEmitter.onStreamErrorEvent() method
6
+
7
+ Called by Connect.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onStreamErrorEvent(resourceName: string, stream: SocketObservable<any>, error: any): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | resourceName | string | The name of the resource. |
20
+ | stream | [SocketObservable](./foundation-comms.socketobservable.md)<!-- -->&lt;any&gt; | The actual stream itself. |
21
+ | error | any | The error that occurred. |
22
+
23
+ **Returns:**
24
+
25
+ void
26
+
@@ -9,7 +9,7 @@ Constructs a new instance of the `DefaultConnect` class
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config?: ConnectConfig);
12
+ constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig);
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -20,5 +20,5 @@ constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache
20
20
  | messageBuilder | [MessageBuilder](./foundation-comms.messagebuilder.md) | |
21
21
  | metaCache | [MetaCache](./foundation-comms.metacache.md) | |
22
22
  | events | [ConnectEventsEmitter](./foundation-comms.connecteventsemitter.md) | |
23
- | config | [ConnectConfig](./foundation-comms.connectconfig.md) | _(Optional)_ |
23
+ | config | [ConnectConfig](./foundation-comms.connectconfig.md) | |
24
24
 
@@ -48,5 +48,6 @@ export declare class DefaultConnect implements Connect
48
48
  | [setValidSession(valid)](./foundation-comms.defaultconnect.setvalidsession.md) | | |
49
49
  | [snapshot(resourceName, params)](./foundation-comms.defaultconnect.snapshot.md) | | |
50
50
  | [stream(resourceName, onMessage, onError, params)](./foundation-comms.defaultconnect.stream.md) | | |
51
+ | [streamState(resourceName, onMessage, onError, params, initialState)](./foundation-comms.defaultconnect.streamstate.md) | | |
51
52
  | [streamWithoutAutoTeardown(resourceName, onMessage, onError, params)](./foundation-comms.defaultconnect.streamwithoutautoteardown.md) | | |
52
53
 
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [DefaultConnect](./foundation-comms.defaultconnect.md) &gt; [streamState](./foundation-comms.defaultconnect.streamstate.md)
4
+
5
+ ## DefaultConnect.streamState() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ streamState(resourceName: string, onMessage?: Function, onError?: Function, params?: any, initialState?: any[]): Observable<any[]>;
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Type | Description |
16
+ | --- | --- | --- |
17
+ | resourceName | string | |
18
+ | onMessage | Function | _(Optional)_ |
19
+ | onError | Function | _(Optional)_ |
20
+ | params | any | _(Optional)_ |
21
+ | initialState | any\[\] | _(Optional)_ |
22
+
23
+ **Returns:**
24
+
25
+ Observable&lt;any\[\]&gt;
26
+
@@ -9,7 +9,7 @@ Add a stream listener.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>): () => void;
12
+ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamCompleteEvent>, error: Listener<StreamErrorEvent>): () => void;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -18,6 +18,7 @@ addStreamListener(listener: Listener<StreamEvent>, complete: Listener<StreamComp
18
18
  | --- | --- | --- |
19
19
  | listener | Listener&lt;[StreamEvent](./foundation-comms.streamevent.md)<!-- -->&gt; | A listener callback function. |
20
20
  | complete | Listener&lt;[StreamCompleteEvent](./foundation-comms.streamcompleteevent.md)<!-- -->&gt; | A complete listener callback function. |
21
+ | error | Listener&lt;[StreamErrorEvent](./foundation-comms.streamerrorevent.md)<!-- -->&gt; | A error listener callback function. |
21
22
 
22
23
  **Returns:**
23
24
 
@@ -19,9 +19,10 @@ export declare class DefaultConnectEvents implements ConnectEventsEmitter
19
19
  | --- | --- | --- |
20
20
  | [addCommitListener(listener)](./foundation-comms.defaultconnectevents.addcommitlistener.md) | | Add a commit listener. |
21
21
  | [addMetadataListener(listener)](./foundation-comms.defaultconnectevents.addmetadatalistener.md) | | Add a metadata listener. |
22
- | [addStreamListener(listener, complete)](./foundation-comms.defaultconnectevents.addstreamlistener.md) | | Add a stream listener. |
22
+ | [addStreamListener(listener, complete, error)](./foundation-comms.defaultconnectevents.addstreamlistener.md) | | Add a stream listener. |
23
23
  | [onCommitEvent(eventName, message)](./foundation-comms.defaultconnectevents.oncommitevent.md) | | Called by Connect. |
24
24
  | [onMetadataEvent(resourceName, message, error)](./foundation-comms.defaultconnectevents.onmetadataevent.md) | | Called by Connect. |
25
25
  | [onStreamCompleteEvent(resourceName, stream)](./foundation-comms.defaultconnectevents.onstreamcompleteevent.md) | | Called by Connect. |
26
+ | [onStreamErrorEvent(resourceName, stream, error)](./foundation-comms.defaultconnectevents.onstreamerrorevent.md) | | Called by Connect. |
26
27
  | [onStreamEvent(resourceName, message, stream, functions)](./foundation-comms.defaultconnectevents.onstreamevent.md) | | Called by Connect. |
27
28
 
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [DefaultConnectEvents](./foundation-comms.defaultconnectevents.md) &gt; [onStreamErrorEvent](./foundation-comms.defaultconnectevents.onstreamerrorevent.md)
4
+
5
+ ## DefaultConnectEvents.onStreamErrorEvent() method
6
+
7
+ Called by Connect.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onStreamErrorEvent(resourceName: string, stream: SocketObservable<any>, error: any): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | resourceName | string | The name of the resource. |
20
+ | stream | [SocketObservable](./foundation-comms.socketobservable.md)<!-- -->&lt;any&gt; | The actual stream itself. |
21
+ | error | any | The error that occurred. |
22
+
23
+ **Returns:**
24
+
25
+ void
26
+
@@ -9,7 +9,7 @@ Constructs a new instance of the `DefaultHttpConnect` class
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config?: HttpConnectConfig);
12
+ constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCache: MetaCache, serializer: JSONSerializer, config: HttpConnectConfig);
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -21,5 +21,5 @@ constructor(http: Http, messageBuilder: MessageBuilder, session: Session, metaCa
21
21
  | session | [Session](./foundation-comms.session.md) | |
22
22
  | metaCache | [MetaCache](./foundation-comms.metacache.md) | |
23
23
  | serializer | JSONSerializer | |
24
- | config | [HttpConnectConfig](./foundation-comms.httpconnectconfig.md) | _(Optional)_ |
24
+ | config | HttpConnectConfig | |
25
25
 
@@ -49,5 +49,6 @@ export declare class DefaultHttpConnect implements Connect
49
49
  | [setValidSession(valid)](./foundation-comms.defaulthttpconnect.setvalidsession.md) | | |
50
50
  | [snapshot(resourceName, params)](./foundation-comms.defaulthttpconnect.snapshot.md) | | |
51
51
  | [stream(resourceName, onMessage, onError, params)](./foundation-comms.defaulthttpconnect.stream.md) | | |
52
+ | [streamState(resourceName, onMessage, onError, params, initialState)](./foundation-comms.defaulthttpconnect.streamstate.md) | | |
52
53
  | [streamWithoutAutoTeardown(resourceName, onMessage, onError, params)](./foundation-comms.defaulthttpconnect.streamwithoutautoteardown.md) | | |
53
54
 
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [DefaultHttpConnect](./foundation-comms.defaulthttpconnect.md) &gt; [streamState](./foundation-comms.defaulthttpconnect.streamstate.md)
4
+
5
+ ## DefaultHttpConnect.streamState() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ streamState(resourceName: string, onMessage?: Function, onError?: Function, params?: any, initialState?: any[]): Observable<any[]>;
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Type | Description |
16
+ | --- | --- | --- |
17
+ | resourceName | string | |
18
+ | onMessage | Function | _(Optional)_ |
19
+ | onError | Function | _(Optional)_ |
20
+ | params | any | _(Optional)_ |
21
+ | initialState | any\[\] | _(Optional)_ |
22
+
23
+ **Returns:**
24
+
25
+ Observable&lt;any\[\]&gt;
26
+
@@ -76,8 +76,6 @@
76
76
  | [Dataview](./foundation-comms.dataview.md) | Dataview object |
77
77
  | [FoundationAnalytics](./foundation-comms.foundationanalytics.md) | Represents an analytics tracking system. |
78
78
  | [Http](./foundation-comms.http.md) | An interface representing an HTTP client that can make GET and POST requests and return a promise with the response data. |
79
- | [HttpConnectConfig](./foundation-comms.httpconnectconfig.md) | Configuration options for the Connect (HTTP) instance. |
80
- | [HttpPollingConfig](./foundation-comms.httppollingconfig.md) | Configuration options for http connection. |
81
79
  | [HttpRequestInit](./foundation-comms.httprequestinit.md) | The options object used when making an HTTP request. |
82
80
  | [JsonSchemaCache](./foundation-comms.jsonschemacache.md) | A JSON schema cache definition |
83
81
  | [LogoutResult](./foundation-comms.logoutresult.md) | Represents the result of a user logout operation. |
@@ -87,7 +85,6 @@
87
85
  | [MonitoredResourceMetadata](./foundation-comms.monitoredresourcemetadata.md) | MonitoredResourceMetadata. |
88
86
  | [NetworkMonitor](./foundation-comms.networkmonitor.md) | <code>NetworkMonitor</code> monitors network and resource availability and health. |
89
87
  | [NetworkMonitorConfig](./foundation-comms.networkmonitorconfig.md) | NetworkMonitorConfig DI interface. |
90
- | [PollingConfiguration](./foundation-comms.pollingconfiguration.md) | Configuration options for http polling. |
91
88
  | [SerializedSocketStatus](./foundation-comms.serializedsocketstatus.md) | <code>SerializedSocketStatus</code> provides the serialize state of the web socket. |
92
89
  | [Serializer](./foundation-comms.serializer.md) | A Serializer interface for serializing and deserializing objects. |
93
90
  | [Session](./foundation-comms.session.md) | Represents a session storage and its capabilities. Provides methods to set and get items from the specified storage. |
@@ -112,7 +109,6 @@
112
109
  | [defaultCredentialManagerConfig](./foundation-comms.defaultcredentialmanagerconfig.md) | The default configuration for the CredentialManager service. |
113
110
  | [defaultCredentialRequestOptions](./foundation-comms.defaultcredentialrequestoptions.md) | The default request options for the CredentialManager service. |
114
111
  | [defaultDatasourceConfig](./foundation-comms.defaultdatasourceconfig.md) | The default configuration for the Datasource service. |
115
- | [defaultHttpConnectConfig](./foundation-comms.defaulthttpconnectconfig.md) | The default configuration for connecting to an HTTP service. |
116
112
  | [defaultNetworkMonitorConfig](./foundation-comms.defaultnetworkmonitorconfig.md) | Default NetworkMonitorConfig DI implementation. |
117
113
  | [exponentialScheduler](./foundation-comms.exponentialscheduler.md) | Expontential Interval scheduler for reconnect |
118
114
  | [extractFieldDefinitions](./foundation-comms.extractfielddefinitions.md) | Extracts the field definitions from the metadata. |
@@ -126,6 +122,7 @@
126
122
  | [networkLogger](./foundation-comms.networklogger.md) | |
127
123
  | [retryInterval](./foundation-comms.retryinterval.md) | Generate reconnect interval based on scheduler |
128
124
  | [StreamCompleteEventType](./foundation-comms.streamcompleteeventtype.md) | |
125
+ | [StreamErrorEventType](./foundation-comms.streamerroreventtype.md) | |
129
126
  | [StreamEventType](./foundation-comms.streameventtype.md) | |
130
127
  | [SystemHealthChanged](./foundation-comms.systemhealthchanged.md) | SystemHealthChanged. |
131
128
  | [toFieldMetadata](./foundation-comms.tofieldmetadata.md) | Converts the field definitions to field metadata. |
@@ -179,6 +176,8 @@
179
176
  | [StorageType](./foundation-comms.storagetype.md) | The available browser storage types. |
180
177
  | [StreamCompleteEvent](./foundation-comms.streamcompleteevent.md) | |
181
178
  | [StreamCompleteEventDetail](./foundation-comms.streamcompleteeventdetail.md) | |
179
+ | [StreamErrorEvent](./foundation-comms.streamerrorevent.md) | |
180
+ | [StreamErrorEventDetail](./foundation-comms.streamerroreventdetail.md) | |
182
181
  | [StreamEvent](./foundation-comms.streamevent.md) | |
183
182
  | [StreamEventDetail](./foundation-comms.streameventdetail.md) | |
184
183
  | [StreamEventFunctions](./foundation-comms.streameventfunctions.md) | |
@@ -8,7 +8,7 @@
8
8
  **Signature:**
9
9
 
10
10
  ```typescript
11
- export type PingMessage = Pick<Message, 'MESSAGE_TYPE' | 'SOURCE_REF' | 'DETAILS'> & {
11
+ export type PingMessage = Pick<Message, 'MESSAGE_TYPE' | 'SOURCE_REF' | 'DETAILS' | 'SESSION_AUTH_TOKEN'> & {
12
12
  VERBOSE?: boolean;
13
13
  [key: string]: any;
14
14
  };
@@ -0,0 +1,14 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [StreamErrorEvent](./foundation-comms.streamerrorevent.md)
4
+
5
+ ## StreamErrorEvent type
6
+
7
+
8
+ **Signature:**
9
+
10
+ ```typescript
11
+ export type StreamErrorEvent = CustomEvent<StreamErrorEventDetail>;
12
+ ```
13
+ **References:** [StreamErrorEventDetail](./foundation-comms.streamerroreventdetail.md)
14
+
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [StreamErrorEventDetail](./foundation-comms.streamerroreventdetail.md)
4
+
5
+ ## StreamErrorEventDetail type
6
+
7
+
8
+ **Signature:**
9
+
10
+ ```typescript
11
+ export type StreamErrorEventDetail = Pick<StreamEventDetail, 'resourceName' | 'stream'> & {
12
+ error: any;
13
+ };
14
+ ```
15
+ **References:** [StreamEventDetail](./foundation-comms.streameventdetail.md)
16
+
@@ -0,0 +1,12 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-comms](./foundation-comms.md) &gt; [StreamErrorEventType](./foundation-comms.streamerroreventtype.md)
4
+
5
+ ## StreamErrorEventType variable
6
+
7
+
8
+ **Signature:**
9
+
10
+ ```typescript
11
+ StreamErrorEventType = "connect-stream-error-event"
12
+ ```