buzzcasting-storage 3.7.8 → 3.9.0

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,29 +1,8 @@
1
- export declare function anonymize(name: string): string;
2
-
3
- export declare enum API {
4
- MESSAGES = "messages",
5
- CLOUD = "cloud",
6
- SERIES = "series",
7
- TOPICS = "topics",
8
- WIDGET = "widget",
9
- WIDGETS = "widgets",
10
- DASHBOARD = "dashboard",
11
- DASHBOARDS = "dashboards",
12
- SLIDE = "slide",
13
- SLIDES = "slides",
14
- PRESENTATION = "presentation",
15
- PRESENTATIONS = "presentations",
16
- PREFERENCE = "preference",
17
- PREFERENCES = "preferences"
18
- }
19
-
20
- export declare type ApiData = ISeries & IMessages & ICloud;
21
-
22
- export declare function attachedMedia(message: IMessage): IAttachedMedia;
23
-
24
- export declare function attrs(attributes: NamedNodeMap): any;
25
-
26
- export declare function brandLogo(channel: string, size: string): string;
1
+ import { IModal } from 'buzzcasting-utils';
2
+ import { IPreference } from 'buzzcasting-utils';
3
+ import { IQuery } from 'buzzcasting-utils';
4
+ import { IResponse } from 'buzzcasting-utils';
5
+ import { IStorageOptions } from 'buzzcasting-utils';
27
6
 
