@amityco/ts-sdk 7.22.1-522f1bc.0 → 7.22.1-b4e7d51.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.
- package/dist/@types/domains/notificationSettings.d.ts +101 -0
- package/dist/@types/domains/notificationSettings.d.ts.map +1 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/client/api/notifications.d.ts +27 -0
- package/dist/client/api/notifications.d.ts.map +1 -0
- package/dist/client/api/tests/notifications.integration.test.d.ts +2 -0
- package/dist/client/api/tests/notifications.integration.test.d.ts.map +1 -0
- package/dist/index.cjs.js +168 -0
- package/dist/index.esm.js +169 -1
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare enum UserNotificationModuleNameEnum {
|
|
2
|
+
CHAT = "chat",
|
|
3
|
+
SOCIAL = "social",
|
|
4
|
+
VIDEO_STREAMING = "video-streaming"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CommunityNotificationEventNameEnum {
|
|
7
|
+
POST_CREATED = "post.created",
|
|
8
|
+
POST_REACTED = "post.reacted",
|
|
9
|
+
COMMENT_CREATED = "comment.created",
|
|
10
|
+
COMMENT_REPLIED = "comment.replied",
|
|
11
|
+
COMMENT_REACTED = "comment.reacted",
|
|
12
|
+
STORY_CREATED = "story.created",
|
|
13
|
+
STORY_REACTED = "story.reacted",
|
|
14
|
+
STORY_COMMENT_CREATED = "story-comment.created",
|
|
15
|
+
LIVESTREAM_START = "video-streaming.didStart"
|
|
16
|
+
}
|
|
17
|
+
export declare enum NotificationSettingsLevelEnum {
|
|
18
|
+
USER = "user",
|
|
19
|
+
COMMUNITY = "community",
|
|
20
|
+
CHANNEL = "channel"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `NOT` variant is intentionally excluded from public API (internal server-side use only).
|
|
24
|
+
*/
|
|
25
|
+
export declare enum NotificationRolesFilterTypeEnum {
|
|
26
|
+
ALL = "all",
|
|
27
|
+
ONLY = "only"
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
namespace Amity {
|
|
31
|
+
type UserNotificationModuleName = UserNotificationModuleNameEnum;
|
|
32
|
+
type CommunityNotificationEventName = CommunityNotificationEventNameEnum;
|
|
33
|
+
type NotificationRolesFilter = {
|
|
34
|
+
type: NotificationRolesFilterTypeEnum.ALL;
|
|
35
|
+
} | {
|
|
36
|
+
type: NotificationRolesFilterTypeEnum.ONLY;
|
|
37
|
+
roleIds: string[];
|
|
38
|
+
} | {
|
|
39
|
+
type: 'not';
|
|
40
|
+
roleIds: string[];
|
|
41
|
+
};
|
|
42
|
+
type UserNotificationModule = {
|
|
43
|
+
moduleName: Amity.UserNotificationModuleName;
|
|
44
|
+
isEnabled: boolean;
|
|
45
|
+
rolesFilter?: Amity.NotificationRolesFilter;
|
|
46
|
+
};
|
|
47
|
+
type UserNotificationSettings = {
|
|
48
|
+
isEnabled: boolean;
|
|
49
|
+
modules: Amity.UserNotificationModule[];
|
|
50
|
+
};
|
|
51
|
+
type CommunityNotificationEvent = {
|
|
52
|
+
eventName: Amity.CommunityNotificationEventName;
|
|
53
|
+
isEnabled: boolean;
|
|
54
|
+
/** @readonly Populated by SDK on read. Silently ignored on write. */
|
|
55
|
+
isNetworkEnabled?: boolean;
|
|
56
|
+
rolesFilter?: Amity.NotificationRolesFilter;
|
|
57
|
+
};
|
|
58
|
+
type CommunityNotificationSettings = {
|
|
59
|
+
isEnabled: boolean;
|
|
60
|
+
events: Amity.CommunityNotificationEvent[];
|
|
61
|
+
};
|
|
62
|
+
type ChannelNotificationSettings = {
|
|
63
|
+
isEnabled: boolean;
|
|
64
|
+
};
|
|
65
|
+
type NotificationEvent = {
|
|
66
|
+
name: Amity.CommunityNotificationEventName | string;
|
|
67
|
+
moduleName: Amity.UserNotificationModuleName;
|
|
68
|
+
eventName: string;
|
|
69
|
+
isPushNotifiable: boolean;
|
|
70
|
+
isNetworkEnabled: boolean;
|
|
71
|
+
listenFromRoleIds: string[];
|
|
72
|
+
ignoreFromRoleIds: string[];
|
|
73
|
+
};
|
|
74
|
+
type NotificationSettings = {
|
|
75
|
+
isPushNotifiable: boolean;
|
|
76
|
+
isUserEnabled: boolean;
|
|
77
|
+
notifiableEvents: Amity.NotificationEvent[];
|
|
78
|
+
};
|
|
79
|
+
type NotificationEventPayload = {
|
|
80
|
+
moduleName?: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
isPushNotifiable: boolean;
|
|
83
|
+
listenFromRoleIds?: string[];
|
|
84
|
+
};
|
|
85
|
+
type NotificationSettingsPayload = {
|
|
86
|
+
level: NotificationSettingsLevelEnum.USER;
|
|
87
|
+
isPushNotifiable: boolean;
|
|
88
|
+
notifiableEvents: NotificationEventPayload[];
|
|
89
|
+
} | {
|
|
90
|
+
level: NotificationSettingsLevelEnum.CHANNEL;
|
|
91
|
+
channelId: string;
|
|
92
|
+
isPushNotifiable: boolean;
|
|
93
|
+
} | {
|
|
94
|
+
level: NotificationSettingsLevelEnum.COMMUNITY;
|
|
95
|
+
communityId: string;
|
|
96
|
+
isPushNotifiable: boolean;
|
|
97
|
+
notifiableEvents: NotificationEventPayload[];
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=notificationSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationSettings.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/notificationSettings.ts"],"names":[],"mappings":"AAAA,oBAAY,8BAA8B;IACxC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,eAAe,oBAAoB;CACpC;AAED,oBAAY,kCAAkC;IAC5C,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;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gB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,cAAc,cAAc,CAAC;AAE7B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAE9B,cAAc,mBAAmB,CAAC;AAElC,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iCAAiC,CAAC;AAEhD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,cAAc,cAAc,CAAC;AAE7B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAE9B,cAAc,mBAAmB,CAAC;AAElC,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iCAAiC,CAAC;AAEhD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AAErC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare class ChannelNotifications {
|
|
2
|
+
private readonly channelId;
|
|
3
|
+
constructor(channelId: string);
|
|
4
|
+
enable(): Promise<void>;
|
|
5
|
+
disable(): Promise<void>;
|
|
6
|
+
getSettings(): Promise<Amity.ChannelNotificationSettings>;
|
|
7
|
+
}
|
|
8
|
+
declare class UserNotifications {
|
|
9
|
+
enable(modules?: Amity.UserNotificationModule[]): Promise<void>;
|
|
10
|
+
disableAllNotifications(): Promise<void>;
|
|
11
|
+
getSettings(): Promise<Amity.UserNotificationSettings>;
|
|
12
|
+
}
|
|
13
|
+
declare class CommunityNotifications {
|
|
14
|
+
private readonly communityId;
|
|
15
|
+
constructor(communityId: string);
|
|
16
|
+
enable(events?: Amity.CommunityNotificationEvent[]): Promise<void>;
|
|
17
|
+
disable(): Promise<void>;
|
|
18
|
+
getSettings(): Promise<Amity.CommunityNotificationSettings>;
|
|
19
|
+
}
|
|
20
|
+
declare class Notifications {
|
|
21
|
+
user(): UserNotifications;
|
|
22
|
+
community(communityId: string): CommunityNotifications;
|
|
23
|
+
channel(channelId: string): ChannelNotifications;
|
|
24
|
+
}
|
|
25
|
+
export declare const notifications: () => Notifications;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/client/api/notifications.ts"],"names":[],"mappings":"AA8BA,cAAM,oBAAoB;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,SAAS,EAAE,MAAM;IAIvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUxB,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC;CAWhE;AAED,cAAM,iBAAiB;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB/D,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYxC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAkB7D;AAED,cAAM,sBAAsB;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,WAAW,EAAE,MAAM;IAIzB,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,0BAA0B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBlE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAaxB,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC;CAsBlE;AAED,cAAM,aAAa;IACjB,IAAI;IAIJ,SAAS,CAAC,WAAW,EAAE,MAAM;IAI7B,OAAO,CAAC,SAAS,EAAE,MAAM;CAG1B;AAED,eAAO,MAAM,aAAa,qBAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.integration.test.d.ts","sourceRoot":"","sources":["../../../../src/client/api/tests/notifications.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/index.cjs.js
CHANGED
|
@@ -255,6 +255,39 @@ exports.AnalyticsSourceTypeEnum = void 0;
|
|
|
255
255
|
AnalyticsSourceTypeEnum["ROOM"] = "room";
|
|
256
256
|
})(exports.AnalyticsSourceTypeEnum || (exports.AnalyticsSourceTypeEnum = {}));
|
|
257
257
|
|
|
258
|
+
exports.UserNotificationModuleNameEnum = void 0;
|
|
259
|
+
(function (UserNotificationModuleNameEnum) {
|
|
260
|
+
UserNotificationModuleNameEnum["CHAT"] = "chat";
|
|
261
|
+
UserNotificationModuleNameEnum["SOCIAL"] = "social";
|
|
262
|
+
UserNotificationModuleNameEnum["VIDEO_STREAMING"] = "video-streaming";
|
|
263
|
+
})(exports.UserNotificationModuleNameEnum || (exports.UserNotificationModuleNameEnum = {}));
|
|
264
|
+
exports.CommunityNotificationEventNameEnum = void 0;
|
|
265
|
+
(function (CommunityNotificationEventNameEnum) {
|
|
266
|
+
CommunityNotificationEventNameEnum["POST_CREATED"] = "post.created";
|
|
267
|
+
CommunityNotificationEventNameEnum["POST_REACTED"] = "post.reacted";
|
|
268
|
+
CommunityNotificationEventNameEnum["COMMENT_CREATED"] = "comment.created";
|
|
269
|
+
CommunityNotificationEventNameEnum["COMMENT_REPLIED"] = "comment.replied";
|
|
270
|
+
CommunityNotificationEventNameEnum["COMMENT_REACTED"] = "comment.reacted";
|
|
271
|
+
CommunityNotificationEventNameEnum["STORY_CREATED"] = "story.created";
|
|
272
|
+
CommunityNotificationEventNameEnum["STORY_REACTED"] = "story.reacted";
|
|
273
|
+
CommunityNotificationEventNameEnum["STORY_COMMENT_CREATED"] = "story-comment.created";
|
|
274
|
+
CommunityNotificationEventNameEnum["LIVESTREAM_START"] = "video-streaming.didStart";
|
|
275
|
+
})(exports.CommunityNotificationEventNameEnum || (exports.CommunityNotificationEventNameEnum = {}));
|
|
276
|
+
exports.NotificationSettingsLevelEnum = void 0;
|
|
277
|
+
(function (NotificationSettingsLevelEnum) {
|
|
278
|
+
NotificationSettingsLevelEnum["USER"] = "user";
|
|
279
|
+
NotificationSettingsLevelEnum["COMMUNITY"] = "community";
|
|
280
|
+
NotificationSettingsLevelEnum["CHANNEL"] = "channel";
|
|
281
|
+
})(exports.NotificationSettingsLevelEnum || (exports.NotificationSettingsLevelEnum = {}));
|
|
282
|
+
/**
|
|
283
|
+
* `NOT` variant is intentionally excluded from public API (internal server-side use only).
|
|
284
|
+
*/
|
|
285
|
+
exports.NotificationRolesFilterTypeEnum = void 0;
|
|
286
|
+
(function (NotificationRolesFilterTypeEnum) {
|
|
287
|
+
NotificationRolesFilterTypeEnum["ALL"] = "all";
|
|
288
|
+
NotificationRolesFilterTypeEnum["ONLY"] = "only";
|
|
289
|
+
})(exports.NotificationRolesFilterTypeEnum || (exports.NotificationRolesFilterTypeEnum = {}));
|
|
290
|
+
|
|
258
291
|
function getVersion() {
|
|
259
292
|
try {
|
|
260
293
|
// the string ''v7.22.0-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
@@ -10858,6 +10891,140 @@ const setAccessTokenHandler = (accessTokenHandler) => {
|
|
|
10858
10891
|
client.accessTokenHandler = accessTokenHandler;
|
|
10859
10892
|
};
|
|
10860
10893
|
|
|
10894
|
+
function parseRolesFilter(listenFromRoleIds, ignoreFromRoleIds) {
|
|
10895
|
+
if (ignoreFromRoleIds && ignoreFromRoleIds.length > 0) {
|
|
10896
|
+
return { type: 'not', roleIds: ignoreFromRoleIds };
|
|
10897
|
+
}
|
|
10898
|
+
if (listenFromRoleIds && listenFromRoleIds.length > 0) {
|
|
10899
|
+
return { type: exports.NotificationRolesFilterTypeEnum.ONLY, roleIds: listenFromRoleIds };
|
|
10900
|
+
}
|
|
10901
|
+
return { type: exports.NotificationRolesFilterTypeEnum.ALL };
|
|
10902
|
+
}
|
|
10903
|
+
function serializeRolesFilter(rolesFilter) {
|
|
10904
|
+
if ((rolesFilter === null || rolesFilter === void 0 ? void 0 : rolesFilter.type) === exports.NotificationRolesFilterTypeEnum.ONLY) {
|
|
10905
|
+
return { listenFromRoleIds: rolesFilter.roleIds };
|
|
10906
|
+
}
|
|
10907
|
+
return { listenFromRoleIds: [] };
|
|
10908
|
+
}
|
|
10909
|
+
class ChannelNotifications {
|
|
10910
|
+
constructor(channelId) {
|
|
10911
|
+
this.channelId = channelId;
|
|
10912
|
+
}
|
|
10913
|
+
async enable() {
|
|
10914
|
+
const client = getActiveClient();
|
|
10915
|
+
const body = {
|
|
10916
|
+
level: exports.NotificationSettingsLevelEnum.CHANNEL,
|
|
10917
|
+
channelId: this.channelId,
|
|
10918
|
+
isPushNotifiable: true,
|
|
10919
|
+
};
|
|
10920
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10921
|
+
}
|
|
10922
|
+
async disable() {
|
|
10923
|
+
const client = getActiveClient();
|
|
10924
|
+
const body = {
|
|
10925
|
+
level: exports.NotificationSettingsLevelEnum.CHANNEL,
|
|
10926
|
+
channelId: this.channelId,
|
|
10927
|
+
isPushNotifiable: false,
|
|
10928
|
+
};
|
|
10929
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10930
|
+
}
|
|
10931
|
+
async getSettings() {
|
|
10932
|
+
const client = getActiveClient();
|
|
10933
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${exports.NotificationSettingsLevelEnum.CHANNEL}&channelId=${encodeURIComponent(this.channelId)}`);
|
|
10934
|
+
return { isEnabled: data.isPushNotifiable };
|
|
10935
|
+
}
|
|
10936
|
+
}
|
|
10937
|
+
class UserNotifications {
|
|
10938
|
+
async enable(modules) {
|
|
10939
|
+
var _a;
|
|
10940
|
+
const client = getActiveClient();
|
|
10941
|
+
const notifiableEvents = (_a = modules === null || modules === void 0 ? void 0 : modules.map(module => (Object.assign({ moduleName: module.moduleName, isPushNotifiable: module.isEnabled }, serializeRolesFilter(module.rolesFilter))))) !== null && _a !== void 0 ? _a : [];
|
|
10942
|
+
const body = {
|
|
10943
|
+
level: exports.NotificationSettingsLevelEnum.USER,
|
|
10944
|
+
isPushNotifiable: true,
|
|
10945
|
+
notifiableEvents,
|
|
10946
|
+
};
|
|
10947
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10948
|
+
}
|
|
10949
|
+
async disableAllNotifications() {
|
|
10950
|
+
const client = getActiveClient();
|
|
10951
|
+
const body = {
|
|
10952
|
+
level: exports.NotificationSettingsLevelEnum.USER,
|
|
10953
|
+
isPushNotifiable: false,
|
|
10954
|
+
notifiableEvents: [],
|
|
10955
|
+
};
|
|
10956
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10957
|
+
}
|
|
10958
|
+
async getSettings() {
|
|
10959
|
+
var _a;
|
|
10960
|
+
const client = getActiveClient();
|
|
10961
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${exports.NotificationSettingsLevelEnum.USER}`);
|
|
10962
|
+
const validModuleNames = Object.values(exports.UserNotificationModuleNameEnum);
|
|
10963
|
+
const modules = ((_a = data.notifiableEvents) !== null && _a !== void 0 ? _a : [])
|
|
10964
|
+
.filter(e => e.moduleName != null && validModuleNames.includes(e.moduleName))
|
|
10965
|
+
.map(e => ({
|
|
10966
|
+
moduleName: e.moduleName,
|
|
10967
|
+
isEnabled: e.isPushNotifiable,
|
|
10968
|
+
rolesFilter: parseRolesFilter(e.listenFromRoleIds, e.ignoreFromRoleIds),
|
|
10969
|
+
}));
|
|
10970
|
+
return { isEnabled: data.isPushNotifiable, modules };
|
|
10971
|
+
}
|
|
10972
|
+
}
|
|
10973
|
+
class CommunityNotifications {
|
|
10974
|
+
constructor(communityId) {
|
|
10975
|
+
this.communityId = communityId;
|
|
10976
|
+
}
|
|
10977
|
+
async enable(events) {
|
|
10978
|
+
var _a;
|
|
10979
|
+
const client = getActiveClient();
|
|
10980
|
+
const notifiableEvents = (_a = events === null || events === void 0 ? void 0 : events.map(event => (Object.assign({ moduleName: exports.UserNotificationModuleNameEnum.SOCIAL, name: event.eventName, isPushNotifiable: event.isEnabled }, serializeRolesFilter(event.rolesFilter))))) !== null && _a !== void 0 ? _a : [];
|
|
10981
|
+
const body = {
|
|
10982
|
+
level: exports.NotificationSettingsLevelEnum.COMMUNITY,
|
|
10983
|
+
communityId: this.communityId,
|
|
10984
|
+
isPushNotifiable: true,
|
|
10985
|
+
notifiableEvents,
|
|
10986
|
+
};
|
|
10987
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10988
|
+
}
|
|
10989
|
+
async disable() {
|
|
10990
|
+
const client = getActiveClient();
|
|
10991
|
+
const body = {
|
|
10992
|
+
level: exports.NotificationSettingsLevelEnum.COMMUNITY,
|
|
10993
|
+
communityId: this.communityId,
|
|
10994
|
+
isPushNotifiable: false,
|
|
10995
|
+
notifiableEvents: [],
|
|
10996
|
+
};
|
|
10997
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
10998
|
+
}
|
|
10999
|
+
async getSettings() {
|
|
11000
|
+
var _a;
|
|
11001
|
+
const client = getActiveClient();
|
|
11002
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${exports.NotificationSettingsLevelEnum.COMMUNITY}&communityId=${encodeURIComponent(this.communityId)}`);
|
|
11003
|
+
const validEventNames = Object.values(exports.CommunityNotificationEventNameEnum);
|
|
11004
|
+
const events = ((_a = data.notifiableEvents) !== null && _a !== void 0 ? _a : [])
|
|
11005
|
+
.filter(e => e.name != null && validEventNames.includes(e.name))
|
|
11006
|
+
.map(e => ({
|
|
11007
|
+
eventName: e.name,
|
|
11008
|
+
isEnabled: e.isPushNotifiable,
|
|
11009
|
+
isNetworkEnabled: e.isNetworkEnabled,
|
|
11010
|
+
rolesFilter: parseRolesFilter(e.listenFromRoleIds, e.ignoreFromRoleIds),
|
|
11011
|
+
}));
|
|
11012
|
+
return { isEnabled: data.isPushNotifiable, events };
|
|
11013
|
+
}
|
|
11014
|
+
}
|
|
11015
|
+
class Notifications {
|
|
11016
|
+
user() {
|
|
11017
|
+
return new UserNotifications();
|
|
11018
|
+
}
|
|
11019
|
+
community(communityId) {
|
|
11020
|
+
return new CommunityNotifications(communityId);
|
|
11021
|
+
}
|
|
11022
|
+
channel(channelId) {
|
|
11023
|
+
return new ChannelNotifications(channelId);
|
|
11024
|
+
}
|
|
11025
|
+
}
|
|
11026
|
+
const notifications = () => new Notifications();
|
|
11027
|
+
|
|
10861
11028
|
/**
|
|
10862
11029
|
* ```js
|
|
10863
11030
|
* import { onChannelMarkerFetched } from '@amityco/ts-sdk'
|
|
@@ -11238,6 +11405,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
11238
11405
|
getCurrentUserType: getCurrentUserType,
|
|
11239
11406
|
setCurrentUserType: setCurrentUserType,
|
|
11240
11407
|
setAccessTokenHandler: setAccessTokenHandler,
|
|
11408
|
+
notifications: notifications,
|
|
11241
11409
|
onConnectionError: onConnectionError,
|
|
11242
11410
|
onClientDisconnected: onClientDisconnected,
|
|
11243
11411
|
onClientBanned: onClientBanned,
|
package/dist/index.esm.js
CHANGED
|
@@ -240,6 +240,39 @@ var AnalyticsSourceTypeEnum;
|
|
|
240
240
|
AnalyticsSourceTypeEnum["ROOM"] = "room";
|
|
241
241
|
})(AnalyticsSourceTypeEnum || (AnalyticsSourceTypeEnum = {}));
|
|
242
242
|
|
|
243
|
+
var UserNotificationModuleNameEnum;
|
|
244
|
+
(function (UserNotificationModuleNameEnum) {
|
|
245
|
+
UserNotificationModuleNameEnum["CHAT"] = "chat";
|
|
246
|
+
UserNotificationModuleNameEnum["SOCIAL"] = "social";
|
|
247
|
+
UserNotificationModuleNameEnum["VIDEO_STREAMING"] = "video-streaming";
|
|
248
|
+
})(UserNotificationModuleNameEnum || (UserNotificationModuleNameEnum = {}));
|
|
249
|
+
var CommunityNotificationEventNameEnum;
|
|
250
|
+
(function (CommunityNotificationEventNameEnum) {
|
|
251
|
+
CommunityNotificationEventNameEnum["POST_CREATED"] = "post.created";
|
|
252
|
+
CommunityNotificationEventNameEnum["POST_REACTED"] = "post.reacted";
|
|
253
|
+
CommunityNotificationEventNameEnum["COMMENT_CREATED"] = "comment.created";
|
|
254
|
+
CommunityNotificationEventNameEnum["COMMENT_REPLIED"] = "comment.replied";
|
|
255
|
+
CommunityNotificationEventNameEnum["COMMENT_REACTED"] = "comment.reacted";
|
|
256
|
+
CommunityNotificationEventNameEnum["STORY_CREATED"] = "story.created";
|
|
257
|
+
CommunityNotificationEventNameEnum["STORY_REACTED"] = "story.reacted";
|
|
258
|
+
CommunityNotificationEventNameEnum["STORY_COMMENT_CREATED"] = "story-comment.created";
|
|
259
|
+
CommunityNotificationEventNameEnum["LIVESTREAM_START"] = "video-streaming.didStart";
|
|
260
|
+
})(CommunityNotificationEventNameEnum || (CommunityNotificationEventNameEnum = {}));
|
|
261
|
+
var NotificationSettingsLevelEnum;
|
|
262
|
+
(function (NotificationSettingsLevelEnum) {
|
|
263
|
+
NotificationSettingsLevelEnum["USER"] = "user";
|
|
264
|
+
NotificationSettingsLevelEnum["COMMUNITY"] = "community";
|
|
265
|
+
NotificationSettingsLevelEnum["CHANNEL"] = "channel";
|
|
266
|
+
})(NotificationSettingsLevelEnum || (NotificationSettingsLevelEnum = {}));
|
|
267
|
+
/**
|
|
268
|
+
* `NOT` variant is intentionally excluded from public API (internal server-side use only).
|
|
269
|
+
*/
|
|
270
|
+
var NotificationRolesFilterTypeEnum;
|
|
271
|
+
(function (NotificationRolesFilterTypeEnum) {
|
|
272
|
+
NotificationRolesFilterTypeEnum["ALL"] = "all";
|
|
273
|
+
NotificationRolesFilterTypeEnum["ONLY"] = "only";
|
|
274
|
+
})(NotificationRolesFilterTypeEnum || (NotificationRolesFilterTypeEnum = {}));
|
|
275
|
+
|
|
243
276
|
function getVersion() {
|
|
244
277
|
try {
|
|
245
278
|
// the string ''v7.22.0-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
@@ -26950,6 +26983,140 @@ const setAccessTokenHandler = (accessTokenHandler) => {
|
|
|
26950
26983
|
client.accessTokenHandler = accessTokenHandler;
|
|
26951
26984
|
};
|
|
26952
26985
|
|
|
26986
|
+
function parseRolesFilter(listenFromRoleIds, ignoreFromRoleIds) {
|
|
26987
|
+
if (ignoreFromRoleIds && ignoreFromRoleIds.length > 0) {
|
|
26988
|
+
return { type: 'not', roleIds: ignoreFromRoleIds };
|
|
26989
|
+
}
|
|
26990
|
+
if (listenFromRoleIds && listenFromRoleIds.length > 0) {
|
|
26991
|
+
return { type: NotificationRolesFilterTypeEnum.ONLY, roleIds: listenFromRoleIds };
|
|
26992
|
+
}
|
|
26993
|
+
return { type: NotificationRolesFilterTypeEnum.ALL };
|
|
26994
|
+
}
|
|
26995
|
+
function serializeRolesFilter(rolesFilter) {
|
|
26996
|
+
if ((rolesFilter === null || rolesFilter === void 0 ? void 0 : rolesFilter.type) === NotificationRolesFilterTypeEnum.ONLY) {
|
|
26997
|
+
return { listenFromRoleIds: rolesFilter.roleIds };
|
|
26998
|
+
}
|
|
26999
|
+
return { listenFromRoleIds: [] };
|
|
27000
|
+
}
|
|
27001
|
+
class ChannelNotifications {
|
|
27002
|
+
constructor(channelId) {
|
|
27003
|
+
this.channelId = channelId;
|
|
27004
|
+
}
|
|
27005
|
+
async enable() {
|
|
27006
|
+
const client = getActiveClient();
|
|
27007
|
+
const body = {
|
|
27008
|
+
level: NotificationSettingsLevelEnum.CHANNEL,
|
|
27009
|
+
channelId: this.channelId,
|
|
27010
|
+
isPushNotifiable: true,
|
|
27011
|
+
};
|
|
27012
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27013
|
+
}
|
|
27014
|
+
async disable() {
|
|
27015
|
+
const client = getActiveClient();
|
|
27016
|
+
const body = {
|
|
27017
|
+
level: NotificationSettingsLevelEnum.CHANNEL,
|
|
27018
|
+
channelId: this.channelId,
|
|
27019
|
+
isPushNotifiable: false,
|
|
27020
|
+
};
|
|
27021
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27022
|
+
}
|
|
27023
|
+
async getSettings() {
|
|
27024
|
+
const client = getActiveClient();
|
|
27025
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${NotificationSettingsLevelEnum.CHANNEL}&channelId=${encodeURIComponent(this.channelId)}`);
|
|
27026
|
+
return { isEnabled: data.isPushNotifiable };
|
|
27027
|
+
}
|
|
27028
|
+
}
|
|
27029
|
+
class UserNotifications {
|
|
27030
|
+
async enable(modules) {
|
|
27031
|
+
var _a;
|
|
27032
|
+
const client = getActiveClient();
|
|
27033
|
+
const notifiableEvents = (_a = modules === null || modules === void 0 ? void 0 : modules.map(module => (Object.assign({ moduleName: module.moduleName, isPushNotifiable: module.isEnabled }, serializeRolesFilter(module.rolesFilter))))) !== null && _a !== void 0 ? _a : [];
|
|
27034
|
+
const body = {
|
|
27035
|
+
level: NotificationSettingsLevelEnum.USER,
|
|
27036
|
+
isPushNotifiable: true,
|
|
27037
|
+
notifiableEvents,
|
|
27038
|
+
};
|
|
27039
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27040
|
+
}
|
|
27041
|
+
async disableAllNotifications() {
|
|
27042
|
+
const client = getActiveClient();
|
|
27043
|
+
const body = {
|
|
27044
|
+
level: NotificationSettingsLevelEnum.USER,
|
|
27045
|
+
isPushNotifiable: false,
|
|
27046
|
+
notifiableEvents: [],
|
|
27047
|
+
};
|
|
27048
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27049
|
+
}
|
|
27050
|
+
async getSettings() {
|
|
27051
|
+
var _a;
|
|
27052
|
+
const client = getActiveClient();
|
|
27053
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${NotificationSettingsLevelEnum.USER}`);
|
|
27054
|
+
const validModuleNames = Object.values(UserNotificationModuleNameEnum);
|
|
27055
|
+
const modules = ((_a = data.notifiableEvents) !== null && _a !== void 0 ? _a : [])
|
|
27056
|
+
.filter(e => e.moduleName != null && validModuleNames.includes(e.moduleName))
|
|
27057
|
+
.map(e => ({
|
|
27058
|
+
moduleName: e.moduleName,
|
|
27059
|
+
isEnabled: e.isPushNotifiable,
|
|
27060
|
+
rolesFilter: parseRolesFilter(e.listenFromRoleIds, e.ignoreFromRoleIds),
|
|
27061
|
+
}));
|
|
27062
|
+
return { isEnabled: data.isPushNotifiable, modules };
|
|
27063
|
+
}
|
|
27064
|
+
}
|
|
27065
|
+
class CommunityNotifications {
|
|
27066
|
+
constructor(communityId) {
|
|
27067
|
+
this.communityId = communityId;
|
|
27068
|
+
}
|
|
27069
|
+
async enable(events) {
|
|
27070
|
+
var _a;
|
|
27071
|
+
const client = getActiveClient();
|
|
27072
|
+
const notifiableEvents = (_a = events === null || events === void 0 ? void 0 : events.map(event => (Object.assign({ moduleName: UserNotificationModuleNameEnum.SOCIAL, name: event.eventName, isPushNotifiable: event.isEnabled }, serializeRolesFilter(event.rolesFilter))))) !== null && _a !== void 0 ? _a : [];
|
|
27073
|
+
const body = {
|
|
27074
|
+
level: NotificationSettingsLevelEnum.COMMUNITY,
|
|
27075
|
+
communityId: this.communityId,
|
|
27076
|
+
isPushNotifiable: true,
|
|
27077
|
+
notifiableEvents,
|
|
27078
|
+
};
|
|
27079
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27080
|
+
}
|
|
27081
|
+
async disable() {
|
|
27082
|
+
const client = getActiveClient();
|
|
27083
|
+
const body = {
|
|
27084
|
+
level: NotificationSettingsLevelEnum.COMMUNITY,
|
|
27085
|
+
communityId: this.communityId,
|
|
27086
|
+
isPushNotifiable: false,
|
|
27087
|
+
notifiableEvents: [],
|
|
27088
|
+
};
|
|
27089
|
+
await client.http.post('/api/v3/notification/setting', body);
|
|
27090
|
+
}
|
|
27091
|
+
async getSettings() {
|
|
27092
|
+
var _a;
|
|
27093
|
+
const client = getActiveClient();
|
|
27094
|
+
const { data } = await client.http.get(`/api/v3/notification/setting?level=${NotificationSettingsLevelEnum.COMMUNITY}&communityId=${encodeURIComponent(this.communityId)}`);
|
|
27095
|
+
const validEventNames = Object.values(CommunityNotificationEventNameEnum);
|
|
27096
|
+
const events = ((_a = data.notifiableEvents) !== null && _a !== void 0 ? _a : [])
|
|
27097
|
+
.filter(e => e.name != null && validEventNames.includes(e.name))
|
|
27098
|
+
.map(e => ({
|
|
27099
|
+
eventName: e.name,
|
|
27100
|
+
isEnabled: e.isPushNotifiable,
|
|
27101
|
+
isNetworkEnabled: e.isNetworkEnabled,
|
|
27102
|
+
rolesFilter: parseRolesFilter(e.listenFromRoleIds, e.ignoreFromRoleIds),
|
|
27103
|
+
}));
|
|
27104
|
+
return { isEnabled: data.isPushNotifiable, events };
|
|
27105
|
+
}
|
|
27106
|
+
}
|
|
27107
|
+
class Notifications {
|
|
27108
|
+
user() {
|
|
27109
|
+
return new UserNotifications();
|
|
27110
|
+
}
|
|
27111
|
+
community(communityId) {
|
|
27112
|
+
return new CommunityNotifications(communityId);
|
|
27113
|
+
}
|
|
27114
|
+
channel(channelId) {
|
|
27115
|
+
return new ChannelNotifications(channelId);
|
|
27116
|
+
}
|
|
27117
|
+
}
|
|
27118
|
+
const notifications = () => new Notifications();
|
|
27119
|
+
|
|
26953
27120
|
/**
|
|
26954
27121
|
* ```js
|
|
26955
27122
|
* import { onChannelMarkerFetched } from '@amityco/ts-sdk'
|
|
@@ -27330,6 +27497,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
27330
27497
|
getCurrentUserType: getCurrentUserType,
|
|
27331
27498
|
setCurrentUserType: setCurrentUserType,
|
|
27332
27499
|
setAccessTokenHandler: setAccessTokenHandler,
|
|
27500
|
+
notifications: notifications,
|
|
27333
27501
|
onConnectionError: onConnectionError,
|
|
27334
27502
|
onClientDisconnected: onClientDisconnected,
|
|
27335
27503
|
onClientBanned: onClientBanned,
|
|
@@ -51731,4 +51899,4 @@ class AmityAttachmentProductTags {
|
|
|
51731
51899
|
}
|
|
51732
51900
|
}
|
|
51733
51901
|
|
|
51734
|
-
export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|
|
51902
|
+
export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|