@bluecopa/core 0.1.7 → 0.1.8

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.
@@ -1,3 +1,4 @@
1
1
  export * from './date';
2
2
  export { getMetricDefinition } from './metric/getMetricDefinition';
3
3
  export * as inputTableUtils from './inputTable/inputTableDefinition';
4
+ export * as websocketUtils from './websockets/websocketProviderFactory';
@@ -0,0 +1,18 @@
1
+ import { IWebsocketProvider } from './websocketProviderFactory';
2
+ declare class CentrifugoWebsocket implements IWebsocketProvider {
3
+ private connectionUrl?;
4
+ private centrifuge;
5
+ private subscriptions;
6
+ isConnected: boolean;
7
+ private accessToken;
8
+ private userId;
9
+ constructor(connectionUrl?: string);
10
+ connect(): void;
11
+ private _bind;
12
+ bind(channel: string, event: string, callback: (data: any) => void): void;
13
+ bindGlobal(channel: string, callback: (data: any) => void): void;
14
+ unbind(channel: string, event: string): void;
15
+ unbindAll(channel: string): void;
16
+ disconnect(): void;
17
+ }
18
+ export default CentrifugoWebsocket;
@@ -0,0 +1,13 @@
1
+ export interface IWebsocketProvider {
2
+ connect: () => void;
3
+ bind: (channel: string, event: string, callback: (data: any) => void) => void;
4
+ bindGlobal: (event: string, callback: (data: any) => void) => void;
5
+ unbind: (channel: string, event: string) => void;
6
+ unbindAll: (channel: string) => void;
7
+ disconnect: () => void;
8
+ }
9
+ export declare class WebsocketContextFactory {
10
+ static create(mechanism: "pusher" | "centrifugo", args: {
11
+ connectionUrl?: string;
12
+ }): IWebsocketProvider;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluecopa/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "axios": "1.12.0",
37
- "lodash": "4.17.21"
37
+ "lodash": "4.17.21",
38
+ "centrifuge": "5.2.2"
38
39
  }
39
40
  }