UNPKG

@amityco/ts-sdk

Version:

Amity Social Cloud Typescript SDK

101 lines 3.6 kB
export declare enum UserNotificationModuleNameEnum { CHAT = "chat", SOCIAL = "social", VIDEO_STREAMING = "video-streaming" } export declare enum CommunityNotificationEventNameEnum { POST_CREATED = "post.created", POST_REACTED = "post.reacted", COMMENT_CREATED = "comment.created", COMMENT_REPLIED = "comment.replied", COMMENT_REACTED = "comment.reacted", STORY_CREATED = "story.created", STORY_REACTED = "story.reacted", STORY_COMMENT_CREATED = "story-comment.created", LIVESTREAM_START = "video-streaming.didStart" } export declare enum NotificationSettingsLevelEnum { USER = "user", COMMUNITY = "community", CHANNEL = "channel" } /** * `NOT` variant is intentionally excluded from public API (internal server-side use only). */ export declare enum NotificationRolesFilterTypeEnum { ALL = "all", ONLY = "only" } declare global { namespace Amity { type UserNotificationModuleName = UserNotificationModuleNameEnum; type CommunityNotificationEventName = CommunityNotificationEventNameEnum; type NotificationRolesFilter = { type: NotificationRolesFilterTypeEnum.ALL; } | { type: NotificationRolesFilterTypeEnum.ONLY; roleIds: string[]; } | { type: 'not'; roleIds: string[]; }; type UserNotificationModule = { moduleName: Amity.UserNotificationModuleName; isEnabled: boolean; rolesFilter?: Amity.NotificationRolesFilter; }; type UserNotificationSettings = { isEnabled: boolean; modules: Amity.UserNotificationModule[]; }; type CommunityNotificationEvent = { eventName: Amity.CommunityNotificationEventName; isEnabled: boolean; /** @readonly Populated by SDK on read. Silently ignored on write. */ isNetworkEnabled?: boolean; rolesFilter?: Amity.NotificationRolesFilter; }; type CommunityNotificationSettings = { isEnabled: boolean; events: Amity.CommunityNotificationEvent[]; }; type ChannelNotificationSettings = { isEnabled: boolean; }; type NotificationEvent = { name: Amity.CommunityNotificationEventName | string; moduleName: Amity.UserNotificationModuleName; eventName: string; isPushNotifiable: boolean; isNetworkEnabled: boolean; listenFromRoleIds: string[]; ignoreFromRoleIds: string[]; }; type NotificationSettings = { isPushNotifiable: boolean; isUserEnabled: boolean; notifiableEvents: Amity.NotificationEvent[]; }; type NotificationEventPayload = { moduleName?: string; name?: string; isPushNotifiable: boolean; listenFromRoleIds?: string[]; }; type NotificationSettingsPayload = { level: NotificationSettingsLevelEnum.USER; isPushNotifiable: boolean; notifiableEvents: NotificationEventPayload[]; } | { level: NotificationSettingsLevelEnum.CHANNEL; channelId: string; isPushNotifiable: boolean; } | { level: NotificationSettingsLevelEnum.COMMUNITY; communityId: string; isPushNotifiable: boolean; notifiableEvents: NotificationEventPayload[]; }; } } //# sourceMappingURL=notificationSettings.d.ts.map