buzzcasting-storage 1.0.13 → 2.0.2

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 CHANGED
@@ -22,32 +22,32 @@ Example call:
22
22
 
23
23
  ```js
24
24
  import BuzzcastingStorageManager, {
25
+ IMessages,
25
26
  IQuery,
26
27
  IStorageManager,
27
- IMessages,
28
- } from "buzzcasting-storage";
28
+ } from 'buzzcasting-storage'
29
29
 
30
30
  const options: IStorageManager = {
31
- app: "my-subdomain",
32
- version: "v4",
33
- token: "meta",
34
- bearer: "bearer_token",
35
- storage: "dexie",
36
- moderation: "none",
31
+ app: 'my-subdomain',
32
+ version: 'v4',
33
+ token: 'meta',
34
+ bearer: 'bearer_token',
35
+ storage: 'dexie',
36
+ moderation: 'none',
37
37
  beforeTime: null,
38
38
  delay: 0,
39
39
  period: 0,
40
- };
40
+ }
41
41
 
42
- let storageManager = new BuzzcastingStorageManager(options);
42
+ const storageManager = new BuzzcastingStorageManager(options)
43
43
 
44
44
  const query: IQuery = {
45
- type: "messages",
46
- dashboard: "dashboard_id",
47
- widget: "widget_id",
48
- };
45
+ type: 'messages',
46
+ dashboard: 'dashboard_id',
47
+ widget: 'widget_id',
48
+ }
49
49
 
50
- const data: IMessages = storageManager.getMessages(query);
50
+ const data: IMessages = storageManager.getMessages(query)
51
51
  ```
52
52
 
53
53
  This will initiate a call to the buzzcasting backoffice to retrieve results
@@ -55,7 +55,6 @@ This will initiate a call to the buzzcasting backoffice to retrieve results
55
55
  The Storage Manager will carry out the API call for the subscriber, and send out a BroadcastChannel on `app` to inform the subcriber that it can retrieve new data. The broadcast channel facilitates its incorporation in for example a Web Worker.
56
56
 
57
57
  ```js
58
-
59
58
  const broadcastChannel = new BroadcastChannel('my-subdomain')
60
59
 
61
60
  broadcastChannel.onmessage = (messageEvent: MessageEvent) => {
@@ -69,10 +68,9 @@ actions = (messageEvent: MessageEvent) => {
69
68
  this.widgetUpdated.emit(messageEvent.data.data)
70
69
  break
71
70
  default:
72
- //console.log('[storage]', messageEvent.data)
71
+ // console.log('[storage]', messageEvent.data)
73
72
  }
74
73
  }
75
-
76
74
  ```
77
75
 
78
76
  ### Git Clone
@@ -3,7 +3,7 @@ declare class BuzzcastingStorageManager {
3
3
  private api;
4
4
  private bc;
5
5
  private options;
6
- constructor(options: IStorageManager);
6
+ constructor(options: IStorageOptions);
7
7
  update: () => Promise<void>;
8
8
  hide: (query: IQuery) => void;
9
9
  private actions;
@@ -52,24 +52,24 @@ export declare interface IQuery {
52
52
  widget?: string;
53
53
  compare?: string;
54
54
  period?: number;
55
- type?: "cloud" | "messages" | "indicators" | "proxy";
55
+ type?: 'cloud' | 'messages' | 'indicators' | 'proxy';
56
56
  order?: string;
57
57
  media?: number;
58
58
  dynamics?: number;
59
59
  geo?: number;
60
60
  delay?: string;
61
61
  approved?: string;
62
- moderation?: "realtime" | "delayed" | "approved";
62
+ moderation?: 'realtime' | 'delayed' | 'approved';
63
63
  hrm?: string;
64
64
  before?: number;
65
65
  since?: number;
66
66
  }
67
67
 
68
- export declare interface IStorageManager {
68
+ export declare interface IStorageOptions {
69
69
  app: string;
70
70
  version: string;
71
71
  storage: string;
72
- slide?: string;
72
+ slide: string;
73
73
  presentation?: string;
74
74
  token?: string;
75
75
  bearer?: string;