@cometchat/chat-sdk-javascript 4.1.2 → 4.1.4

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;
@@ -4991,6 +5000,12 @@ export class GroupsRequest {
4991
5000
  * @return {boolean}
4992
5001
  */
4993
5002
  isWithTags(): boolean;
5003
+ /**
5004
+ * Get the current page number that the request is on.
5005
+ *
5006
+ * @return {number}
5007
+ */
5008
+ getPage(): number;
4994
5009
  }
4995
5010
  export class GroupsRequestBuilder {
4996
5011
  /** @private */ limit: number;
@@ -4998,6 +5013,7 @@ export class GroupsRequestBuilder {
4998
5013
  /** @private */ hasJoined: boolean;
4999
5014
  /** @private */ tags: Array<String>;
5000
5015
  /** @private */ showTags: boolean;
5016
+ /** @private */ page: number;
5001
5017
  /**
5002
5018
  *
5003
5019
  * @param {number} limit
@@ -5032,6 +5048,13 @@ export class GroupsRequestBuilder {
5032
5048
  * @returns
5033
5049
  */
5034
5050
  withTags(withTags: boolean): this;
5051
+ /**
5052
+ *
5053
+ * @param {number} page
5054
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
5055
+ * @returns
5056
+ */
5057
+ setPage(page: number): this;
5035
5058
  /**
5036
5059
  * This method will return an object of the GroupsRequest class.
5037
5060
  * @returns {GroupsRequest}
@@ -5040,6 +5063,10 @@ export class GroupsRequestBuilder {
5040
5063
  }
5041
5064
 
5042
5065
  export class GroupMembersRequest {
5066
+ static USER_STATUS: {
5067
+ ONLINE: string;
5068
+ OFFLINE: string;
5069
+ };
5043
5070
  constructor(builder: GroupMembersRequestBuilder);
5044
5071
  /**
5045
5072
  * 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 +5098,18 @@ export class GroupMembersRequest {
5071
5098
  * @return {String[]}
5072
5099
  */
5073
5100
  getScopes(): String[];
5101
+ /**
5102
+ * Get the current page number that the request is on.
5103
+ *
5104
+ * @return {number}
5105
+ */
5106
+ getPage(): number;
5107
+ /**
5108
+ * Gets the status filter used to fetch members based on their online or offline status.
5109
+ *
5110
+ * @return {string}
5111
+ */
5112
+ getStatus(): string;
5074
5113
  /**
5075
5114
  * @internal
5076
5115
  */
@@ -5081,6 +5120,8 @@ export class GroupMembersRequestBuilder {
5081
5120
  /** @private */ searchKeyword: string;
5082
5121
  /** @private */ guid: string;
5083
5122
  /** @private */ scopes?: Array<String>;
5123
+ /** @private */ page: number;
5124
+ /** @private */ status: string;
5084
5125
  constructor(guid: string);
5085
5126
  /**
5086
5127
  * Set the unique identifier of the group.
@@ -5110,6 +5151,19 @@ export class GroupMembersRequestBuilder {
5110
5151
  * @returns
5111
5152
  */
5112
5153
  setScopes(scopes: Array<String>): this;
5154
+ /**
5155
+ *
5156
+ * @param {number} page
5157
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
5158
+ * @returns
5159
+ */
5160
+ setPage(page: number): this;
5161
+ /**
5162
+ * A method to get the members belonging to a specific status.
5163
+ * @param {string} status
5164
+ * @returns
5165
+ */
5166
+ setStatus(status: string): this;
5113
5167
  /**
5114
5168
  * This method will return an object of the GroupMembersRequest class.
5115
5169
  * @returns {GroupMembersRequest}
@@ -5149,6 +5203,12 @@ export class BannedMembersRequest {
5149
5203
  * @return {String[]}
5150
5204
  */
5151
5205
  getScopes(): String[];
5206
+ /**
5207
+ * Get the current page number that the request is on.
5208
+ *
5209
+ * @return {number}
5210
+ */
5211
+ getPage(): number;
5152
5212
  /**
5153
5213
  * @internal
5154
5214
  */
@@ -5159,6 +5219,7 @@ export class BannedMembersRequestBuilder {
5159
5219
  /** @private */ searchKeyword: string;
5160
5220
  /** @private */ guid: string;
5161
5221
  /** @private */ scopes?: Array<String>;
5222
+ /** @private */ page: number;
5162
5223
  constructor(guid: string);
5163
5224
  /**
5164
5225
  * Set the unique identifier of the group.
@@ -5188,6 +5249,13 @@ export class BannedMembersRequestBuilder {
5188
5249
  * @returns
5189
5250
  */
5190
5251
  setScopes(scopes: Array<String>): this;
5252
+ /**
5253
+ *
5254
+ * @param {number} page
5255
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
5256
+ * @returns
5257
+ */
5258
+ setPage(page: number): this;
5191
5259
  /**
5192
5260
  * This method will return an object of the BannedMembersRequest class.
5193
5261
  * @returns {BannedMembersRequest}
@@ -5285,6 +5353,12 @@ export class UsersRequest {
5285
5353
  * @return {string}
5286
5354
  */
5287
5355
  getSortOrder(): string;
5356
+ /**
5357
+ * Get the current page number that the request is on.
5358
+ *
5359
+ * @return {number}
5360
+ */
5361
+ getPage(): number;
5288
5362
  /**
5289
5363
  * Get list of next set of users based on the parameters specified in UsersRequestBuilder class The Developer need to call this method repeatedly using the same object of UsersRequestBuilder class to get paginated list of users.
5290
5364
  * @returns {Promise<User[] | []>}
@@ -5309,6 +5383,7 @@ export class UsersRequestBuilder {
5309
5383
  /** @private */ SortBy: string;
5310
5384
  /** @private */ SortOrder: string;
5311
5385
  /** @private */ SearchIn: Array<String>;
5386
+ /** @private */ page: number;
5312
5387
  /**
5313
5388
  * A method to set limit for the number of Users returned in a single iteration. A maximum of 100 users can fetched in a single iteration.
5314
5389
  * @param {number} limit
@@ -5394,6 +5469,12 @@ export class UsersRequestBuilder {
5394
5469
  * @returns
5395
5470
  */
5396
5471
  searchIn(searchIn: Array<String>): this;
5472
+ /**
5473
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
5474
+ * @param {number} page
5475
+ * @returns
5476
+ */
5477
+ setPage(page: number): this;
5397
5478
  /**
5398
5479
  * This method will return an object of the UsersRequest class.
5399
5480
  * @returns {UsersRequest}
@@ -5478,6 +5559,24 @@ export class ConversationsRequest {
5478
5559
  * @returns {boolean}
5479
5560
  */
5480
5561
  getUnread(): boolean;
5562
+ /**
5563
+ * Get the current page number that the request is on.
5564
+ *
5565
+ * @return {number}
5566
+ */
5567
+ getPage(): number;
5568
+ /**
5569
+ * Determines whether agentic conversations should be hidden.
5570
+ *
5571
+ * @returns {boolean}
5572
+ */
5573
+ getHideAgentic(): boolean;
5574
+ /**
5575
+ * Determines whether only agentic conversations should be fetched.
5576
+ *
5577
+ * @returns {boolean}
5578
+ */
5579
+ getOnlyAgentic(): boolean;
5481
5580
  }
5482
5581
  export class ConversationsRequestBuilder {
5483
5582
  /** @private */ conversationType: string;
@@ -5491,6 +5590,9 @@ export class ConversationsRequestBuilder {
5491
5590
  /** @private */ WithBlockedInfo: boolean;
5492
5591
  /** @private */ searchKeyword: string;
5493
5592
  /** @private */ unreadOnly: boolean;
5593
+ /** @private */ page: number;
5594
+ /** @private */ hideAgentic: boolean;
5595
+ /** @private */ onlyAgentic: boolean;
5494
5596
  /**
5495
5597
  *
5496
5598
  * @param {number} limit
@@ -5579,6 +5681,24 @@ export class ConversationsRequestBuilder {
5579
5681
  * @returns
5580
5682
  */
5581
5683
  setUnread(unread: boolean): this;
5684
+ /**
5685
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
5686
+ * @param {number} page
5687
+ * @returns
5688
+ */
5689
+ setPage(page: number): this;
5690
+ /**
5691
+ * A method to hide agentic conversations from the list.
5692
+ * @param {boolean} hideAgentic
5693
+ * @returns
5694
+ */
5695
+ setHideAgentic(hideAgentic: boolean): this;
5696
+ /**
5697
+ * A method to fetch only agentic conversations.
5698
+ * @param {boolean} onlyAgentic
5699
+ * @returns
5700
+ */
5701
+ setOnlyAgentic(onlyAgentic: boolean): this;
5582
5702
  /**
5583
5703
  * This method will return an object of the ConversationsRequest class.
5584
5704
  * @returns {ConversationsRequest}
@@ -6223,6 +6343,12 @@ export class BlockedUsersRequest {
6223
6343
  * @return {string}
6224
6344
  */
6225
6345
  getSearchKeyword(): string;
6346
+ /**
6347
+ * Get the current page number that the request is on.
6348
+ *
6349
+ * @return {number}
6350
+ */
6351
+ getPage(): number;
6226
6352
  /** @internal */
6227
6353
  getNextData(): any;
6228
6354
  }
@@ -6230,6 +6356,7 @@ export class BlockedUsersRequestBuilder {
6230
6356
  /** @private */ limit: number;
6231
6357
  /** @private */ searchKeyword: string;
6232
6358
  /** @private */ direction: string;
6359
+ /** @private */ page: number;
6233
6360
  /**
6234
6361
  *
6235
6362
  * @param {number} limit
@@ -6251,6 +6378,13 @@ export class BlockedUsersRequestBuilder {
6251
6378
  * @returns
6252
6379
  */
6253
6380
  setDirection(direction: string): this;
6381
+ /**
6382
+ *
6383
+ * @param {number} page
6384
+ * A method to set the page number to start fetching from. Page 0 will fetch the first page.
6385
+ * @returns
6386
+ */
6387
+ setPage(page: number): this;
6254
6388
  /** @internal */
6255
6389
  blockedByMe(): this;
6256
6390
  /** @internal */
@@ -6262,6 +6396,10 @@ export class BlockedUsersRequestBuilder {
6262
6396
  build(): BlockedUsersRequest;
6263
6397
  }
6264
6398
 
6399
+ /**
6400
+ *
6401
+ * @module AppSettings
6402
+ */
6265
6403
  export class AppSettings {
6266
6404
  static SUBSCRIPTION_TYPE_NONE: string;
6267
6405
  static SUBSCRIPTION_TYPE_ALL_USERS: string;
@@ -6275,6 +6413,9 @@ export class AppSettings {
6275
6413
  static REGION_IN: string;
6276
6414
  /** @private */
6277
6415
  static REGION_PRIVATE: string;
6416
+ /** Storage modes */
6417
+ static STORAGE_MODE_LOCAL: StorageMode;
6418
+ static STORAGE_MODE_SESSION: StorageMode;
6278
6419
  /** @private */
6279
6420
  subscriptionType: string;
6280
6421
  /** @private */
@@ -6289,6 +6430,8 @@ export class AppSettings {
6289
6430
  adminHost: string;
6290
6431
  /** @private */
6291
6432
  clientHost: string;
6433
+ /** @private */
6434
+ storageMode: StorageMode;
6292
6435
  /**
6293
6436
  * @private
6294
6437
  * @param {AppSettingsBuilder}
@@ -6326,9 +6469,14 @@ export class AppSettings {
6326
6469
  getAdminHost(): string;
6327
6470
  /**
6328
6471
  * This method returns the client host to which the SDK should connect.
6329
- * @returns {boolean}
6472
+ * @returns {string}
6330
6473
  */
6331
6474
  getClientHost(): string;
6475
+ /**
6476
+ * This method returns the storage mode (local or session) set using the `setStorageMode()` of the AppSettingsBuilder.
6477
+ * @returns {StorageMode}
6478
+ */
6479
+ getStorageMode(): StorageMode;
6332
6480
  }
6333
6481
  export class AppSettingsBuilder {
6334
6482
  /** @private */
@@ -6345,6 +6493,8 @@ export class AppSettingsBuilder {
6345
6493
  adminHost: string;
6346
6494
  /** @private */
6347
6495
  clientHost: string;
6496
+ /** @private */
6497
+ storageMode: StorageMode;
6348
6498
  /**
6349
6499
  * A method to subscribe presence for all users.
6350
6500
  * @returns
@@ -6391,6 +6541,13 @@ export class AppSettingsBuilder {
6391
6541
  * @returns
6392
6542
  */
6393
6543
  overrideClientHost(clientHost: string): this;
6544
+ /**
6545
+ * @param {StorageMode} storageMode
6546
+ * This method is used to set the storage mode for the SDK. Default is 'local' (localStorage).
6547
+ * Use 'session' for sessionStorage.
6548
+ * @returns {this}
6549
+ */
6550
+ setStorageMode(storageMode: StorageMode): this;
6394
6551
  /**
6395
6552
  * This method will return an object of the AppSettings class.
6396
6553
  * @returns {AppSettings}