quickblox 2.21.0-alpha.2 → 2.21.1

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.
@@ -5,7 +5,26 @@
5
5
  * WebRTC Module (WebRTC signaling provider)
6
6
  */
7
7
 
8
- require('strophe.js');
8
+ // require('strophe.js');
9
+ // Try to load the UMD build that works with Node/CommonJS
10
+ var __stropheMod;
11
+ try {
12
+ __stropheMod = require('strophe.js/dist/strophe.umd.js');
13
+ } catch (e) {
14
+ // Fallback: load default entry if the path above is not available
15
+ __stropheMod = require('strophe.js');
16
+ }
17
+
18
+ // Normalize possible export shapes
19
+ // Strophe can be exported as { Strophe }, default, or the module itself
20
+ var Strophe =
21
+ (__stropheMod && (__stropheMod.Strophe || __stropheMod.default || __stropheMod)) || undefined;
22
+
23
+ // Basic guard: make sure the Connection class exists
24
+ if (!Strophe || !Strophe.Connection) {
25
+ throw new Error('[QBChat] Strophe import failed: Connection class not found');
26
+ }
27
+ // ---------------------------------------------------------------------------
9
28
 
10
29
  var SignalingConstants = require('./qbWebRTCSignalingConstants');
11
30
 
@@ -8,7 +8,26 @@
8
8
  * WebRTC Module (WebRTC signaling processor)
9
9
  */
10
10
 
11
- require('strophe.js');
11
+ // require('strophe.js');
12
+ // Try to load the UMD build that works with Node/CommonJS
13
+ var __stropheMod;
14
+ try {
15
+ __stropheMod = require('strophe.js/dist/strophe.umd.js');
16
+ } catch (e) {
17
+ // Fallback: load default entry if the path above is not available
18
+ __stropheMod = require('strophe.js');
19
+ }
20
+
21
+ // Normalize possible export shapes
22
+ // Strophe can be exported as { Strophe }, default, or the module itself
23
+ var Strophe =
24
+ (__stropheMod && (__stropheMod.Strophe || __stropheMod.default || __stropheMod)) || undefined;
25
+
26
+ // Basic guard: make sure the Connection class exists
27
+ if (!Strophe || !Strophe.Connection) {
28
+ throw new Error('[QBChat] Strophe import failed: Connection class not found');
29
+ }
30
+ // ---------------------------------------------------------------------------
12
31
 
13
32
  var Helpers = require('./qbWebRTCHelpers');
14
33
  var SignalingConstants = require('./qbWebRTCSignalingConstants');
package/src/qbConfig.js CHANGED
@@ -12,8 +12,8 @@
12
12
  */
13
13
 
14
14
  var config = {
15
- version: '2.21.0',
16
- buildNumber: '1167',
15
+ version: '2.21.1-alpha.1',
16
+ buildNumber: '1168',
17
17
  creds: {
18
18
  'appId': 0,
19
19
  'authKey': '',
package/src/qbMain.js CHANGED
@@ -8,11 +8,11 @@
8
8
  */
9
9
  var config = require('./qbConfig');
10
10
  var Utils = require('./qbUtils');
11
- const MessageProxy = require("./modules/chat/qbMessage");
12
- const Chat = require("./modules/chat/qbChat");
13
- const DialogProxy = require("./modules/chat/qbDialog");
14
- const WebRTCClient = require("./modules/webrtc/qbWebRTCClient");
15
- const PushNotifications = require("./modules/qbPushNotifications");
11
+ // const MessageProxy = require("./modules/chat/qbMessage");
12
+ // const Chat = require("./modules/chat/qbChat");
13
+ // const DialogProxy = require("./modules/chat/qbDialog");
14
+ // const WebRTCClient = require("./modules/webrtc/qbWebRTCClient");
15
+ // const PushNotifications = require("./modules/qbPushNotifications");
16
16
 
17
17
  // Actual QuickBlox API starts here
18
18
  function QuickBlox() {}
package/src/qbStrophe.js CHANGED
@@ -7,12 +7,36 @@
7
7
  * Strophe Connection Object
8
8
  */
9
9
 
10
- require('strophe.js');
10
+ // require('strophe.js');
11
+
12
+ // ---- Strophe import (UMD-first with safe fallback) -------------------------
13
+ // Try to load the UMD build that works with Node/CommonJS
14
+ var __stropheMod;
15
+ try {
16
+ __stropheMod = require('strophe.js/dist/strophe.umd.js');
17
+ } catch (e) {
18
+ // Fallback: load default entry if the path above is not available
19
+ __stropheMod = require('strophe.js');
20
+ }
21
+
22
+ // Normalize possible export shapes
23
+ // Strophe can be exported as { Strophe }, default, or the module itself
24
+ var Strophe =
25
+ (__stropheMod && (__stropheMod.Strophe || __stropheMod.default || __stropheMod)) || undefined;
26
+
27
+ // Basic guard: make sure the Connection class exists
28
+ if (!Strophe || !Strophe.Connection) {
29
+ throw new Error('[QBChat] Strophe import failed: Connection class not found');
30
+ }
31
+ // ---------------------------------------------------------------------------
11
32
 
12
33
  var config = require('./qbConfig');
13
34
  var chatPRTCL = config.chatProtocol;
14
35
  var Utils = require('./qbUtils');
15
36
 
37
+
38
+
39
+
16
40
  function Connection(onLogListenerCallback) {
17
41
  var protocol = chatPRTCL.active === 1 ? chatPRTCL.bosh : chatPRTCL.websocket;
18
42
  var conn = new Strophe.Connection(protocol);