@cometchat/chat-sdk-javascript 4.1.2 → 4.1.3

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
@@ -300,7 +300,7 @@ export class CometChat {
300
300
  };
301
301
  SESSION_ID_REQUIRED: {
302
302
  code: string;
303
- name: string;
303
+ /** @internal */ name: string;
304
304
  message: string;
305
305
  details: {};
306
306
  };
@@ -1087,6 +1087,7 @@ export class CometChat {
1087
1087
  static CometChatHelper: typeof CometChatHelper;
1088
1088
  static Attachment: typeof Attachment;
1089
1089
  static MediaDevice: typeof MediaDevice;
1090
+ static StorageMode: typeof StorageMode;
1090
1091
  static MESSAGE_TYPE: {
1091
1092
  TEXT: string;
1092
1093
  MEDIA: string;
@@ -1216,6 +1217,10 @@ export class CometChat {
1216
1217
  * @memberof CometChat
1217
1218
  */
1218
1219
  static getSessionId(): string;
1220
+ /**
1221
+ * Initialize the storage with the current storage mode from AppSettings
1222
+ */
1223
+ static initializeStorage(): Promise<void>;
1219
1224
  /**
1220
1225
  * Storage event when a key is added/updated in localstorage.
1221
1226
  * @internal
@@ -2947,6 +2952,10 @@ export enum GroupMemberScope {
2947
2952
  Moderator = "moderator",
2948
2953
  Member = "member"
2949
2954
  }
2955
+ export enum StorageMode {
2956
+ LOCAL = "local",
2957
+ SESSION = "session"
2958
+ }
2950
2959
  export const GROUP_MEMBER_SCOPE: {
2951
2960
  ADMIN: string;
2952
2961
  MODERATOR: string;
@@ -5040,6 +5049,10 @@ export class GroupsRequestBuilder {
5040
5049
  }
5041
5050
 
5042
5051
  export class GroupMembersRequest {
5052
+ static USER_STATUS: {
5053
+ ONLINE: string;
5054
+ OFFLINE: string;
5055
+ };
5043
5056
  constructor(builder: GroupMembersRequestBuilder);
5044
5057
  /**
5045
5058
  * Get list of next set of group members based on the parameters specified in GroupMembersRequestBuilder class. The Developer need to call this method repeatedly using the same object of GroupMembersRequest class to get paginated list of group members.
@@ -5071,6 +5084,12 @@ export class GroupMembersRequest {
5071
5084
  * @return {String[]}
5072
5085
  */
5073
5086
  getScopes(): String[];
5087
+ /**
5088
+ * Gets the status filter used to fetch members based on their online or offline status.
5089
+ *
5090
+ * @return {string}
5091
+ */
5092
+ getStatus(): string;
5074
5093
  /**
5075
5094
  * @internal
5076
5095
  */
@@ -5081,6 +5100,7 @@ export class GroupMembersRequestBuilder {
5081
5100
  /** @private */ searchKeyword: string;
5082
5101
  /** @private */ guid: string;
5083
5102
  /** @private */ scopes?: Array<String>;
5103
+ /** @private */ status: string;
5084
5104
  constructor(guid: string);
5085
5105
  /**
5086
5106
  * Set the unique identifier of the group.
@@ -5110,6 +5130,12 @@ export class GroupMembersRequestBuilder {
5110
5130
  * @returns
5111
5131
  */
5112
5132
  setScopes(scopes: Array<String>): this;
5133
+ /**
5134
+ * A method to get the members belonging to a specific status.
5135
+ * @param {string} status
5136
+ * @returns
5137
+ */
5138
+ setStatus(status: string): this;
5113
5139
  /**
5114
5140
  * This method will return an object of the GroupMembersRequest class.
5115
5141
  * @returns {GroupMembersRequest}
@@ -5478,6 +5504,18 @@ export class ConversationsRequest {
5478
5504
  * @returns {boolean}
5479
5505
  */
5480
5506
  getUnread(): boolean;
5507
+ /**
5508
+ * Determines whether agentic conversations should be hidden.
5509
+ *
5510
+ * @returns {boolean}
5511
+ */
5512
+ getHideAgentic(): boolean;
5513
+ /**
5514
+ * Determines whether only agentic conversations should be fetched.
5515
+ *
5516
+ * @returns {boolean}
5517
+ */
5518
+ getOnlyAgentic(): boolean;
5481
5519
  }
5482
5520
  export class ConversationsRequestBuilder {
5483
5521
  /** @private */ conversationType: string;
@@ -5491,6 +5529,8 @@ export class ConversationsRequestBuilder {
5491
5529
  /** @private */ WithBlockedInfo: boolean;
5492
5530
  /** @private */ searchKeyword: string;
5493
5531
  /** @private */ unreadOnly: boolean;
5532
+ /** @private */ hideAgentic: boolean;
5533
+ /** @private */ onlyAgentic: boolean;
5494
5534
  /**
5495
5535
  *
5496
5536
  * @param {number} limit
@@ -5579,6 +5619,18 @@ export class ConversationsRequestBuilder {
5579
5619
  * @returns
5580
5620
  */
5581
5621
  setUnread(unread: boolean): this;
5622
+ /**
5623
+ * A method to hide agentic conversations from the list.
5624
+ * @param {boolean} hideAgentic
5625
+ * @returns
5626
+ */
5627
+ setHideAgentic(hideAgentic: boolean): this;
5628
+ /**
5629
+ * A method to fetch only agentic conversations.
5630
+ * @param {boolean} onlyAgentic
5631
+ * @returns
5632
+ */
5633
+ setOnlyAgentic(onlyAgentic: boolean): this;
5582
5634
  /**
5583
5635
  * This method will return an object of the ConversationsRequest class.
5584
5636
  * @returns {ConversationsRequest}
@@ -6262,6 +6314,10 @@ export class BlockedUsersRequestBuilder {
6262
6314
  build(): BlockedUsersRequest;
6263
6315
  }
6264
6316
 
6317
+ /**
6318
+ *
6319
+ * @module AppSettings
6320
+ */
6265
6321
  export class AppSettings {
6266
6322
  static SUBSCRIPTION_TYPE_NONE: string;
6267
6323
  static SUBSCRIPTION_TYPE_ALL_USERS: string;
@@ -6275,6 +6331,9 @@ export class AppSettings {
6275
6331
  static REGION_IN: string;
6276
6332
  /** @private */
6277
6333
  static REGION_PRIVATE: string;
6334
+ /** Storage modes */
6335
+ static STORAGE_MODE_LOCAL: StorageMode;
6336
+ static STORAGE_MODE_SESSION: StorageMode;
6278
6337
  /** @private */
6279
6338
  subscriptionType: string;
6280
6339
  /** @private */
@@ -6289,6 +6348,8 @@ export class AppSettings {
6289
6348
  adminHost: string;
6290
6349
  /** @private */
6291
6350
  clientHost: string;
6351
+ /** @private */
6352
+ storageMode: StorageMode;
6292
6353
  /**
6293
6354
  * @private
6294
6355
  * @param {AppSettingsBuilder}
@@ -6326,9 +6387,14 @@ export class AppSettings {
6326
6387
  getAdminHost(): string;
6327
6388
  /**
6328
6389
  * This method returns the client host to which the SDK should connect.
6329
- * @returns {boolean}
6390
+ * @returns {string}
6330
6391
  */
6331
6392
  getClientHost(): string;
6393
+ /**
6394
+ * This method returns the storage mode (local or session) set using the `setStorageMode()` of the AppSettingsBuilder.
6395
+ * @returns {StorageMode}
6396
+ */
6397
+ getStorageMode(): StorageMode;
6332
6398
  }
6333
6399
  export class AppSettingsBuilder {
6334
6400
  /** @private */
@@ -6345,6 +6411,8 @@ export class AppSettingsBuilder {
6345
6411
  adminHost: string;
6346
6412
  /** @private */
6347
6413
  clientHost: string;
6414
+ /** @private */
6415
+ storageMode: StorageMode;
6348
6416
  /**
6349
6417
  * A method to subscribe presence for all users.
6350
6418
  * @returns
@@ -6391,6 +6459,13 @@ export class AppSettingsBuilder {
6391
6459
  * @returns
6392
6460
  */
6393
6461
  overrideClientHost(clientHost: string): this;
6462
+ /**
6463
+ * @param {StorageMode} storageMode
6464
+ * This method is used to set the storage mode for the SDK. Default is 'local' (localStorage).
6465
+ * Use 'session' for sessionStorage.
6466
+ * @returns {this}
6467
+ */
6468
+ setStorageMode(storageMode: StorageMode): this;
6394
6469
  /**
6395
6470
  * This method will return an object of the AppSettings class.
6396
6471
  * @returns {AppSettings}