@cometchat/chat-sdk-javascript 4.1.9 → 4.1.10
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/CometChat.d.ts +586 -3
- package/CometChat.js +1 -1
- package/package.json +1 -1
package/CometChat.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* @param {string} appId appId generted at the time of perchase. unique for each client.
|
|
8
8
|
* @returns {CometChat}
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export function init(appId: string): CometChat;
|
|
11
|
+
export as namespace CometChat;
|
|
12
|
+
export as namespace CometChatNotifications;
|
|
13
13
|
|
|
14
14
|
export const DEFAULT_TIMEOUT = 45;
|
|
15
15
|
export class CometChat {
|
|
@@ -1070,6 +1070,56 @@ export class CometChat {
|
|
|
1070
1070
|
static GroupMembersRequestBuilder: typeof GroupMembersRequestBuilder;
|
|
1071
1071
|
static BannedMembersRequest: typeof BannedMembersRequest;
|
|
1072
1072
|
static BannedMembersRequestBuilder: typeof BannedMembersRequestBuilder;
|
|
1073
|
+
static CAMPAIGN_ENDPOINTS: {
|
|
1074
|
+
readonly NOTIFICATION_FEED_LIST: "notificationFeedList";
|
|
1075
|
+
readonly NOTIFICATION_FEED_ITEM: "notificationFeedItem";
|
|
1076
|
+
readonly NOTIFICATION_FEED_UNREAD_COUNT: "notificationFeedUnreadCount";
|
|
1077
|
+
readonly NOTIFICATION_FEED_MARK_DELIVERED: "notificationFeedMarkDelivered";
|
|
1078
|
+
readonly NOTIFICATION_FEED_MARK_READ: "notificationFeedMarkRead";
|
|
1079
|
+
readonly NOTIFICATION_FEED_ENGAGEMENT: "notificationFeedEngagement";
|
|
1080
|
+
readonly PUSH_NOTIFICATION_MARK_DELIVERED: "pushNotificationMarkDelivered";
|
|
1081
|
+
readonly PUSH_NOTIFICATION_MARK_CLICKED: "pushNotificationMarkClicked";
|
|
1082
|
+
readonly NOTIFICATION_CATEGORIES_LIST: "notificationCategoriesList";
|
|
1083
|
+
};
|
|
1084
|
+
static CAMPAIGN_DEFAULTS: {
|
|
1085
|
+
readonly NOTIFICATION_FEED_LIMIT: 20;
|
|
1086
|
+
readonly NOTIFICATION_FEED_MAX_LIMIT: 100;
|
|
1087
|
+
readonly CATEGORIES_LIMIT: 50;
|
|
1088
|
+
readonly CATEGORIES_MAX_LIMIT: 100;
|
|
1089
|
+
};
|
|
1090
|
+
static CAMPAIGN_ERRORS: {
|
|
1091
|
+
readonly FEED_ITEM_NOT_FOUND: "FEED_ITEM_NOT_FOUND";
|
|
1092
|
+
readonly PUSH_NOTIFICATION_NOT_FOUND: "PUSH_NOTIFICATION_NOT_FOUND";
|
|
1093
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
1094
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
1095
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
1096
|
+
};
|
|
1097
|
+
static CAMPAIGN_PAGINATION: {
|
|
1098
|
+
readonly KEYS: {
|
|
1099
|
+
readonly LIMIT: "limit";
|
|
1100
|
+
readonly CURSOR: "cursor";
|
|
1101
|
+
readonly READ_STATE: "readState";
|
|
1102
|
+
readonly CATEGORY: "templateCategory";
|
|
1103
|
+
readonly CHANNEL_ID: "channelId";
|
|
1104
|
+
readonly TAGS: "tags";
|
|
1105
|
+
readonly TAG_MATCH: "tagMatch";
|
|
1106
|
+
readonly DATE_FROM: "dateFrom";
|
|
1107
|
+
readonly DATE_TO: "dateTo";
|
|
1108
|
+
readonly AFFIX: "affix";
|
|
1109
|
+
};
|
|
1110
|
+
readonly AFFIX: {
|
|
1111
|
+
readonly APPEND: "append";
|
|
1112
|
+
readonly PREPEND: "prepend";
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
static NotificationFeedItem: typeof NotificationFeedItem;
|
|
1116
|
+
static NotificationCategory: typeof NotificationCategory;
|
|
1117
|
+
static PushNotification: typeof PushNotification;
|
|
1118
|
+
static NotificationFeedRequest: typeof NotificationFeedRequest;
|
|
1119
|
+
static NotificationFeedRequestBuilder: typeof NotificationFeedRequestBuilder;
|
|
1120
|
+
static NotificationCategoriesRequest: typeof NotificationCategoriesRequest;
|
|
1121
|
+
static NotificationCategoriesRequestBuilder: typeof NotificationCategoriesRequestBuilder;
|
|
1122
|
+
static NotificationFeedListener: typeof NotificationFeedListener;
|
|
1073
1123
|
static CallSettings: typeof CallSettings;
|
|
1074
1124
|
static CallSettingsBuilder: typeof CallSettingsBuilder;
|
|
1075
1125
|
static MainVideoContainerSetting: typeof MainVideoContainerSetting;
|
|
@@ -2119,6 +2169,73 @@ export class CometChat {
|
|
|
2119
2169
|
success: boolean;
|
|
2120
2170
|
message: string;
|
|
2121
2171
|
}>;
|
|
2172
|
+
/**
|
|
2173
|
+
* Mark a single notification feed item as delivered.
|
|
2174
|
+
* @param {NotificationFeedItem} feedItem - The feed item to mark as delivered
|
|
2175
|
+
* @returns {Promise<void>}
|
|
2176
|
+
*/
|
|
2177
|
+
static markFeedItemAsDelivered(feedItem: NotificationFeedItem): Promise<void>;
|
|
2178
|
+
/**
|
|
2179
|
+
* Mark multiple notification feed items as delivered (batch).
|
|
2180
|
+
* Calls the delivered endpoint for each item.
|
|
2181
|
+
* @param {NotificationFeedItem[]} feedItems - Array of feed items to mark as delivered
|
|
2182
|
+
* @returns {Promise<void>}
|
|
2183
|
+
*/
|
|
2184
|
+
static markFeedItemsAsDelivered(feedItems: NotificationFeedItem[]): Promise<void>;
|
|
2185
|
+
/**
|
|
2186
|
+
* Mark a single notification feed item as read.
|
|
2187
|
+
* Also stamps deliveredAt if not yet set.
|
|
2188
|
+
* @param {NotificationFeedItem} feedItem - The feed item to mark as read
|
|
2189
|
+
* @returns {Promise<void>}
|
|
2190
|
+
*/
|
|
2191
|
+
static markFeedItemAsRead(feedItem: NotificationFeedItem): Promise<void>;
|
|
2192
|
+
/**
|
|
2193
|
+
* Report an engagement event for a notification feed item.
|
|
2194
|
+
* @param {NotificationFeedItem} feedItem - The feed item to report engagement for
|
|
2195
|
+
* @param {string} interactionString - Engagement type (e.g., "delivered", "clicked", or any custom value)
|
|
2196
|
+
* @returns {Promise<void>}
|
|
2197
|
+
*/
|
|
2198
|
+
static reportFeedEngagement(feedItem: NotificationFeedItem, interactionString: string): Promise<void>;
|
|
2199
|
+
/**
|
|
2200
|
+
* Get the total unread count for notification feed items.
|
|
2201
|
+
* @returns {Promise<{ count: number }>}
|
|
2202
|
+
*/
|
|
2203
|
+
static getNotificationFeedUnreadCount(): Promise<{
|
|
2204
|
+
count: number;
|
|
2205
|
+
}>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Fetch a single notification feed item by ID (for deep linking).
|
|
2208
|
+
* @param {string} id - The feed item ID
|
|
2209
|
+
* @returns {Promise<NotificationFeedItem>}
|
|
2210
|
+
*/
|
|
2211
|
+
static getNotificationFeedItem(id: string): Promise<NotificationFeedItem>;
|
|
2212
|
+
/**
|
|
2213
|
+
* Mark a push notification as delivered.
|
|
2214
|
+
* @param {PushNotification} pushNotification - The push notification object
|
|
2215
|
+
* @returns {Promise<void>}
|
|
2216
|
+
*/
|
|
2217
|
+
static markPushNotificationDelivered(pushNotification: PushNotification): Promise<void>;
|
|
2218
|
+
/**
|
|
2219
|
+
* Mark a push notification as clicked.
|
|
2220
|
+
* Also stamps deliveredAt if not yet set.
|
|
2221
|
+
* @param {PushNotification} pushNotification - The push notification object
|
|
2222
|
+
* @returns {Promise<void>}
|
|
2223
|
+
*/
|
|
2224
|
+
static markPushNotificationClicked(pushNotification: PushNotification): Promise<void>;
|
|
2225
|
+
/**
|
|
2226
|
+
* Register a NotificationFeedListener for real-time notification feed events.
|
|
2227
|
+
* The listener's onFeedItemReceived callback fires when a new feed item arrives via WebSocket.
|
|
2228
|
+
*
|
|
2229
|
+
* @param {string} listenerId - Unique identifier for this listener
|
|
2230
|
+
* @param {NotificationFeedListener} listener - The listener instance
|
|
2231
|
+
*/
|
|
2232
|
+
static addNotificationFeedListener(listenerId: string, listener: NotificationFeedListener): void;
|
|
2233
|
+
/**
|
|
2234
|
+
* Remove a previously registered NotificationFeedListener.
|
|
2235
|
+
*
|
|
2236
|
+
* @param {string} listenerId - The listener ID to remove
|
|
2237
|
+
*/
|
|
2238
|
+
static removeNotificationFeedListener(listenerId: string): void;
|
|
2122
2239
|
}
|
|
2123
2240
|
|
|
2124
2241
|
export class CometChatNotifications {
|
|
@@ -4579,6 +4696,12 @@ export class Call extends BaseMessage implements Message {
|
|
|
4579
4696
|
MEDIA: string;
|
|
4580
4697
|
IMAGE: string;
|
|
4581
4698
|
VIDEO: string;
|
|
4699
|
+
AUDIO: string;
|
|
4700
|
+
FILE: string;
|
|
4701
|
+
CUSTOM: string;
|
|
4702
|
+
ASSISTANT: string;
|
|
4703
|
+
TOOL_RESULT: string;
|
|
4704
|
+
TOOL_ARGUMENTS: string;
|
|
4582
4705
|
};
|
|
4583
4706
|
static readonly RECEIVER_TYPE: {
|
|
4584
4707
|
USER: string;
|
|
@@ -4590,6 +4713,7 @@ export class Call extends BaseMessage implements Message {
|
|
|
4590
4713
|
CALL: string;
|
|
4591
4714
|
CUSTOM: string;
|
|
4592
4715
|
INTERACTIVE: string;
|
|
4716
|
+
AGENTIC: string;
|
|
4593
4717
|
};
|
|
4594
4718
|
static readonly ACTION_TYPE: {
|
|
4595
4719
|
TYPE_MEMBER_JOINED: string;
|
|
@@ -7732,6 +7856,379 @@ export class MessageReceipt {
|
|
|
7732
7856
|
setReceiptType(receiptType?: string): void;
|
|
7733
7857
|
}
|
|
7734
7858
|
|
|
7859
|
+
/**
|
|
7860
|
+
* @module NotificationFeedItem
|
|
7861
|
+
*
|
|
7862
|
+
* Represents a single notification feed item from the CometChat Campaigns service.
|
|
7863
|
+
* Maps from the backend "Announcement" entity. The backend `subCategory` field
|
|
7864
|
+
* is exposed as `category` to consumers.
|
|
7865
|
+
*
|
|
7866
|
+
* The `content` field contains fully rendered Card_Schema JSON — the SDK does NOT
|
|
7867
|
+
* perform any template fetching or client-side rendering.
|
|
7868
|
+
*/
|
|
7869
|
+
export class NotificationFeedItem {
|
|
7870
|
+
/**
|
|
7871
|
+
* Creates an instance of NotificationFeedItem.
|
|
7872
|
+
* @param {Record<string, any>} feedItemJson - Raw JSON from the server response
|
|
7873
|
+
*/
|
|
7874
|
+
constructor(feedItemJson: Record<string, any>);
|
|
7875
|
+
/**
|
|
7876
|
+
* Get the unique ID of the feed item.
|
|
7877
|
+
* @returns {string}
|
|
7878
|
+
*/
|
|
7879
|
+
getId(): string;
|
|
7880
|
+
/**
|
|
7881
|
+
* Set the unique ID of the feed item.
|
|
7882
|
+
* @param {string} id
|
|
7883
|
+
*/
|
|
7884
|
+
setId(id: string): void;
|
|
7885
|
+
/**
|
|
7886
|
+
* Get the category of the feed item (e.g., "promotions", "updates").
|
|
7887
|
+
* @returns {string}
|
|
7888
|
+
*/
|
|
7889
|
+
getCategory(): string;
|
|
7890
|
+
/**
|
|
7891
|
+
* Set the category of the feed item.
|
|
7892
|
+
* @param {string} category
|
|
7893
|
+
*/
|
|
7894
|
+
setCategory(category: string): void;
|
|
7895
|
+
/**
|
|
7896
|
+
* Get the fully rendered Card_Schema JSON content.
|
|
7897
|
+
* This is ready to be passed to CometChatCardsRenderer.
|
|
7898
|
+
* @returns {Record<string, unknown>}
|
|
7899
|
+
*/
|
|
7900
|
+
getContent(): Record<string, unknown>;
|
|
7901
|
+
/**
|
|
7902
|
+
* Set the content of the feed item.
|
|
7903
|
+
* @param {Record<string, unknown>} content
|
|
7904
|
+
*/
|
|
7905
|
+
setContent(content: Record<string, unknown>): void;
|
|
7906
|
+
/**
|
|
7907
|
+
* Get the Unix timestamp when the item was read, or null if unread.
|
|
7908
|
+
* @returns {number | null}
|
|
7909
|
+
*/
|
|
7910
|
+
getReadAt(): number | null;
|
|
7911
|
+
/**
|
|
7912
|
+
* Set the read timestamp.
|
|
7913
|
+
* @param {number | null} readAt
|
|
7914
|
+
*/
|
|
7915
|
+
setReadAt(readAt: number | null): void;
|
|
7916
|
+
/**
|
|
7917
|
+
* Get the Unix timestamp when the item was delivered, or null if not yet delivered.
|
|
7918
|
+
* @returns {number | null}
|
|
7919
|
+
*/
|
|
7920
|
+
getDeliveredAt(): number | null;
|
|
7921
|
+
/**
|
|
7922
|
+
* Set the delivered timestamp.
|
|
7923
|
+
* @param {number | null} deliveredAt
|
|
7924
|
+
*/
|
|
7925
|
+
setDeliveredAt(deliveredAt: number | null): void;
|
|
7926
|
+
/**
|
|
7927
|
+
* Get the Unix timestamp when the item was sent.
|
|
7928
|
+
* @returns {number}
|
|
7929
|
+
*/
|
|
7930
|
+
getSentAt(): number;
|
|
7931
|
+
/**
|
|
7932
|
+
* Set the sent timestamp.
|
|
7933
|
+
* @param {number} sentAt
|
|
7934
|
+
*/
|
|
7935
|
+
setSentAt(sentAt: number): void;
|
|
7936
|
+
/**
|
|
7937
|
+
* Get the custom metadata key-value pairs.
|
|
7938
|
+
* @returns {Record<string, any>}
|
|
7939
|
+
*/
|
|
7940
|
+
getMetadata(): Record<string, any>;
|
|
7941
|
+
/**
|
|
7942
|
+
* Set the custom metadata.
|
|
7943
|
+
* @param {Record<string, any>} metadata
|
|
7944
|
+
*/
|
|
7945
|
+
setMetadata(metadata: Record<string, any>): void;
|
|
7946
|
+
/**
|
|
7947
|
+
* Get the tags associated with this feed item.
|
|
7948
|
+
* @returns {string[]}
|
|
7949
|
+
*/
|
|
7950
|
+
getTags(): string[];
|
|
7951
|
+
/**
|
|
7952
|
+
* Set the tags for this feed item.
|
|
7953
|
+
* @param {string[]} tags
|
|
7954
|
+
*/
|
|
7955
|
+
setTags(tags: string[]): void;
|
|
7956
|
+
/**
|
|
7957
|
+
* Get the sender of the feed item (typically "server" for campaign items).
|
|
7958
|
+
* @returns {string}
|
|
7959
|
+
*/
|
|
7960
|
+
getSender(): string;
|
|
7961
|
+
/**
|
|
7962
|
+
* Set the sender.
|
|
7963
|
+
* @param {string} sender
|
|
7964
|
+
*/
|
|
7965
|
+
setSender(sender: string): void;
|
|
7966
|
+
/**
|
|
7967
|
+
* Get the receiver (target user ID).
|
|
7968
|
+
* @returns {string}
|
|
7969
|
+
*/
|
|
7970
|
+
getReceiver(): string;
|
|
7971
|
+
/**
|
|
7972
|
+
* Set the receiver.
|
|
7973
|
+
* @param {string} receiver
|
|
7974
|
+
*/
|
|
7975
|
+
setReceiver(receiver: string): void;
|
|
7976
|
+
/**
|
|
7977
|
+
* Get the receiver type ("user" in Phase 1).
|
|
7978
|
+
* @returns {string}
|
|
7979
|
+
*/
|
|
7980
|
+
getReceiverType(): string;
|
|
7981
|
+
/**
|
|
7982
|
+
* Set the receiver type.
|
|
7983
|
+
* @param {string} receiverType
|
|
7984
|
+
*/
|
|
7985
|
+
setReceiverType(receiverType: string): void;
|
|
7986
|
+
/**
|
|
7987
|
+
* Check if the feed item has been read.
|
|
7988
|
+
* @returns {boolean}
|
|
7989
|
+
*/
|
|
7990
|
+
getIsRead(): boolean;
|
|
7991
|
+
}
|
|
7992
|
+
|
|
7993
|
+
/**
|
|
7994
|
+
* @module NotificationCategory
|
|
7995
|
+
*
|
|
7996
|
+
* Represents a notification category used for filtering feed items.
|
|
7997
|
+
* Categories are fetched via NotificationCategoriesRequestBuilder and
|
|
7998
|
+
* displayed as filter chips in the UI Kit.
|
|
7999
|
+
*/
|
|
8000
|
+
export class NotificationCategory {
|
|
8001
|
+
/**
|
|
8002
|
+
* Creates an instance of NotificationCategory.
|
|
8003
|
+
* @param {Record<string, any>} categoryJson - Raw JSON from the server response
|
|
8004
|
+
*/
|
|
8005
|
+
constructor(categoryJson: Record<string, any>);
|
|
8006
|
+
/**
|
|
8007
|
+
* Get the unique identifier of the category.
|
|
8008
|
+
* Used in NotificationFeedRequestBuilder.setCategory() filter.
|
|
8009
|
+
* @returns {string}
|
|
8010
|
+
*/
|
|
8011
|
+
getId(): string;
|
|
8012
|
+
/**
|
|
8013
|
+
* Set the category ID.
|
|
8014
|
+
* @param {string} id
|
|
8015
|
+
*/
|
|
8016
|
+
setId(id: string): void;
|
|
8017
|
+
/**
|
|
8018
|
+
* Get the display label for the category (used as filter chip text).
|
|
8019
|
+
* @returns {string}
|
|
8020
|
+
*/
|
|
8021
|
+
getLabel(): string;
|
|
8022
|
+
/**
|
|
8023
|
+
* Set the display label.
|
|
8024
|
+
* @param {string} label
|
|
8025
|
+
*/
|
|
8026
|
+
setLabel(label: string): void;
|
|
8027
|
+
}
|
|
8028
|
+
|
|
8029
|
+
/**
|
|
8030
|
+
* @module PushNotification
|
|
8031
|
+
*
|
|
8032
|
+
* Represents a push notification object from the CometChat Push Notification SDK.
|
|
8033
|
+
* The Chat SDK's markPushNotificationDelivered and markPushNotificationClicked
|
|
8034
|
+
* methods accept this object as-is from the push SDK's payload parsing.
|
|
8035
|
+
*
|
|
8036
|
+
* Note: This object is typically constructed by the CometChat Push Notification SDK
|
|
8037
|
+
* from the APNs/FCM payload — not by the Chat SDK directly.
|
|
8038
|
+
*/
|
|
8039
|
+
export class PushNotification {
|
|
8040
|
+
/**
|
|
8041
|
+
* Creates an instance of PushNotification.
|
|
8042
|
+
* @param {Record<string, any>} pushJson - Raw JSON from the push notification payload
|
|
8043
|
+
*/
|
|
8044
|
+
constructor(pushJson: Record<string, any>);
|
|
8045
|
+
/**
|
|
8046
|
+
* Get the unique ID of the push notification (announcement ID from push payload).
|
|
8047
|
+
* @returns {string}
|
|
8048
|
+
*/
|
|
8049
|
+
getId(): string;
|
|
8050
|
+
/**
|
|
8051
|
+
* Set the push notification ID.
|
|
8052
|
+
* @param {string} id
|
|
8053
|
+
*/
|
|
8054
|
+
setId(id: string): void;
|
|
8055
|
+
/**
|
|
8056
|
+
* Get the announcement ID (same as id — for clarity).
|
|
8057
|
+
* @returns {string}
|
|
8058
|
+
*/
|
|
8059
|
+
getAnnouncementId(): string;
|
|
8060
|
+
/**
|
|
8061
|
+
* Set the announcement ID.
|
|
8062
|
+
* @param {string} announcementId
|
|
8063
|
+
*/
|
|
8064
|
+
setAnnouncementId(announcementId: string): void;
|
|
8065
|
+
/**
|
|
8066
|
+
* Get the campaign ID if this push was sent from a campaign, or null.
|
|
8067
|
+
* @returns {string | null}
|
|
8068
|
+
*/
|
|
8069
|
+
getCampaignId(): string | null;
|
|
8070
|
+
/**
|
|
8071
|
+
* Set the campaign ID.
|
|
8072
|
+
* @param {string | null} campaignId
|
|
8073
|
+
*/
|
|
8074
|
+
setCampaignId(campaignId: string | null): void;
|
|
8075
|
+
/**
|
|
8076
|
+
* Get the source of the push notification (always "campaign" for notification feed pushes).
|
|
8077
|
+
* @returns {string}
|
|
8078
|
+
*/
|
|
8079
|
+
getSource(): string;
|
|
8080
|
+
/**
|
|
8081
|
+
* Set the source.
|
|
8082
|
+
* @param {string} source
|
|
8083
|
+
*/
|
|
8084
|
+
setSource(source: string): void;
|
|
8085
|
+
}
|
|
8086
|
+
|
|
8087
|
+
/**
|
|
8088
|
+
* @module NotificationFeedRequest
|
|
8089
|
+
*
|
|
8090
|
+
* Provides NotificationFeedRequestBuilder for constructing paginated, filtered
|
|
8091
|
+
* requests to fetch notification feed items from the campaigns-service.
|
|
8092
|
+
*
|
|
8093
|
+
* Follows the existing CometChat SDK builder pattern (cursor-based pagination, fluent API).
|
|
8094
|
+
*/
|
|
8095
|
+
export class NotificationFeedRequest {
|
|
8096
|
+
constructor(builder: NotificationFeedRequestBuilder);
|
|
8097
|
+
/**
|
|
8098
|
+
* Fetches the next page of notification feed items.
|
|
8099
|
+
* Manages cursor internally. When server returns no cursor,
|
|
8100
|
+
* subsequent calls return an empty array without making a network request.
|
|
8101
|
+
*
|
|
8102
|
+
* @returns {Promise<NotificationFeedItem[]>}
|
|
8103
|
+
*/
|
|
8104
|
+
fetchNext(): Promise<NotificationFeedItem[]>;
|
|
8105
|
+
}
|
|
8106
|
+
export class NotificationFeedRequestBuilder {
|
|
8107
|
+
/**
|
|
8108
|
+
* Set the number of feed items to fetch per page.
|
|
8109
|
+
* @param {number} limit - Page size (default: 20, max: 100)
|
|
8110
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8111
|
+
*/
|
|
8112
|
+
setLimit(limit: number): NotificationFeedRequestBuilder;
|
|
8113
|
+
/**
|
|
8114
|
+
* Filter feed items by read state.
|
|
8115
|
+
* @param {FeedReadState} state - "read", "unread", or "all"
|
|
8116
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8117
|
+
*/
|
|
8118
|
+
setReadState(state: FeedReadState): NotificationFeedRequestBuilder;
|
|
8119
|
+
/**
|
|
8120
|
+
* Filter feed items by category.
|
|
8121
|
+
* @param {string} category - Category name to filter by
|
|
8122
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8123
|
+
*/
|
|
8124
|
+
setCategory(category: string): NotificationFeedRequestBuilder;
|
|
8125
|
+
/**
|
|
8126
|
+
* Filter feed items by channel ID.
|
|
8127
|
+
* @param {string} channelId - Channel ID to filter by
|
|
8128
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8129
|
+
*/
|
|
8130
|
+
setChannelId(channelId: string): NotificationFeedRequestBuilder;
|
|
8131
|
+
/**
|
|
8132
|
+
* Filter feed items by tags.
|
|
8133
|
+
* @param {string[]} tags - Array of tags to filter by
|
|
8134
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8135
|
+
*/
|
|
8136
|
+
setTags(tags: string[]): NotificationFeedRequestBuilder;
|
|
8137
|
+
/**
|
|
8138
|
+
* Filter feed items sent after this date.
|
|
8139
|
+
* @param {string} date - ISO 8601 date string
|
|
8140
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8141
|
+
*/
|
|
8142
|
+
setDateFrom(date: string): NotificationFeedRequestBuilder;
|
|
8143
|
+
/**
|
|
8144
|
+
* Filter feed items sent before this date.
|
|
8145
|
+
* @param {string} date - ISO 8601 date string
|
|
8146
|
+
* @returns {NotificationFeedRequestBuilder}
|
|
8147
|
+
*/
|
|
8148
|
+
setDateTo(date: string): NotificationFeedRequestBuilder;
|
|
8149
|
+
/**
|
|
8150
|
+
* Build the NotificationFeedRequest instance.
|
|
8151
|
+
* Validates the configuration before returning.
|
|
8152
|
+
* @returns {NotificationFeedRequest}
|
|
8153
|
+
*/
|
|
8154
|
+
build(): NotificationFeedRequest;
|
|
8155
|
+
/** @internal */
|
|
8156
|
+
getLimit(): number;
|
|
8157
|
+
/** @internal */
|
|
8158
|
+
getReadState(): FeedReadState;
|
|
8159
|
+
/** @internal */
|
|
8160
|
+
getCategoryFilter(): string | null;
|
|
8161
|
+
/** @internal */
|
|
8162
|
+
getChannelId(): string | null;
|
|
8163
|
+
/** @internal */
|
|
8164
|
+
getTagsFilter(): string[] | null;
|
|
8165
|
+
/** @internal */
|
|
8166
|
+
getDateFrom(): string | null;
|
|
8167
|
+
/** @internal */
|
|
8168
|
+
getDateTo(): string | null;
|
|
8169
|
+
}
|
|
8170
|
+
|
|
8171
|
+
/**
|
|
8172
|
+
* @module NotificationCategoriesRequest
|
|
8173
|
+
*
|
|
8174
|
+
* Provides NotificationCategoriesRequestBuilder for fetching available notification
|
|
8175
|
+
* categories from the campaigns-service. Used by the UI Kit to populate category
|
|
8176
|
+
* filter chips.
|
|
8177
|
+
*
|
|
8178
|
+
* Follows the same cursor-based pagination pattern as NotificationFeedRequestBuilder.
|
|
8179
|
+
*/
|
|
8180
|
+
export class NotificationCategoriesRequest {
|
|
8181
|
+
constructor(builder: NotificationCategoriesRequestBuilder);
|
|
8182
|
+
/**
|
|
8183
|
+
* Fetches the next page of notification categories.
|
|
8184
|
+
* Manages cursor internally. When server returns no cursor,
|
|
8185
|
+
* subsequent calls return an empty array without making a network request.
|
|
8186
|
+
*
|
|
8187
|
+
* @returns {Promise<NotificationCategory[]>}
|
|
8188
|
+
*/
|
|
8189
|
+
fetchNext(): Promise<NotificationCategory[]>;
|
|
8190
|
+
}
|
|
8191
|
+
export class NotificationCategoriesRequestBuilder {
|
|
8192
|
+
/**
|
|
8193
|
+
* Set the number of categories to fetch per page.
|
|
8194
|
+
* @param {number} limit - Page size (default: 50, max: 100)
|
|
8195
|
+
* @returns {NotificationCategoriesRequestBuilder}
|
|
8196
|
+
*/
|
|
8197
|
+
setLimit(limit: number): NotificationCategoriesRequestBuilder;
|
|
8198
|
+
/**
|
|
8199
|
+
* Build the NotificationCategoriesRequest instance.
|
|
8200
|
+
* Validates the configuration before returning.
|
|
8201
|
+
* @returns {NotificationCategoriesRequest}
|
|
8202
|
+
*/
|
|
8203
|
+
build(): NotificationCategoriesRequest;
|
|
8204
|
+
/** @internal */
|
|
8205
|
+
getLimit(): number;
|
|
8206
|
+
}
|
|
8207
|
+
|
|
8208
|
+
/**
|
|
8209
|
+
* @module NotificationFeedListener
|
|
8210
|
+
*
|
|
8211
|
+
* Listener interface for real-time notification feed events received via WebSocket.
|
|
8212
|
+
* Independent from MessageListener, GroupListener, and CallListener.
|
|
8213
|
+
*
|
|
8214
|
+
* Filters WebSocket messages where type === "notification_feed_item".
|
|
8215
|
+
* Only body.action === "sent" triggers onFeedItemReceived in Phase 1.
|
|
8216
|
+
*/
|
|
8217
|
+
export class NotificationFeedListener {
|
|
8218
|
+
/**
|
|
8219
|
+
* Triggered when a new notification feed item is received in real-time.
|
|
8220
|
+
* The feedItem.content is already fully rendered (Card_Schema JSON).
|
|
8221
|
+
*/
|
|
8222
|
+
onFeedItemReceived?: (feedItem: NotificationFeedItem) => void;
|
|
8223
|
+
constructor(...args: any[]);
|
|
8224
|
+
}
|
|
8225
|
+
/** @internal */
|
|
8226
|
+
export class NotificationFeedListenerWrapper {
|
|
8227
|
+
_name: string;
|
|
8228
|
+
_eventListener: NotificationFeedListener;
|
|
8229
|
+
constructor(name: string, listener: NotificationFeedListener);
|
|
8230
|
+
}
|
|
8231
|
+
|
|
7735
8232
|
/**
|
|
7736
8233
|
*
|
|
7737
8234
|
* @module AIAssistantMessage
|
|
@@ -8551,6 +9048,91 @@ export class RTCUser {
|
|
|
8551
9048
|
getResource(): string;
|
|
8552
9049
|
}
|
|
8553
9050
|
|
|
9051
|
+
/**
|
|
9052
|
+
* Campaign API path prefix. Appended after the apiVersion in the gateway URL.
|
|
9053
|
+
* Example: /v3.0/ + campaigns/ + notification-feed
|
|
9054
|
+
*/
|
|
9055
|
+
export const CAMPAIGN_PATH_PREFIX = "campaigns";
|
|
9056
|
+
/** GET - Paginated list of notification feed items */
|
|
9057
|
+
export const NOTIFICATION_FEED_LIST = "campaigns/notification-feed";
|
|
9058
|
+
/** GET - Single feed item by ID */
|
|
9059
|
+
export const NOTIFICATION_FEED_ITEM = "campaigns/notification-feed/{{feedItemId}}";
|
|
9060
|
+
/** GET - Unread count (optional ?category= query param) */
|
|
9061
|
+
export const NOTIFICATION_FEED_UNREAD_COUNT = "campaigns/notification-feed/unread-count";
|
|
9062
|
+
/** POST - Mark a feed item as delivered */
|
|
9063
|
+
export const NOTIFICATION_FEED_MARK_DELIVERED = "campaigns/notification-feed/{{feedItemId}}/delivered";
|
|
9064
|
+
/** POST - Mark a feed item as read */
|
|
9065
|
+
export const NOTIFICATION_FEED_MARK_READ = "campaigns/notification-feed/{{feedItemId}}/read";
|
|
9066
|
+
/** POST - Report engagement event (body: { type: "viewed"|"clicked"|"interacted" }) */
|
|
9067
|
+
export const NOTIFICATION_FEED_ENGAGEMENT = "campaigns/notification-feed/{{feedItemId}}/engagement";
|
|
9068
|
+
/** PUT - Mark push notification as delivered */
|
|
9069
|
+
export const PUSH_NOTIFICATION_MARK_DELIVERED = "campaigns/push-notifications/{{pushNotificationId}}/delivered";
|
|
9070
|
+
/** PUT - Mark push notification as clicked */
|
|
9071
|
+
export const PUSH_NOTIFICATION_MARK_CLICKED = "campaigns/push-notifications/{{pushNotificationId}}/clicked";
|
|
9072
|
+
/** GET - List available notification categories (paginated) */
|
|
9073
|
+
export const NOTIFICATION_CATEGORIES_LIST = "campaigns/templates/categories";
|
|
9074
|
+
/** WebSocket message type for notification feed items */
|
|
9075
|
+
export const WS_TYPE_NOTIFICATION_FEED_ITEM = "notification_feed_item";
|
|
9076
|
+
/** WebSocket action: new feed item sent */
|
|
9077
|
+
export const WS_ACTION_SENT = "sent";
|
|
9078
|
+
/** WebSocket action: feed item delivered (future) */
|
|
9079
|
+
export const WS_ACTION_DELIVERED = "delivered";
|
|
9080
|
+
/** WebSocket action: feed item read (future) */
|
|
9081
|
+
export const WS_ACTION_READ = "read";
|
|
9082
|
+
/** WebSocket action: feed item deleted (future) */
|
|
9083
|
+
export const WS_ACTION_DELETED = "deleted";
|
|
9084
|
+
/** Valid read state filter values for NotificationFeedRequestBuilder */
|
|
9085
|
+
export type FeedReadState = "read" | "unread" | "all";
|
|
9086
|
+
/**
|
|
9087
|
+
* Endpoint names used with makeApiCall(). These map to entries in EndpointFactory.
|
|
9088
|
+
*/
|
|
9089
|
+
export const CAMPAIGN_ENDPOINTS: {
|
|
9090
|
+
readonly NOTIFICATION_FEED_LIST: "notificationFeedList";
|
|
9091
|
+
readonly NOTIFICATION_FEED_ITEM: "notificationFeedItem";
|
|
9092
|
+
readonly NOTIFICATION_FEED_UNREAD_COUNT: "notificationFeedUnreadCount";
|
|
9093
|
+
readonly NOTIFICATION_FEED_MARK_DELIVERED: "notificationFeedMarkDelivered";
|
|
9094
|
+
readonly NOTIFICATION_FEED_MARK_READ: "notificationFeedMarkRead";
|
|
9095
|
+
readonly NOTIFICATION_FEED_ENGAGEMENT: "notificationFeedEngagement";
|
|
9096
|
+
readonly PUSH_NOTIFICATION_MARK_DELIVERED: "pushNotificationMarkDelivered";
|
|
9097
|
+
readonly PUSH_NOTIFICATION_MARK_CLICKED: "pushNotificationMarkClicked";
|
|
9098
|
+
readonly NOTIFICATION_CATEGORIES_LIST: "notificationCategoriesList";
|
|
9099
|
+
};
|
|
9100
|
+
export const CAMPAIGN_DEFAULTS: {
|
|
9101
|
+
/** Default page size for notification feed requests */
|
|
9102
|
+
readonly NOTIFICATION_FEED_LIMIT: 20;
|
|
9103
|
+
/** Maximum page size for notification feed requests */
|
|
9104
|
+
readonly NOTIFICATION_FEED_MAX_LIMIT: 100;
|
|
9105
|
+
/** Default page size for categories requests */
|
|
9106
|
+
readonly CATEGORIES_LIMIT: 50;
|
|
9107
|
+
/** Maximum page size for categories requests */
|
|
9108
|
+
readonly CATEGORIES_MAX_LIMIT: 100;
|
|
9109
|
+
};
|
|
9110
|
+
export const CAMPAIGN_ERRORS: {
|
|
9111
|
+
readonly FEED_ITEM_NOT_FOUND: "FEED_ITEM_NOT_FOUND";
|
|
9112
|
+
readonly PUSH_NOTIFICATION_NOT_FOUND: "PUSH_NOTIFICATION_NOT_FOUND";
|
|
9113
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
9114
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
9115
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
9116
|
+
};
|
|
9117
|
+
export const CAMPAIGN_PAGINATION: {
|
|
9118
|
+
readonly KEYS: {
|
|
9119
|
+
readonly LIMIT: "limit";
|
|
9120
|
+
readonly CURSOR: "cursor";
|
|
9121
|
+
readonly READ_STATE: "readState";
|
|
9122
|
+
readonly CATEGORY: "templateCategory";
|
|
9123
|
+
readonly CHANNEL_ID: "channelId";
|
|
9124
|
+
readonly TAGS: "tags";
|
|
9125
|
+
readonly TAG_MATCH: "tagMatch";
|
|
9126
|
+
readonly DATE_FROM: "dateFrom";
|
|
9127
|
+
readonly DATE_TO: "dateTo";
|
|
9128
|
+
readonly AFFIX: "affix";
|
|
9129
|
+
};
|
|
9130
|
+
readonly AFFIX: {
|
|
9131
|
+
readonly APPEND: "append";
|
|
9132
|
+
readonly PREPEND: "prepend";
|
|
9133
|
+
};
|
|
9134
|
+
};
|
|
9135
|
+
|
|
8554
9136
|
/**
|
|
8555
9137
|
* Base interface for all assistant event data
|
|
8556
9138
|
* @internal
|
|
@@ -8949,3 +9531,4 @@ export class AIAssistantToolResultEvent extends AIAssistantBaseEvent<AssistantTo
|
|
|
8949
9531
|
*/
|
|
8950
9532
|
setRole(role: string): void;
|
|
8951
9533
|
}
|
|
9534
|
+
|