@cometchat/chat-sdk-javascript 4.1.9 → 4.1.11

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 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
- export function init(appId: string): CometChat;
11
- export as namespace CometChat;
12
- export as namespace CometChatNotifications;
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 {
@@ -755,6 +755,7 @@ export class CometChat {
755
755
  KEY_APP_ID: string;
756
756
  KEY_DEVICE_ID: string;
757
757
  KEY_SESSION_ID: string;
758
+ KEY_INTEGRATION_SOURCE: string;
758
759
  KEY_MESSAGE_LISTENER_LIST: string;
759
760
  };
760
761
  static SDKHeader: {
@@ -1070,6 +1071,56 @@ export class CometChat {
1070
1071
  static GroupMembersRequestBuilder: typeof GroupMembersRequestBuilder;
1071
1072
  static BannedMembersRequest: typeof BannedMembersRequest;
1072
1073
  static BannedMembersRequestBuilder: typeof BannedMembersRequestBuilder;
1074
+ static CAMPAIGN_ENDPOINTS: {
1075
+ readonly NOTIFICATION_FEED_LIST: "notificationFeedList";
1076
+ readonly NOTIFICATION_FEED_ITEM: "notificationFeedItem";
1077
+ readonly NOTIFICATION_FEED_UNREAD_COUNT: "notificationFeedUnreadCount";
1078
+ readonly NOTIFICATION_FEED_MARK_DELIVERED: "notificationFeedMarkDelivered";
1079
+ readonly NOTIFICATION_FEED_MARK_READ: "notificationFeedMarkRead";
1080
+ readonly NOTIFICATION_FEED_ENGAGEMENT: "notificationFeedEngagement";
1081
+ readonly PUSH_NOTIFICATION_MARK_DELIVERED: "pushNotificationMarkDelivered";
1082
+ readonly PUSH_NOTIFICATION_MARK_CLICKED: "pushNotificationMarkClicked";
1083
+ readonly NOTIFICATION_CATEGORIES_LIST: "notificationCategoriesList";
1084
+ };
1085
+ static CAMPAIGN_DEFAULTS: {
1086
+ readonly NOTIFICATION_FEED_LIMIT: 20;
1087
+ readonly NOTIFICATION_FEED_MAX_LIMIT: 100;
1088
+ readonly CATEGORIES_LIMIT: 50;
1089
+ readonly CATEGORIES_MAX_LIMIT: 100;
1090
+ };
1091
+ static CAMPAIGN_ERRORS: {
1092
+ readonly FEED_ITEM_NOT_FOUND: "FEED_ITEM_NOT_FOUND";
1093
+ readonly PUSH_NOTIFICATION_NOT_FOUND: "PUSH_NOTIFICATION_NOT_FOUND";
1094
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
1095
+ readonly RATE_LIMITED: "RATE_LIMITED";
1096
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
1097
+ };
1098
+ static CAMPAIGN_PAGINATION: {
1099
+ readonly KEYS: {
1100
+ readonly LIMIT: "limit";
1101
+ readonly CURSOR: "cursor";
1102
+ readonly READ_STATE: "readState";
1103
+ readonly CATEGORY: "templateCategory";
1104
+ readonly CHANNEL_ID: "channelId";
1105
+ readonly TAGS: "tags";
1106
+ readonly TAG_MATCH: "tagMatch";
1107
+ readonly DATE_FROM: "dateFrom";
1108
+ readonly DATE_TO: "dateTo";
1109
+ readonly AFFIX: "affix";
1110
+ };
1111
+ readonly AFFIX: {
1112
+ readonly APPEND: "append";
1113
+ readonly PREPEND: "prepend";
1114
+ };
1115
+ };
1116
+ static NotificationFeedItem: typeof NotificationFeedItem;
1117
+ static NotificationCategory: typeof NotificationCategory;
1118
+ static PushNotification: typeof PushNotification;
1119
+ static NotificationFeedRequest: typeof NotificationFeedRequest;
1120
+ static NotificationFeedRequestBuilder: typeof NotificationFeedRequestBuilder;
1121
+ static NotificationCategoriesRequest: typeof NotificationCategoriesRequest;
1122
+ static NotificationCategoriesRequestBuilder: typeof NotificationCategoriesRequestBuilder;
1123
+ static NotificationFeedListener: typeof NotificationFeedListener;
1073
1124
  static CallSettings: typeof CallSettings;
1074
1125
  static CallSettingsBuilder: typeof CallSettingsBuilder;
1075
1126
  static MainVideoContainerSetting: typeof MainVideoContainerSetting;
@@ -1271,6 +1322,16 @@ export class CometChat {
1271
1322
  * @memberof CometChat
1272
1323
  */
1273
1324
  static init(appId: any, appSettings: AppSettings): Promise<boolean>;
1325
+ /**
1326
+ * Initialize CometChat from a cometchat-settings.json object.
1327
+ * Used by AI agent skills for file-based integration.
1328
+ * Persists integrationSource = "ai-agent" for telemetry attribution.
1329
+ * @internal
1330
+ * @param {CometChatSettings} settings - Parsed cometchat-settings.json object
1331
+ * @returns {Promise<boolean>}
1332
+ * @memberof CometChat
1333
+ */
1334
+ static initFromSettings(settings: CometChatSettings): Promise<boolean>;
1274
1335
  /**
1275
1336
  * Function to check whether CometChat class initialized before.
1276
1337
  * @returns {boolean}
@@ -2119,6 +2180,73 @@ export class CometChat {
2119
2180
  success: boolean;
2120
2181
  message: string;
2121
2182
  }>;
2183
+ /**
2184
+ * Mark a single notification feed item as delivered.
2185
+ * @param {NotificationFeedItem} feedItem - The feed item to mark as delivered
2186
+ * @returns {Promise<void>}
2187
+ */
2188
+ static markFeedItemAsDelivered(feedItem: NotificationFeedItem): Promise<void>;
2189
+ /**
2190
+ * Mark multiple notification feed items as delivered (batch).
2191
+ * Calls the delivered endpoint for each item.
2192
+ * @param {NotificationFeedItem[]} feedItems - Array of feed items to mark as delivered
2193
+ * @returns {Promise<void>}
2194
+ */
2195
+ static markFeedItemsAsDelivered(feedItems: NotificationFeedItem[]): Promise<void>;
2196
+ /**
2197
+ * Mark a single notification feed item as read.
2198
+ * Also stamps deliveredAt if not yet set.
2199
+ * @param {NotificationFeedItem} feedItem - The feed item to mark as read
2200
+ * @returns {Promise<void>}
2201
+ */
2202
+ static markFeedItemAsRead(feedItem: NotificationFeedItem): Promise<void>;
2203
+ /**
2204
+ * Report an engagement event for a notification feed item.
2205
+ * @param {NotificationFeedItem} feedItem - The feed item to report engagement for
2206
+ * @param {string} interactionString - Engagement type (e.g., "delivered", "clicked", or any custom value)
2207
+ * @returns {Promise<void>}
2208
+ */
2209
+ static reportFeedEngagement(feedItem: NotificationFeedItem, interactionString: string): Promise<void>;
2210
+ /**
2211
+ * Get the total unread count for notification feed items.
2212
+ * @returns {Promise<{ count: number }>}
2213
+ */
2214
+ static getNotificationFeedUnreadCount(): Promise<{
2215
+ count: number;
2216
+ }>;
2217
+ /**
2218
+ * Fetch a single notification feed item by ID (for deep linking).
2219
+ * @param {string} id - The feed item ID
2220
+ * @returns {Promise<NotificationFeedItem>}
2221
+ */
2222
+ static getNotificationFeedItem(id: string): Promise<NotificationFeedItem>;
2223
+ /**
2224
+ * Mark a push notification as delivered.
2225
+ * @param {PushNotification} pushNotification - The push notification object
2226
+ * @returns {Promise<void>}
2227
+ */
2228
+ static markPushNotificationDelivered(pushNotification: PushNotification): Promise<void>;
2229
+ /**
2230
+ * Mark a push notification as clicked.
2231
+ * Also stamps deliveredAt if not yet set.
2232
+ * @param {PushNotification} pushNotification - The push notification object
2233
+ * @returns {Promise<void>}
2234
+ */
2235
+ static markPushNotificationClicked(pushNotification: PushNotification): Promise<void>;
2236
+ /**
2237
+ * Register a NotificationFeedListener for real-time notification feed events.
2238
+ * The listener's onFeedItemReceived callback fires when a new feed item arrives via WebSocket.
2239
+ *
2240
+ * @param {string} listenerId - Unique identifier for this listener
2241
+ * @param {NotificationFeedListener} listener - The listener instance
2242
+ */
2243
+ static addNotificationFeedListener(listenerId: string, listener: NotificationFeedListener): void;
2244
+ /**
2245
+ * Remove a previously registered NotificationFeedListener.
2246
+ *
2247
+ * @param {string} listenerId - The listener ID to remove
2248
+ */
2249
+ static removeNotificationFeedListener(listenerId: string): void;
2122
2250
  }
2123
2251
 
2124
2252
  export class CometChatNotifications {
@@ -2241,6 +2369,35 @@ export class CometChatNotifications {
2241
2369
  } | string>;
2242
2370
  }
2243
2371
 
2372
+ /**
2373
+ * Interface representing the shape of the `cometchat-settings.json` file.
2374
+ * Used by the file-based init overload for skills-driven integrations.
2375
+ *
2376
+ * The Chat SDK reads `appId`, `region`, and `chatSDK` fields.
2377
+ * The `credentials`, `callsSDK`, and `uiKit` fields are reserved for other layers.
2378
+ *
2379
+ * @internal
2380
+ * @module CometChatSettings
2381
+ */
2382
+ export interface CometChatSettings {
2383
+ appId: string;
2384
+ region: string;
2385
+ credentials?: {
2386
+ authKey?: string;
2387
+ };
2388
+ chatSDK?: {
2389
+ presenceSubscription?: {
2390
+ type?: string;
2391
+ roles?: string[];
2392
+ };
2393
+ autoEstablishSocketConnection?: boolean;
2394
+ adminHost?: string | null;
2395
+ clientHost?: string | null;
2396
+ };
2397
+ callsSDK?: Record<string, unknown>;
2398
+ uiKit?: Record<string, unknown>;
2399
+ }
2400
+
2244
2401
  /**
2245
2402
  *
2246
2403
  * @module CometChatException
@@ -3044,8 +3201,13 @@ export const LOCAL_STORE: {
3044
3201
  KEY_APP_ID: string;
3045
3202
  KEY_DEVICE_ID: string;
3046
3203
  KEY_SESSION_ID: string;
3204
+ KEY_INTEGRATION_SOURCE: string;
3047
3205
  KEY_MESSAGE_LISTENER_LIST: string;
3048
3206
  };
3207
+ export const INTEGRATION_SOURCE: {
3208
+ AI_AGENT: string;
3209
+ MANUAL: string;
3210
+ };
3049
3211
  export const ResponseConstants: {
3050
3212
  RESPONSE_KEYS: {
3051
3213
  KEY_DATA: string;
@@ -4579,6 +4741,12 @@ export class Call extends BaseMessage implements Message {
4579
4741
  MEDIA: string;
4580
4742
  IMAGE: string;
4581
4743
  VIDEO: string;
4744
+ AUDIO: string;
4745
+ FILE: string;
4746
+ CUSTOM: string;
4747
+ ASSISTANT: string;
4748
+ TOOL_RESULT: string;
4749
+ TOOL_ARGUMENTS: string;
4582
4750
  };
4583
4751
  static readonly RECEIVER_TYPE: {
4584
4752
  USER: string;
@@ -4590,6 +4758,7 @@ export class Call extends BaseMessage implements Message {
4590
4758
  CALL: string;
4591
4759
  CUSTOM: string;
4592
4760
  INTERACTIVE: string;
4761
+ AGENTIC: string;
4593
4762
  };
4594
4763
  static readonly ACTION_TYPE: {
4595
4764
  TYPE_MEMBER_JOINED: string;
@@ -7309,6 +7478,10 @@ export class InteractiveMessage extends BaseMessage implements Message {
7309
7478
  GROUP: string;
7310
7479
  };
7311
7480
  /** @private */ static readonly CATEGORY: {
7481
+ /**
7482
+ * Method to set interaction goal of interactive message.
7483
+ * @param {InteractionGoal} interactionGoal
7484
+ */
7312
7485
  MESSAGE: string;
7313
7486
  ACTION: string;
7314
7487
  CALL: string;
@@ -7316,12 +7489,7 @@ export class InteractiveMessage extends BaseMessage implements Message {
7316
7489
  INTERACTIVE: string;
7317
7490
  AGENTIC: string;
7318
7491
  };
7319
- private interactiveData;
7320
- private interactionGoal;
7321
7492
  protected data?: Object;
7322
- private interactions?;
7323
- private tags?;
7324
- private allowSenderInteraction?;
7325
7493
  constructor(...args: any[]);
7326
7494
  /**
7327
7495
  * Method to get sender of the message.
@@ -7732,6 +7900,379 @@ export class MessageReceipt {
7732
7900
  setReceiptType(receiptType?: string): void;
7733
7901
  }
7734
7902
 
7903
+ /**
7904
+ * @module NotificationFeedItem
7905
+ *
7906
+ * Represents a single notification feed item from the CometChat Campaigns service.
7907
+ * Maps from the backend "Announcement" entity. The backend `subCategory` field
7908
+ * is exposed as `category` to consumers.
7909
+ *
7910
+ * The `content` field contains fully rendered Card_Schema JSON — the SDK does NOT
7911
+ * perform any template fetching or client-side rendering.
7912
+ */
7913
+ export class NotificationFeedItem {
7914
+ /**
7915
+ * Creates an instance of NotificationFeedItem.
7916
+ * @param {Record<string, any>} feedItemJson - Raw JSON from the server response
7917
+ */
7918
+ constructor(feedItemJson: Record<string, any>);
7919
+ /**
7920
+ * Get the unique ID of the feed item.
7921
+ * @returns {string}
7922
+ */
7923
+ getId(): string;
7924
+ /**
7925
+ * Set the unique ID of the feed item.
7926
+ * @param {string} id
7927
+ */
7928
+ setId(id: string): void;
7929
+ /**
7930
+ * Get the category of the feed item (e.g., "promotions", "updates").
7931
+ * @returns {string}
7932
+ */
7933
+ getCategory(): string;
7934
+ /**
7935
+ * Set the category of the feed item.
7936
+ * @param {string} category
7937
+ */
7938
+ setCategory(category: string): void;
7939
+ /**
7940
+ * Get the fully rendered Card_Schema JSON content.
7941
+ * This is ready to be passed to CometChatCardsRenderer.
7942
+ * @returns {Record<string, unknown>}
7943
+ */
7944
+ getContent(): Record<string, unknown>;
7945
+ /**
7946
+ * Set the content of the feed item.
7947
+ * @param {Record<string, unknown>} content
7948
+ */
7949
+ setContent(content: Record<string, unknown>): void;
7950
+ /**
7951
+ * Get the Unix timestamp when the item was read, or null if unread.
7952
+ * @returns {number | null}
7953
+ */
7954
+ getReadAt(): number | null;
7955
+ /**
7956
+ * Set the read timestamp.
7957
+ * @param {number | null} readAt
7958
+ */
7959
+ setReadAt(readAt: number | null): void;
7960
+ /**
7961
+ * Get the Unix timestamp when the item was delivered, or null if not yet delivered.
7962
+ * @returns {number | null}
7963
+ */
7964
+ getDeliveredAt(): number | null;
7965
+ /**
7966
+ * Set the delivered timestamp.
7967
+ * @param {number | null} deliveredAt
7968
+ */
7969
+ setDeliveredAt(deliveredAt: number | null): void;
7970
+ /**
7971
+ * Get the Unix timestamp when the item was sent.
7972
+ * @returns {number}
7973
+ */
7974
+ getSentAt(): number;
7975
+ /**
7976
+ * Set the sent timestamp.
7977
+ * @param {number} sentAt
7978
+ */
7979
+ setSentAt(sentAt: number): void;
7980
+ /**
7981
+ * Get the custom metadata key-value pairs.
7982
+ * @returns {Record<string, any>}
7983
+ */
7984
+ getMetadata(): Record<string, any>;
7985
+ /**
7986
+ * Set the custom metadata.
7987
+ * @param {Record<string, any>} metadata
7988
+ */
7989
+ setMetadata(metadata: Record<string, any>): void;
7990
+ /**
7991
+ * Get the tags associated with this feed item.
7992
+ * @returns {string[]}
7993
+ */
7994
+ getTags(): string[];
7995
+ /**
7996
+ * Set the tags for this feed item.
7997
+ * @param {string[]} tags
7998
+ */
7999
+ setTags(tags: string[]): void;
8000
+ /**
8001
+ * Get the sender of the feed item (typically "server" for campaign items).
8002
+ * @returns {string}
8003
+ */
8004
+ getSender(): string;
8005
+ /**
8006
+ * Set the sender.
8007
+ * @param {string} sender
8008
+ */
8009
+ setSender(sender: string): void;
8010
+ /**
8011
+ * Get the receiver (target user ID).
8012
+ * @returns {string}
8013
+ */
8014
+ getReceiver(): string;
8015
+ /**
8016
+ * Set the receiver.
8017
+ * @param {string} receiver
8018
+ */
8019
+ setReceiver(receiver: string): void;
8020
+ /**
8021
+ * Get the receiver type ("user" in Phase 1).
8022
+ * @returns {string}
8023
+ */
8024
+ getReceiverType(): string;
8025
+ /**
8026
+ * Set the receiver type.
8027
+ * @param {string} receiverType
8028
+ */
8029
+ setReceiverType(receiverType: string): void;
8030
+ /**
8031
+ * Check if the feed item has been read.
8032
+ * @returns {boolean}
8033
+ */
8034
+ getIsRead(): boolean;
8035
+ }
8036
+
8037
+ /**
8038
+ * @module NotificationCategory
8039
+ *
8040
+ * Represents a notification category used for filtering feed items.
8041
+ * Categories are fetched via NotificationCategoriesRequestBuilder and
8042
+ * displayed as filter chips in the UI Kit.
8043
+ */
8044
+ export class NotificationCategory {
8045
+ /**
8046
+ * Creates an instance of NotificationCategory.
8047
+ * @param {Record<string, any>} categoryJson - Raw JSON from the server response
8048
+ */
8049
+ constructor(categoryJson: Record<string, any>);
8050
+ /**
8051
+ * Get the unique identifier of the category.
8052
+ * Used in NotificationFeedRequestBuilder.setCategory() filter.
8053
+ * @returns {string}
8054
+ */
8055
+ getId(): string;
8056
+ /**
8057
+ * Set the category ID.
8058
+ * @param {string} id
8059
+ */
8060
+ setId(id: string): void;
8061
+ /**
8062
+ * Get the display label for the category (used as filter chip text).
8063
+ * @returns {string}
8064
+ */
8065
+ getLabel(): string;
8066
+ /**
8067
+ * Set the display label.
8068
+ * @param {string} label
8069
+ */
8070
+ setLabel(label: string): void;
8071
+ }
8072
+
8073
+ /**
8074
+ * @module PushNotification
8075
+ *
8076
+ * Represents a push notification object from the CometChat Push Notification SDK.
8077
+ * The Chat SDK's markPushNotificationDelivered and markPushNotificationClicked
8078
+ * methods accept this object as-is from the push SDK's payload parsing.
8079
+ *
8080
+ * Note: This object is typically constructed by the CometChat Push Notification SDK
8081
+ * from the APNs/FCM payload — not by the Chat SDK directly.
8082
+ */
8083
+ export class PushNotification {
8084
+ /**
8085
+ * Creates an instance of PushNotification.
8086
+ * @param {Record<string, any>} pushJson - Raw JSON from the push notification payload
8087
+ */
8088
+ constructor(pushJson: Record<string, any>);
8089
+ /**
8090
+ * Get the unique ID of the push notification (announcement ID from push payload).
8091
+ * @returns {string}
8092
+ */
8093
+ getId(): string;
8094
+ /**
8095
+ * Set the push notification ID.
8096
+ * @param {string} id
8097
+ */
8098
+ setId(id: string): void;
8099
+ /**
8100
+ * Get the announcement ID (same as id — for clarity).
8101
+ * @returns {string}
8102
+ */
8103
+ getAnnouncementId(): string;
8104
+ /**
8105
+ * Set the announcement ID.
8106
+ * @param {string} announcementId
8107
+ */
8108
+ setAnnouncementId(announcementId: string): void;
8109
+ /**
8110
+ * Get the campaign ID if this push was sent from a campaign, or null.
8111
+ * @returns {string | null}
8112
+ */
8113
+ getCampaignId(): string | null;
8114
+ /**
8115
+ * Set the campaign ID.
8116
+ * @param {string | null} campaignId
8117
+ */
8118
+ setCampaignId(campaignId: string | null): void;
8119
+ /**
8120
+ * Get the source of the push notification (always "campaign" for notification feed pushes).
8121
+ * @returns {string}
8122
+ */
8123
+ getSource(): string;
8124
+ /**
8125
+ * Set the source.
8126
+ * @param {string} source
8127
+ */
8128
+ setSource(source: string): void;
8129
+ }
8130
+
8131
+ /**
8132
+ * @module NotificationFeedRequest
8133
+ *
8134
+ * Provides NotificationFeedRequestBuilder for constructing paginated, filtered
8135
+ * requests to fetch notification feed items from the campaigns-service.
8136
+ *
8137
+ * Follows the existing CometChat SDK builder pattern (cursor-based pagination, fluent API).
8138
+ */
8139
+ export class NotificationFeedRequest {
8140
+ constructor(builder: NotificationFeedRequestBuilder);
8141
+ /**
8142
+ * Fetches the next page of notification feed items.
8143
+ * Manages cursor internally. When server returns no cursor,
8144
+ * subsequent calls return an empty array without making a network request.
8145
+ *
8146
+ * @returns {Promise<NotificationFeedItem[]>}
8147
+ */
8148
+ fetchNext(): Promise<NotificationFeedItem[]>;
8149
+ }
8150
+ export class NotificationFeedRequestBuilder {
8151
+ /**
8152
+ * Set the number of feed items to fetch per page.
8153
+ * @param {number} limit - Page size (default: 20, max: 100)
8154
+ * @returns {NotificationFeedRequestBuilder}
8155
+ */
8156
+ setLimit(limit: number): NotificationFeedRequestBuilder;
8157
+ /**
8158
+ * Filter feed items by read state.
8159
+ * @param {FeedReadState} state - "read", "unread", or "all"
8160
+ * @returns {NotificationFeedRequestBuilder}
8161
+ */
8162
+ setReadState(state: FeedReadState): NotificationFeedRequestBuilder;
8163
+ /**
8164
+ * Filter feed items by category.
8165
+ * @param {string} category - Category name to filter by
8166
+ * @returns {NotificationFeedRequestBuilder}
8167
+ */
8168
+ setCategory(category: string): NotificationFeedRequestBuilder;
8169
+ /**
8170
+ * Filter feed items by channel ID.
8171
+ * @param {string} channelId - Channel ID to filter by
8172
+ * @returns {NotificationFeedRequestBuilder}
8173
+ */
8174
+ setChannelId(channelId: string): NotificationFeedRequestBuilder;
8175
+ /**
8176
+ * Filter feed items by tags.
8177
+ * @param {string[]} tags - Array of tags to filter by
8178
+ * @returns {NotificationFeedRequestBuilder}
8179
+ */
8180
+ setTags(tags: string[]): NotificationFeedRequestBuilder;
8181
+ /**
8182
+ * Filter feed items sent after this date.
8183
+ * @param {string} date - ISO 8601 date string
8184
+ * @returns {NotificationFeedRequestBuilder}
8185
+ */
8186
+ setDateFrom(date: string): NotificationFeedRequestBuilder;
8187
+ /**
8188
+ * Filter feed items sent before this date.
8189
+ * @param {string} date - ISO 8601 date string
8190
+ * @returns {NotificationFeedRequestBuilder}
8191
+ */
8192
+ setDateTo(date: string): NotificationFeedRequestBuilder;
8193
+ /**
8194
+ * Build the NotificationFeedRequest instance.
8195
+ * Validates the configuration before returning.
8196
+ * @returns {NotificationFeedRequest}
8197
+ */
8198
+ build(): NotificationFeedRequest;
8199
+ /** @internal */
8200
+ getLimit(): number;
8201
+ /** @internal */
8202
+ getReadState(): FeedReadState;
8203
+ /** @internal */
8204
+ getCategoryFilter(): string | null;
8205
+ /** @internal */
8206
+ getChannelId(): string | null;
8207
+ /** @internal */
8208
+ getTagsFilter(): string[] | null;
8209
+ /** @internal */
8210
+ getDateFrom(): string | null;
8211
+ /** @internal */
8212
+ getDateTo(): string | null;
8213
+ }
8214
+
8215
+ /**
8216
+ * @module NotificationCategoriesRequest
8217
+ *
8218
+ * Provides NotificationCategoriesRequestBuilder for fetching available notification
8219
+ * categories from the campaigns-service. Used by the UI Kit to populate category
8220
+ * filter chips.
8221
+ *
8222
+ * Follows the same cursor-based pagination pattern as NotificationFeedRequestBuilder.
8223
+ */
8224
+ export class NotificationCategoriesRequest {
8225
+ constructor(builder: NotificationCategoriesRequestBuilder);
8226
+ /**
8227
+ * Fetches the next page of notification categories.
8228
+ * Manages cursor internally. When server returns no cursor,
8229
+ * subsequent calls return an empty array without making a network request.
8230
+ *
8231
+ * @returns {Promise<NotificationCategory[]>}
8232
+ */
8233
+ fetchNext(): Promise<NotificationCategory[]>;
8234
+ }
8235
+ export class NotificationCategoriesRequestBuilder {
8236
+ /**
8237
+ * Set the number of categories to fetch per page.
8238
+ * @param {number} limit - Page size (default: 50, max: 100)
8239
+ * @returns {NotificationCategoriesRequestBuilder}
8240
+ */
8241
+ setLimit(limit: number): NotificationCategoriesRequestBuilder;
8242
+ /**
8243
+ * Build the NotificationCategoriesRequest instance.
8244
+ * Validates the configuration before returning.
8245
+ * @returns {NotificationCategoriesRequest}
8246
+ */
8247
+ build(): NotificationCategoriesRequest;
8248
+ /** @internal */
8249
+ getLimit(): number;
8250
+ }
8251
+
8252
+ /**
8253
+ * @module NotificationFeedListener
8254
+ *
8255
+ * Listener interface for real-time notification feed events received via WebSocket.
8256
+ * Independent from MessageListener, GroupListener, and CallListener.
8257
+ *
8258
+ * Filters WebSocket messages where type === "notification_feed_item".
8259
+ * Only body.action === "sent" triggers onFeedItemReceived in Phase 1.
8260
+ */
8261
+ export class NotificationFeedListener {
8262
+ /**
8263
+ * Triggered when a new notification feed item is received in real-time.
8264
+ * The feedItem.content is already fully rendered (Card_Schema JSON).
8265
+ */
8266
+ onFeedItemReceived?: (feedItem: NotificationFeedItem) => void;
8267
+ constructor(...args: any[]);
8268
+ }
8269
+ /** @internal */
8270
+ export class NotificationFeedListenerWrapper {
8271
+ _name: string;
8272
+ _eventListener: NotificationFeedListener;
8273
+ constructor(name: string, listener: NotificationFeedListener);
8274
+ }
8275
+
7735
8276
  /**
7736
8277
  *
7737
8278
  * @module AIAssistantMessage
@@ -8551,6 +9092,91 @@ export class RTCUser {
8551
9092
  getResource(): string;
8552
9093
  }
8553
9094
 
9095
+ /**
9096
+ * Campaign API path prefix. Appended after the apiVersion in the gateway URL.
9097
+ * Example: /v3.0/ + campaigns/ + notification-feed
9098
+ */
9099
+ export const CAMPAIGN_PATH_PREFIX = "campaigns";
9100
+ /** GET - Paginated list of notification feed items */
9101
+ export const NOTIFICATION_FEED_LIST = "campaigns/notification-feed";
9102
+ /** GET - Single feed item by ID */
9103
+ export const NOTIFICATION_FEED_ITEM = "campaigns/notification-feed/{{feedItemId}}";
9104
+ /** GET - Unread count (optional ?category= query param) */
9105
+ export const NOTIFICATION_FEED_UNREAD_COUNT = "campaigns/notification-feed/unread-count";
9106
+ /** POST - Mark a feed item as delivered */
9107
+ export const NOTIFICATION_FEED_MARK_DELIVERED = "campaigns/notification-feed/{{feedItemId}}/delivered";
9108
+ /** POST - Mark a feed item as read */
9109
+ export const NOTIFICATION_FEED_MARK_READ = "campaigns/notification-feed/{{feedItemId}}/read";
9110
+ /** POST - Report engagement event (body: { type: "viewed"|"clicked"|"interacted" }) */
9111
+ export const NOTIFICATION_FEED_ENGAGEMENT = "campaigns/notification-feed/{{feedItemId}}/engagement";
9112
+ /** PUT - Mark push notification as delivered */
9113
+ export const PUSH_NOTIFICATION_MARK_DELIVERED = "campaigns/push-notifications/{{pushNotificationId}}/delivered";
9114
+ /** PUT - Mark push notification as clicked */
9115
+ export const PUSH_NOTIFICATION_MARK_CLICKED = "campaigns/push-notifications/{{pushNotificationId}}/clicked";
9116
+ /** GET - List available notification categories (paginated) */
9117
+ export const NOTIFICATION_CATEGORIES_LIST = "campaigns/templates/categories";
9118
+ /** WebSocket message type for notification feed items */
9119
+ export const WS_TYPE_NOTIFICATION_FEED_ITEM = "notification_feed_item";
9120
+ /** WebSocket action: new feed item sent */
9121
+ export const WS_ACTION_SENT = "sent";
9122
+ /** WebSocket action: feed item delivered (future) */
9123
+ export const WS_ACTION_DELIVERED = "delivered";
9124
+ /** WebSocket action: feed item read (future) */
9125
+ export const WS_ACTION_READ = "read";
9126
+ /** WebSocket action: feed item deleted (future) */
9127
+ export const WS_ACTION_DELETED = "deleted";
9128
+ /** Valid read state filter values for NotificationFeedRequestBuilder */
9129
+ export type FeedReadState = "read" | "unread" | "all";
9130
+ /**
9131
+ * Endpoint names used with makeApiCall(). These map to entries in EndpointFactory.
9132
+ */
9133
+ export const CAMPAIGN_ENDPOINTS: {
9134
+ readonly NOTIFICATION_FEED_LIST: "notificationFeedList";
9135
+ readonly NOTIFICATION_FEED_ITEM: "notificationFeedItem";
9136
+ readonly NOTIFICATION_FEED_UNREAD_COUNT: "notificationFeedUnreadCount";
9137
+ readonly NOTIFICATION_FEED_MARK_DELIVERED: "notificationFeedMarkDelivered";
9138
+ readonly NOTIFICATION_FEED_MARK_READ: "notificationFeedMarkRead";
9139
+ readonly NOTIFICATION_FEED_ENGAGEMENT: "notificationFeedEngagement";
9140
+ readonly PUSH_NOTIFICATION_MARK_DELIVERED: "pushNotificationMarkDelivered";
9141
+ readonly PUSH_NOTIFICATION_MARK_CLICKED: "pushNotificationMarkClicked";
9142
+ readonly NOTIFICATION_CATEGORIES_LIST: "notificationCategoriesList";
9143
+ };
9144
+ export const CAMPAIGN_DEFAULTS: {
9145
+ /** Default page size for notification feed requests */
9146
+ readonly NOTIFICATION_FEED_LIMIT: 20;
9147
+ /** Maximum page size for notification feed requests */
9148
+ readonly NOTIFICATION_FEED_MAX_LIMIT: 100;
9149
+ /** Default page size for categories requests */
9150
+ readonly CATEGORIES_LIMIT: 50;
9151
+ /** Maximum page size for categories requests */
9152
+ readonly CATEGORIES_MAX_LIMIT: 100;
9153
+ };
9154
+ export const CAMPAIGN_ERRORS: {
9155
+ readonly FEED_ITEM_NOT_FOUND: "FEED_ITEM_NOT_FOUND";
9156
+ readonly PUSH_NOTIFICATION_NOT_FOUND: "PUSH_NOTIFICATION_NOT_FOUND";
9157
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
9158
+ readonly RATE_LIMITED: "RATE_LIMITED";
9159
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
9160
+ };
9161
+ export const CAMPAIGN_PAGINATION: {
9162
+ readonly KEYS: {
9163
+ readonly LIMIT: "limit";
9164
+ readonly CURSOR: "cursor";
9165
+ readonly READ_STATE: "readState";
9166
+ readonly CATEGORY: "templateCategory";
9167
+ readonly CHANNEL_ID: "channelId";
9168
+ readonly TAGS: "tags";
9169
+ readonly TAG_MATCH: "tagMatch";
9170
+ readonly DATE_FROM: "dateFrom";
9171
+ readonly DATE_TO: "dateTo";
9172
+ readonly AFFIX: "affix";
9173
+ };
9174
+ readonly AFFIX: {
9175
+ readonly APPEND: "append";
9176
+ readonly PREPEND: "prepend";
9177
+ };
9178
+ };
9179
+
8554
9180
  /**
8555
9181
  * Base interface for all assistant event data
8556
9182
  * @internal
@@ -8949,3 +9575,4 @@ export class AIAssistantToolResultEvent extends AIAssistantBaseEvent<AssistantTo
8949
9575
  */
8950
9576
  setRole(role: string): void;
8951
9577
  }
9578
+