28
7
  export declare class BuzzcastingStorageManager {
29
8
  private sm;
@@ -34,6 +13,7 @@ export declare class BuzzcastingStorageManager {
34
13
  constructor(options: IStorageOptions);
35
14
  addSubscriber(query: IQuery): void;
36
15
  update: (query: IQuery) => Promise<void>;
16
+ private processResponse;
37
17
  private broadcastUpdate;
38
18
  hide: (query: IQuery) => void;
39
19
  private actions;
@@ -88,481 +68,6 @@ export declare class BuzzcastingStorageReader {
88
68
  getSeries: (query: IQuery) => Promise<IResponse>;
89
69
  }
90
70
 
91
- /**
92
- * Convert string containing hyphens to camelCase
93
- * @param str
94
- * @returns string
95
- */
96
- export declare function camelCase(str: string): string;
97
-
98
- /**
99
- * Convert string containing hyphens to camelCase
100
- * @param str
101
- * @returns camilized string
102
- */
103
- export declare function camelize(str: string): string;
104
-
105
- export declare const capitalizeFirstLetter: (prop: string) => string;
106
-
107
- /**
108
- * Clear Container range contents of template code when the web component is connected to the DOM
109
- * @param myNode
110
- */
111
- export declare function clearContents(myNode: HTMLElement): void;
112
-
113
- declare enum CSS_2 {
114
- API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;",
115
- APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;",
116
- BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;",
117
- CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;",
118
- DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;",
119
- ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;",
120
- GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;",
121
- HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;",
122
- MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;",
123
- NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;",
124
- NONE = "color:transparent;background-color:transparent;",
125
- PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;",
126
- SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;",
127
- SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;",
128
- STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;",
129
- SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;",
130
- WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;",
131
- WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;"
132
- }
133
- export { CSS_2 as CSS }
134
-
135
- export declare function deepMerge(objs: any): void;
136
-
137
- export declare enum EVENTS {
138
- ADD_SLIDE = "addSlide",
139
- APP_READY = "appReady",
140
- API_UPDATE = "apiUpdate",
141
- WS_API_REQUEST = "wsApiRequest",
142
- WS_API_RESPONSE = "wsApiResponse",
143
- WS_API_UPDATE = "wsApiRUpdate",
144
- APPROVE_MESSAGE = "approveMessage",
145
- CHANNEL = "channel",
146
- CLEAN_MESSAGES = "cleanMessages",
147
- CLOSE_MODAL = "closeModal",
148
- CLOSE_BUILDER_MODAL = "closeBuilderModal",
149
- DASHBOARD_LOAD = "loadDashboard",
150
- DASHBOARD_STORE = "storeDashboard",
151
- ERROR = "error",
152
- HIDE_MESSAGE = "hideMessage",
153
- HIDE_LABELS = "hideLabels",
154
- MAUPPUT_UPDATE = "layoutUpdate",
155
- PREV_SLIDE = "prevSlide",
156
- RELOAD_PRESENTATION = "reloadPresentation",
157
- SHOW_MODAL = "showModal",
158
- STAR_MESSAGE = "starMessage",
159
- GOTO_SLIDE = "gotoSlide",
160
- NEXT_SLIDE = "nextSlide",
161
- PREFERENCE_LOAD = "loadPreference",
162
- PREFERENCE_STORE = "storePreference",
163
- PAUSE_PRESENTATION = "pausePresentation",
164
- PRESENTATION_READY = "presentationReady",
165
- PRESENTATION_LOAD = "loadPresentation",
166
- PRESENTATION_STORE = "storePresentation",
167
- SHOW_BUILDER_MODAL = "showBuilderModal",
168
- SLIDE_DID_LOAD = "slideDidLoad",
169
- SLIDE_GOTO = "slideGoto",
170
- SLIDE_READY = "slideReady",
171
- SLIDE_LOAD = "loadSlide",
172
- SLIDE_STORE = "storeSlide",
173
- SLIDE_TRANSITIONER = "slideTransitioner",
174
- START_TRANSITIONER = "startTransitioner",
175
- STORAGE_INIT = "storageInit",
176
- SUBSCRIBE = "subscribe",
177
- SUSPEND_ACCOUNT = "suspendAccount",
178
- SWITCH_PRESENTATION = "switchPresentation",
179
- REMOVE_CLOUD = "removeCloud",
180
- UPDATE = "update",
181
- VERSION = "version",
182
- WIDGET_LOAD = "widgetLoad",
183
- WIDGET_STORE = "widgetStore",
184
- WIDGET_UPDATE = "widgetUpdate"
185
- }
186
-
187
- export declare function filterAttributes(attributes: NamedNodeMap): IFilteredAttributes;
188
-
189
- export declare function formatContent(message: IMessage, titleCss?: string): string;
190
-
191
- export declare function hashSum(o: any): string | any[];
192
-
193
- declare interface IAttachedMedia {
194
- image?: string;
195
- background: {
196
- backgroundimage?: string;
197
- } | null;
198
- video?: string;
199
- }
200
-
201
- export declare interface ICategory {
202
- type: string;
203
- data: string[];
204
- }
205
-
206
- /**
207
- * Cloud
208
- */
209
- export declare interface ICloud {
210
- labels: ILabel[];
211
- current: any[];
212
- previous: any[];
213
- type: string;
214
- total: number;
215
- current_total: number;
216
- previous_total: number;
217
- }
218
-
219
- declare interface ICloudIndicators {
220
- total: number;
221
- positive: number;
222
- negative: number;
223
- neutral: number;
224
- engagement: number;
225
- reach: number;
226
- velocity: number;
227
- }
228
-
229
- export declare interface IDashboard {
230
- id: string;
231
- title: string;
232
- project: {
233
- id: string;
234
- title: string;
235
- };
236
- commandcenter: any;
237
- widgets?: IWidget[];
238
- }
239
-
240
- export declare interface IDashboards {
241
- dashboards: IDashboard[];
242
- }
243
-
244
- export declare interface IDynamics {
245
- engagement?: number;
246
- semrush_visits?: number;
247
- potential_reach?: number;
248
- facebook_engagement?: number;
249
- facebook_insights_reach?: number;
250
- facebook_insights_impressions?: number;
251
- facebook_insights_link_clicks?: number;
252
- facebook_reactions?: number;
253
- facebook_shares?: number;
254
- instagram_followers?: number;
255
- instagram_likes?: number;
256
- retweets?: number;
257
- twitter_shares?: number;
258
- twitter_bookmarks?: number;
259
- twitter_followers?: number;
260
- twitter_impressions?: number;
261
- twitter_insights_retweets?: number;
262
- twitter_likes?: number;
263
- twitter_replies?: number;
264
- twitter_video_views?: number;
265
- total_comments?: number;
266
- trending_score?: number;
267
- }
268
-
269
- declare interface IFilteredAttributes {
270
- [key: string]: string | object;
271
- }
272
-
273
- export declare interface IGeo {
274
- latitude?: number;
275
- longitude?: number;
276
- zip?: string;
277
- street: string;
278
- city?: string;
279
- country: string;
280
- }
281
-
282
- export declare interface IIndicators {
283
- value: number;
284
- }
285
-
286
- export declare interface ILabel {
287
- label: string;
288
- count: number;
289
- info?: string;
290
- current: ICloudIndicators;
291
- previous?: ICloudIndicators;
292
- percentage?: number;
293
- }
294
-
295
- export declare interface IMedium {
296
- type: string;
297
- url: string;
298
- width: number;
299
- height: number;
300
- }
301
-
302
- export declare interface IMessage {
303
- id: string;
304
- published: string;
305
- harvested: string;
306
- utc: number;
307
- expires: number;
308
- channel: string;
309
- type: string;
310
- sender: ISender;
311
- reply: string;
312
- replyto: string;
313
- page: string;
314
- conversation: string;
315
- title: string;
316
- content: string;
317
- sentiment: number;
318
- link: string;
319
- language?: string;
320
- region?: string;
321
- topics: ITopic[];
322
- dynamics?: IDynamics;
323
- geo?: IGeo;
324
- media?: IMedium[];
325
- }
326
-
327
- export declare interface IMessages {
328
- messages: IMessage[];
329
- presentation?: string;
330
- slide?: string;
331
- title?: string;
332
- dashboard?: string;
333
- widget?: string;
334
- topics?: string;
335
- }
336
-
337
- export declare interface IMetrics {
338
- doc?: number;
339
- previous?: number;
340
- change?: number;
341
- }
342
-
343
- /**
344
- * IModal
345
- */
346
- export declare interface IModal {
347
- showComponent: string;
348
- props?: any;
349
- timeout?: number;
350
- }
351
-
352
- export declare function intToString(num: any, digits: number): string;
353
-
354
- export declare interface IPreference {
355
- id: string;
356
- value?: string;
357
- update?: number;
358
- }
359
-
360
- export declare interface IPreferences {
361
- preferences: IPreference[];
362
- }
363
-
364
- export declare interface IPresentation {
365
- id: string;
366
- name: string;
367
- link: string;
368
- delay: number;
369
- canModerate: boolean;
370
- period: number;
371
- slide_interval: number;
372
- update: number;
373
- }
374
-
375
- export declare interface IPresentations {
376
- presentations: IPresentation[];
377
- }
378
-
379
- /**
380
- * Query
381
- */
382
- export declare interface IQuery {
383
- [x: string]: any;
384
- topics?: string;
385
- presentation?: string;
386
- dashboard: string;
387
- widget: string;
388
- labels?: string[];
389
- compare?: string;
390
- period?: number;
391
- type?: "cloud" | "messages" | "series" | "preference" | "proxy" | "slide" | "dashboard" | "widget";
392
- order?: "utc" | "reach" | "engagement" | "impressions";
393
- media?: number;
394
- dynamics?: number;
395
- geo?: number;
396
- delay?: string;
397
- approved?: string;
398
- moderation?: "realtime" | "delayed" | "approved" | "none";
399
- hrm?: string;
400
- before?: number;
401
- since?: number;
402
- hash?: string;
403
- name?: string;
404
- data?: any;
405
- }
406
-
407
- /**
408
- * API Response
409
- */
410
- export declare interface IResponse {
411
- data: IDashboards | IMessages | ISeries | ICloud | ISlides | IPresentations | IPreferences | IWidgets | null;
412
- message: string;
413
- success: boolean;
414
- query?: IQuery;
415
- }
416
-
417
- /**
418
- * Messages
419
- */
420
- export declare interface ISender {
421
- id?: string;
422
- channel?: string;
423
- title?: string;
424
- name?: string;
425
- avatar?: string;
426
- bio?: string;
427
- location?: string;
428
- verified?: number;
429
- following?: number;
430
- followers?: number;
431
- listed?: number;
432
- favourites?: number;
433
- messages?: number;
434
- influence?: number;
435
- }
436
-
437
- /**
438
- * Series Data
439
- */
440
- export declare interface ISeries {
441
- topic: string;
442
- title: string;
443
- series: ISeriesData[];
444
- category: ICategory;
445
- metrics?: IMetrics;
446
- indicators?: IIndicators;
447
- timestamp?: number;
448
- }
449
-
450
- export declare interface ISeriesData {
451
- name?: string;
452
- label?: string;
453
- current?: number[];
454
- current_total?: number;
455
- previous_total?: number;
456
- previous?: number[];
457
- current_category?: number;
458
- previous_category?: number;
459
- }
460
-
461
- export declare interface ISlides {
462
- presentation: string;
463
- slides: any;
464
- }
465
-
466
- /**
467
- * Storage Options
468
- */
469
- export declare interface IStorageOptions {
470
- app: string;
471
- builder?: boolean;
472
- domain?: string;
473
- cdn?: string;
474
- channel?: string;
475
- presentation: string;
476
- slide?: string;
477
- slides?: string[];
478
- display?: string;
479
- monitor?: string;
480
- version: string;
481
- storage: string;
482
- token?: string;
483
- bearer?: string;
484
- csrf?: string;
485
- moderation?: string;
486
- beforeTime?: string;
487
- delay?: number;
488
- period?: number;
489
- retention?: number;
490
- suspended?: boolean;
491
- loglevel?: number;
492
- }
493
-
494
- export declare interface ITopic {
495
- message_id: string;
496
- dashboard_id?: string;
497
- widget_id?: string;
498
- topic?: string;
499
- engagement: number;
500
- impressions: number;
501
- reach: number;
502
- sentiment: number;
503
- title?: string;
504
- utc?: number;
505
- expires?: number;
506
- visible?: number;
507
- }
508
-
509
- export declare interface IWidget {
510
- id: string;
511
- title: string;
512
- type: string;
513
- filters?: any;
514
- custom_filters?: any;
515
- creation_date?: string;
516
- period?: string;
517
- }
518
-
519
- export declare interface IWidgets {
520
- widgets: IWidget[];
521
- }
522
-
523
- export declare enum MODERATION {
524
- APPROVED = "approved",
525
- BEFORE = "before",
526
- DELAYED = "delayed",
527
- NONE = "none",
528
- REALTIME = "realtime"
529
- }
530
-
531
- export declare function numberFormatter(num: number, digits: number): string;
532
-
533
- /**
534
- * Get a random item from an array
535
- * @param array
536
- * @returns
537
- */
538
- export declare function randomValue(array: string | any[]): number;
539
-
540
- export declare function rtl(message: IMessage): {
541
- [key: string]: string;
542
- };
543
-
544
- export declare function sanitize(messages: IMessage[]): IMessage[];
545
-
546
- export declare function showModal(e: MouseEvent, widget: Widget, message: IMessage, options: any): void;
547
-
548
- export declare function shuffleMessages(messages: IMessage[]): IMessage[];
549
-
550
- export declare enum STORAGE {
551
- KEYVAL = "keyval",
552
- LOCAL = "local",
553
- SESSION = "session",
554
- DEXIE = "dexie",
555
- WINDOW = "window"
556
- }
557
-
558
- /**
559
- * Generate a unique identifier
560
- * @returns uid
561
- */
562
- export declare function stringGen(): string;
563
-
564
- export declare const upDownColor: (change: number) => "text-down text-xs" | "text-up text-xs" | "text-white text-xs";
565
-
566
71
  /**
567
72
  * Main class for managing widgets and data updates
568
73
  */
@@ -625,6 +130,4 @@ export declare class Widget {
625
130
  destroy(): void;
626
131
  }
627
132
 
628
- export declare function widgetParams(query: IQuery): IQuery;
629
-
630
133
  export { }