@streamlayer/sdk-web-notifications 1.3.5 → 1.3.7
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/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/notifications.d.ts +1 -6
- package/lib/notifications.js +1 -6
- package/lib/queue/index.js +2 -0
- package/package.json +5 -5
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
2
2
|
import { Notifications } from './notifications';
|
|
3
|
-
export { type Notification, type NotificationData,
|
|
3
|
+
export { type Notification, type NotificationData, Notifications } from './notifications';
|
|
4
4
|
export { type NotificationsList } from './queue';
|
|
5
5
|
export type NotificationsStore = ReturnType<Notifications['getQueueStore']>;
|
|
6
|
+
export { NotificationType } from '@streamlayer/sdk-web-types';
|
|
6
7
|
declare module '@streamlayer/sdk-web-interfaces' {
|
|
7
8
|
interface StreamLayerContext {
|
|
8
9
|
notifications: Notifications;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Notifications } from './notifications';
|
|
2
|
-
export {
|
|
2
|
+
export { Notifications } from './notifications';
|
|
3
|
+
export { NotificationType } from '@streamlayer/sdk-web-types';
|
|
3
4
|
/**
|
|
4
5
|
* notifications plugin, connect notifications to sdk
|
|
5
6
|
*/
|
package/lib/notifications.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InstantView, QuestionType, GameSettings, TweetHistory, ExtendedQuestion } from '@streamlayer/sdk-web-types';
|
|
1
|
+
import { InstantView, QuestionType, GameSettings, TweetHistory, ExtendedQuestion, NotificationType } from '@streamlayer/sdk-web-types';
|
|
2
2
|
import { NotificationsQueue, NotificationsQueueOptions } from './queue';
|
|
3
3
|
export type NotificationData = {
|
|
4
4
|
questionId: string;
|
|
@@ -38,11 +38,6 @@ export type NotificationData = {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
export declare enum NotificationType {
|
|
42
|
-
ONBOARDING = 1,
|
|
43
|
-
QUESTION = 2,
|
|
44
|
-
QUESTION_RESOLVED = 3
|
|
45
|
-
}
|
|
46
41
|
export type Notification<M extends Record<string, Function> = never> = {
|
|
47
42
|
autoHideDuration: number;
|
|
48
43
|
delay?: number;
|
package/lib/notifications.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
import { NotificationType, } from '@streamlayer/sdk-web-types';
|
|
1
2
|
import { eventBus } from '@streamlayer/sdk-web-interfaces';
|
|
2
3
|
import { NotificationsQueue } from './queue';
|
|
3
4
|
import { NotificationStorage } from './storage';
|
|
4
|
-
export var NotificationType;
|
|
5
|
-
(function (NotificationType) {
|
|
6
|
-
NotificationType[NotificationType["ONBOARDING"] = 1] = "ONBOARDING";
|
|
7
|
-
NotificationType[NotificationType["QUESTION"] = 2] = "QUESTION";
|
|
8
|
-
NotificationType[NotificationType["QUESTION_RESOLVED"] = 3] = "QUESTION_RESOLVED";
|
|
9
|
-
})(NotificationType || (NotificationType = {}));
|
|
10
5
|
/**
|
|
11
6
|
* @description app notifications (inapp)
|
|
12
7
|
*/
|
package/lib/queue/index.js
CHANGED
|
@@ -89,6 +89,7 @@ export class NotificationsQueue {
|
|
|
89
89
|
eventBus.emit('notification', {
|
|
90
90
|
action: 'received',
|
|
91
91
|
payload: {
|
|
92
|
+
type: notification.type,
|
|
92
93
|
questionId: notification.data.questionId,
|
|
93
94
|
questionType: notification.data.questionType,
|
|
94
95
|
},
|
|
@@ -131,6 +132,7 @@ export class NotificationsQueue {
|
|
|
131
132
|
eventBus.emit('notification', {
|
|
132
133
|
action: 'closed',
|
|
133
134
|
payload: {
|
|
135
|
+
type: notification.type,
|
|
134
136
|
questionId: notification.data.questionId,
|
|
135
137
|
questionType: notification.data.questionType,
|
|
136
138
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/sdk-web-notifications",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"package.json"
|
|
10
10
|
],
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@streamlayer/sdk-web-interfaces": "^1.4.
|
|
13
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
14
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
15
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
12
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.11",
|
|
13
|
+
"@streamlayer/sdk-web-logger": "^1.0.45",
|
|
14
|
+
"@streamlayer/sdk-web-storage": "^1.0.45",
|
|
15
|
+
"@streamlayer/sdk-web-types": "^1.10.2"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|