quickblox 2.22.0-alpha.1 → 2.23.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quickblox",
3
3
  "description": "QuickBlox JavaScript SDK",
4
- "version": "2.22.0-alpha.1",
4
+ "version": "2.23.0",
5
5
  "homepage": "https://quickblox.com/developers/Javascript",
6
6
  "main": "src/qbMain.js",
7
7
  "types": "quickblox.d.ts",
package/quickblox.d.ts CHANGED
@@ -516,6 +516,22 @@ export interface AISummarizeResponse {
516
516
  summary: string;
517
517
  }
518
518
 
519
+ export declare type QBDialogCreateParams = Dictionary<any> & {
520
+ /**
521
+ * Whether join is required for group dialog (type=2 only):
522
+ * 0 – join not required (default)
523
+ * 1 – join required
524
+ *
525
+ * Optional: if not provided, server will use default behavior (0).
526
+ * Applies only to GROUP dialogs (type=2).
527
+ * Private dialogs (type=3) cannot have is_join_required=1.
528
+ * Public group dialogs (type=1) always have is_join_required=1.
529
+ *
530
+ * @see https://docs.quickblox.com/reference/create-dialog
531
+ */
532
+ is_join_required?: 0 | 1
533
+ }
534
+
519
535
  interface QBAIModule{
520
536
  //QB.ai.answerAssist
521
537
  answerAssist(smartChatAssistantId: string,
@@ -688,7 +704,7 @@ interface QBChatModule {
688
704
  * Create new dialog
689
705
  * ([read more](https://docs.quickblox.com/docs/js-chat-dialogs#create-dialog)).
690
706
  */
691
- create(params: Dictionary<any>, callback: QBCallback<QBChatDialog>): void
707
+ create(params: QBDialogCreateParams, callback: QBCallback<QBChatDialog>): void
692
708
  /**
693
709
  * Delete a dialog or dialogs
694
710
  * ([read more](https://docs.quickblox.com/docs/js-chat-dialogs#delete-dialog)).
@@ -697,7 +713,7 @@ interface QBChatModule {
697
713
  id: QBChatDialog['_id'] | Array<QBChatDialog['_id']>,
698
714
  params: { force: 1 },
699
715
  callback: QBCallback<any>,
700
- )
716
+ ): void
701
717
  /**
702
718
  * Delete a dialog or dialogs
703
719
  * ([read more](https://docs.quickblox.com/docs/js-chat-dialogs#delete-dialog)).
@@ -705,7 +721,7 @@ interface QBChatModule {
705
721
  delete(
706
722
  id: QBChatDialog['_id'] | Array<QBChatDialog['_id']>,
707
723
  callback: QBCallback<any>,
708
- )
724
+ ): void
709
725
  /**
710
726
  * Retrieve list of dialogs
711
727
  * ([read more](https://docs.quickblox.com/docs/js-chat-dialogs#retrieve-list-of-dialogs)).
@@ -1707,7 +1723,7 @@ export class QuickBlox {
1707
1723
  startSessionWithToken(
1708
1724
  token: string,
1709
1725
  callback: QBCallback<{ session: QBSession }>,
1710
- )
1726
+ ): void
1711
1727
 
1712
1728
  /**
1713
1729
  * Destroy current session
package/quickblox.js CHANGED
@@ -33729,6 +33729,14 @@ var qbChatHelpers = {
33729
33729
  delete extension.moduleIdentifier;
33730
33730
  }
33731
33731
 
33732
+ if (extension.date_sent) {
33733
+ var parsedDateSent = Number(extension.date_sent);
33734
+
33735
+ if (Number.isFinite(parsedDateSent)) {
33736
+ extension.date_sent = Math.trunc(parsedDateSent).toString();
33737
+ }
33738
+ }
33739
+
33732
33740
  return {
33733
33741
  extension: extension,
33734
33742
  dialogId: dialogId
@@ -33819,6 +33827,14 @@ DialogProxy.prototype = {
33819
33827
  params.occupants_ids = params.occupants_ids.join(', ');
33820
33828
  }
33821
33829
 
33830
+ if (params && params.is_join_required !== undefined && params.is_join_required !== null) {
33831
+ if (params.is_join_required !== 0 && params.is_join_required !== 1) {
33832
+ Utils.QBLog('[QBChat]', 'Warning: is_join_required must be 0 or 1, got: ' +
33833
+ params.is_join_required + '. Parameter ignored.');
33834
+ delete params.is_join_required;
33835
+ }
33836
+ }
33837
+
33822
33838
  this.service.ajax({
33823
33839
  url: Utils.getUrl(DIALOGS_API_URL),
33824
33840
  type: 'POST',
@@ -33841,6 +33857,11 @@ DialogProxy.prototype = {
33841
33857
  * @callback updateDialogCallback
33842
33858
  * */
33843
33859
 
33860
+ if (params && params.is_join_required !== undefined) {
33861
+ Utils.QBLog('[QBChat]', 'Warning: is_join_required is not supported in dialog.update(). Parameter ignored.');
33862
+ delete params.is_join_required;
33863
+ }
33864
+
33844
33865
  this.service.ajax({
33845
33866
  'url': Utils.getUrl(DIALOGS_API_URL, id),
33846
33867
  'type': 'PUT',
@@ -39410,8 +39431,8 @@ module.exports = StreamManagement;
39410
39431
  */
39411
39432
 
39412
39433
  var config = {
39413
- version: '2.22.0',
39414
- buildNumber: '1176',
39434
+ version: '2.23.0',
39435
+ buildNumber: '1178',
39415
39436
  creds: {
39416
39437
  'appId': 0,
39417
39438
  'authKey': '',