quickblox 2.17.2-logger → 2.17.4-logger

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.
Files changed (121) hide show
  1. package/package.json +1 -2
  2. package/quickblox.js +36571 -38627
  3. package/quickblox.min.js +1 -1
  4. package/src/libs/strophe/strophe.common.js +6668 -0
  5. package/src/libs/strophe/strophe.esm.js +6660 -0
  6. package/src/libs/strophe/strophe.umd.js +6873 -0
  7. package/src/libs/strophe/strophe.umd.min.js +1 -0
  8. package/src/modules/chat/qbChat.js +9 -0
  9. package/src/modules/webrtc/qbWebRTCSignalingProcessor.js +2 -1
  10. package/src/modules/webrtc/qbWebRTCSignalingProvider.js +2 -2
  11. package/src/qbConfig.js +1 -1
  12. package/src/qbStrophe.js +2 -1
  13. package/strophejs-1.4.0/.eslintrc.json +264 -0
  14. package/strophejs-1.4.0/.gitattributes +1 -0
  15. package/strophejs-1.4.0/CHANGELOG.md +250 -0
  16. package/strophejs-1.4.0/LICENSE.txt +19 -0
  17. package/strophejs-1.4.0/Makefile +92 -0
  18. package/strophejs-1.4.0/README.md +45 -0
  19. package/strophejs-1.4.0/RELEASE_CHECKLIST.md +16 -0
  20. package/strophejs-1.4.0/contrib/discojs/README.txt +42 -0
  21. package/strophejs-1.4.0/contrib/discojs/css/disco.css +16 -0
  22. package/strophejs-1.4.0/contrib/discojs/index.html +47 -0
  23. package/strophejs-1.4.0/contrib/discojs/punjab.tac +18 -0
  24. package/strophejs-1.4.0/contrib/discojs/scripts/basic.js +102 -0
  25. package/strophejs-1.4.0/contrib/discojs/scripts/disco.js +60 -0
  26. package/strophejs-1.4.0/docs.css +797 -0
  27. package/strophejs-1.4.0/examples/amd.html +21 -0
  28. package/strophejs-1.4.0/examples/attach/README +37 -0
  29. package/strophejs-1.4.0/examples/attach/__init__.py +0 -0
  30. package/strophejs-1.4.0/examples/attach/attacher/__init__.py +0 -0
  31. package/strophejs-1.4.0/examples/attach/attacher/views.py +18 -0
  32. package/strophejs-1.4.0/examples/attach/boshclient.py +158 -0
  33. package/strophejs-1.4.0/examples/attach/manage.py +11 -0
  34. package/strophejs-1.4.0/examples/attach/settings.py +85 -0
  35. package/strophejs-1.4.0/examples/attach/templates/attacher/index.html +88 -0
  36. package/strophejs-1.4.0/examples/attach/urls.py +19 -0
  37. package/strophejs-1.4.0/examples/basic.html +23 -0
  38. package/strophejs-1.4.0/examples/basic.js +73 -0
  39. package/strophejs-1.4.0/examples/echobot.html +25 -0
  40. package/strophejs-1.4.0/examples/echobot.js +79 -0
  41. package/strophejs-1.4.0/examples/main.js +59 -0
  42. package/strophejs-1.4.0/examples/prebind.html +39 -0
  43. package/strophejs-1.4.0/examples/prebind.js +103 -0
  44. package/strophejs-1.4.0/examples/restore.html +24 -0
  45. package/strophejs-1.4.0/examples/restore.js +71 -0
  46. package/strophejs-1.4.0/package-lock.json +8634 -0
  47. package/strophejs-1.4.0/package.json +84 -0
  48. package/strophejs-1.4.0/rollup.config.js +76 -0
  49. package/strophejs-1.4.0/src/bosh.js +916 -0
  50. package/strophejs-1.4.0/src/core.js +3535 -0
  51. package/strophejs-1.4.0/src/md5.js +204 -0
  52. package/strophejs-1.4.0/src/sha1.js +172 -0
  53. package/strophejs-1.4.0/src/shared-connection-worker.js +114 -0
  54. package/strophejs-1.4.0/src/shims.js +123 -0
  55. package/strophejs-1.4.0/src/strophe.js +14 -0
  56. package/strophejs-1.4.0/src/utils.js +63 -0
  57. package/strophejs-1.4.0/src/websocket.js +561 -0
  58. package/strophejs-1.4.0/src/worker-websocket.js +152 -0
  59. package/strophejs-1.4.0/tests/index.html +21 -0
  60. package/strophejs-1.4.0/tests/main.js +49 -0
  61. package/strophejs-1.4.0/tests/tests.js +929 -0
  62. package/strophejs-1.6.1/.eslintrc.json +264 -0
  63. package/strophejs-1.6.1/.gitattributes +1 -0
  64. package/strophejs-1.6.1/.nvmrc +1 -0
  65. package/strophejs-1.6.1/CHANGELOG.md +288 -0
  66. package/strophejs-1.6.1/LICENSE.txt +19 -0
  67. package/strophejs-1.6.1/Makefile +92 -0
  68. package/strophejs-1.6.1/README.md +46 -0
  69. package/strophejs-1.6.1/RELEASE_CHECKLIST.md +18 -0
  70. package/strophejs-1.6.1/babel.config.json +10 -0
  71. package/strophejs-1.6.1/contrib/discojs/README.txt +42 -0
  72. package/strophejs-1.6.1/contrib/discojs/css/disco.css +16 -0
  73. package/strophejs-1.6.1/contrib/discojs/index.html +47 -0
  74. package/strophejs-1.6.1/contrib/discojs/punjab.tac +18 -0
  75. package/strophejs-1.6.1/contrib/discojs/scripts/basic.js +102 -0
  76. package/strophejs-1.6.1/contrib/discojs/scripts/disco.js +60 -0
  77. package/strophejs-1.6.1/docs.css +797 -0
  78. package/strophejs-1.6.1/examples/amd.html +21 -0
  79. package/strophejs-1.6.1/examples/attach/README +37 -0
  80. package/strophejs-1.6.1/examples/attach/__init__.py +0 -0
  81. package/strophejs-1.6.1/examples/attach/attacher/__init__.py +0 -0
  82. package/strophejs-1.6.1/examples/attach/attacher/views.py +18 -0
  83. package/strophejs-1.6.1/examples/attach/boshclient.py +158 -0
  84. package/strophejs-1.6.1/examples/attach/manage.py +11 -0
  85. package/strophejs-1.6.1/examples/attach/settings.py +85 -0
  86. package/strophejs-1.6.1/examples/attach/templates/attacher/index.html +88 -0
  87. package/strophejs-1.6.1/examples/attach/urls.py +19 -0
  88. package/strophejs-1.6.1/examples/basic.html +23 -0
  89. package/strophejs-1.6.1/examples/basic.js +73 -0
  90. package/strophejs-1.6.1/examples/echobot.html +25 -0
  91. package/strophejs-1.6.1/examples/echobot.js +79 -0
  92. package/strophejs-1.6.1/examples/main.js +59 -0
  93. package/strophejs-1.6.1/examples/prebind.html +39 -0
  94. package/strophejs-1.6.1/examples/prebind.js +103 -0
  95. package/strophejs-1.6.1/examples/restore.html +24 -0
  96. package/strophejs-1.6.1/examples/restore.js +71 -0
  97. package/strophejs-1.6.1/package-lock.json +18461 -0
  98. package/strophejs-1.6.1/package.json +87 -0
  99. package/strophejs-1.6.1/rollup.config.js +70 -0
  100. package/strophejs-1.6.1/src/bosh.js +916 -0
  101. package/strophejs-1.6.1/src/builder.js +239 -0
  102. package/strophejs-1.6.1/src/constants.js +155 -0
  103. package/strophejs-1.6.1/src/core.js +2377 -0
  104. package/strophejs-1.6.1/src/sasl-anon.js +17 -0
  105. package/strophejs-1.6.1/src/sasl-external.js +27 -0
  106. package/strophejs-1.6.1/src/sasl-oauthbearer.js +30 -0
  107. package/strophejs-1.6.1/src/sasl-plain.js +32 -0
  108. package/strophejs-1.6.1/src/sasl-sha1.js +24 -0
  109. package/strophejs-1.6.1/src/sasl-sha256.js +24 -0
  110. package/strophejs-1.6.1/src/sasl-sha384.js +24 -0
  111. package/strophejs-1.6.1/src/sasl-sha512.js +24 -0
  112. package/strophejs-1.6.1/src/sasl-xoauth2.js +27 -0
  113. package/strophejs-1.6.1/src/sasl.js +143 -0
  114. package/strophejs-1.6.1/src/scram.js +182 -0
  115. package/strophejs-1.6.1/src/shared-connection-worker.js +114 -0
  116. package/strophejs-1.6.1/src/shims.js +122 -0
  117. package/strophejs-1.6.1/src/strophe.js +15 -0
  118. package/strophejs-1.6.1/src/utils.js +626 -0
  119. package/strophejs-1.6.1/src/websocket.js +556 -0
  120. package/strophejs-1.6.1/src/worker-websocket.js +149 -0
  121. package/strophejs-1.6.1/tests.js +993 -0
@@ -0,0 +1,152 @@
1
+ /*
2
+ This program is distributed under the terms of the MIT license.
3
+ Please see the LICENSE file for details.
4
+
5
+ Copyright 2020, JC Brand
6
+ */
7
+
8
+ import './websocket.js';
9
+ import { $build, Strophe } from './core.js';
10
+
11
+ const lmap = {};
12
+ lmap['debug'] = Strophe.LogLevel.DEBUG;
13
+ lmap['info'] = Strophe.LogLevel.INFO;
14
+ lmap['warn'] = Strophe.LogLevel.WARN;
15
+ lmap['error'] = Strophe.LogLevel.ERROR;
16
+ lmap['fatal'] = Strophe.LogLevel.FATAL;
17
+
18
+
19
+ /** Class: Strophe.WorkerWebsocket
20
+ * _Private_ helper class that handles a websocket connection inside a shared worker.
21
+ */
22
+ Strophe.WorkerWebsocket = class WorkerWebsocket extends Strophe.Websocket {
23
+
24
+ /** PrivateConstructor: Strophe.WorkerWebsocket
25
+ * Create and initialize a Strophe.WorkerWebsocket object.
26
+ *
27
+ * Parameters:
28
+ * (Strophe.Connection) connection - The Strophe.Connection
29
+ *
30
+ * Returns:
31
+ * A new Strophe.WorkerWebsocket object.
32
+ */
33
+ constructor (connection) {
34
+ super(connection);
35
+ this._conn = connection;
36
+ this.worker = new SharedWorker(this._conn.options.worker, 'Strophe XMPP Connection');
37
+ this.worker.onerror = (e) => {
38
+ console?.error(e);
39
+ Strophe.log(Strophe.LogLevel.ERROR, `Shared Worker Error: ${e}`);
40
+ }
41
+ }
42
+
43
+ get socket () {
44
+ return {
45
+ 'send': str => this.worker.port.postMessage(['send', str])
46
+ }
47
+ }
48
+
49
+ _connect () {
50
+ this._messageHandler = (m) => this._onInitialMessage(m);
51
+ this.worker.port.start();
52
+ this.worker.port.onmessage = (ev) => this._onWorkerMessage(ev);
53
+ this.worker.port.postMessage(['_connect', this._conn.service, this._conn.jid]);
54
+ if (this._conn.clientLogger) this._conn.clientLogger('_connect method was called with WebSocket worker protocol');
55
+ }
56
+
57
+ _attach (callback) {
58
+ this._messageHandler = (m) => this._onMessage(m);
59
+ this._conn.connect_callback = callback;
60
+ this.worker.port.start();
61
+ this.worker.port.onmessage = (ev) => this._onWorkerMessage(ev);
62
+ this.worker.port.postMessage(['_attach', this._conn.service]);
63
+ }
64
+
65
+ _attachCallback (status, jid) {
66
+ if (status === Strophe.Status.ATTACHED) {
67
+ this._conn.jid = jid;
68
+ this._conn.authenticated = true;
69
+ this._conn.connected = true;
70
+ this._conn.restored = true;
71
+ this._conn._changeConnectStatus(Strophe.Status.ATTACHED);
72
+ } else if (status === Strophe.Status.ATTACHFAIL) {
73
+ this._conn.authenticated = false;
74
+ this._conn.connected = false;
75
+ this._conn.restored = false;
76
+ this._conn._changeConnectStatus(Strophe.Status.ATTACHFAIL);
77
+ }
78
+ }
79
+
80
+ _disconnect (readyState, pres) {
81
+ pres && this._conn.send(pres);
82
+ const close = $build("close", { "xmlns": Strophe.NS.FRAMING });
83
+ this._conn.xmlOutput(close.tree());
84
+ const closeString = Strophe.serialize(close);
85
+ this._conn.rawOutput(closeString);
86
+ this.worker.port.postMessage(['send', closeString]);
87
+ this._conn._doDisconnect();
88
+ }
89
+
90
+ _onClose (e) {
91
+ if (this._conn.connected && !this._conn.disconnecting) {
92
+ Strophe.error("Websocket closed unexpectedly");
93
+ if (this._conn.clientLogger) this._conn.clientLogger("Websocket closed unexpectedly");
94
+ this._conn._doDisconnect();
95
+ } else if (e && e.code === 1006 && !this._conn.connected) {
96
+ // in case the onError callback was not called (Safari 10 does not
97
+ // call onerror when the initial connection fails) we need to
98
+ // dispatch a CONNFAIL status update to be consistent with the
99
+ // behavior on other browsers.
100
+ Strophe.error("Websocket closed unexcectedly");
101
+ if (this._conn.clientLogger) this._conn.clientLogger("Websocket closed unexpectedly");
102
+ this._conn._changeConnectStatus(
103
+ Strophe.Status.CONNFAIL,
104
+ "The WebSocket connection could not be established or was disconnected."
105
+ );
106
+ this._conn._doDisconnect();
107
+ } else {
108
+ Strophe.debug("Websocket closed");
109
+ }
110
+ }
111
+
112
+ _closeSocket () {
113
+ this.worker.port.postMessage(['_closeSocket']);
114
+ }
115
+
116
+ /** PrivateFunction: _replaceMessageHandler
117
+ *
118
+ * Called by _onInitialMessage in order to replace itself with the general message handler.
119
+ * This method is overridden by Strophe.WorkerWebsocket, which manages a
120
+ * websocket connection via a service worker and doesn't have direct access
121
+ * to the socket.
122
+ */
123
+ _replaceMessageHandler () {
124
+ this._messageHandler = (m) => this._onMessage(m);
125
+ }
126
+
127
+ /** PrivateFunction: _onWorkerMessage
128
+ * _Private_ function that handles messages received from the service worker
129
+ */
130
+ _onWorkerMessage (ev) {
131
+ const { data } = ev;
132
+ const method_name = data[0];
133
+ if (method_name === '_onMessage') {
134
+ this._messageHandler(data[1]);
135
+ } else if (method_name in this) {
136
+ try {
137
+ this[method_name].apply(this, ev.data.slice(1));
138
+ } catch (e) {
139
+ Strophe.log(Strophe.LogLevel.ERROR, e);
140
+ }
141
+ } else if (method_name === 'log') {
142
+ const level = data[1];
143
+ const msg = data[2]
144
+ Strophe.log(lmap[level], msg);
145
+ } else {
146
+ Strophe.log(
147
+ Strophe.LogLevel.ERROR,
148
+ `Found unhandled service worker message: ${data}`
149
+ );
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" type="text/css">
5
+ <title>Strophe.js Tests</title>
6
+ </head>
7
+ <body>
8
+ <h1 id="qunit-header">Strophe.js Tests</h1>
9
+ <h2 id="qunit-banner"></h2>
10
+ <h2 id="qunit-userAgent"></h2>
11
+ <div id="qunit"></div>
12
+ <div id="qunit-fixture"></div>
13
+ <ol id="qunit-tests"></ol>
14
+ <div id="main"></div>
15
+ <div id="qunit-testresult"></div>
16
+ <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
17
+ <script>QUnit.config.autostart = false;</script>
18
+ <!-- <script src="../main.js"></script> -->
19
+ <script src="../node_modules/requirejs/require.js" data-main="main.js"></script>
20
+ </body>
21
+ </html>
@@ -0,0 +1,49 @@
1
+ require.config({
2
+ baseUrl: '../',
3
+ paths: {
4
+ "strophe": "dist/strophe.umd",
5
+
6
+ // Examples
7
+ "basic": "examples/basic",
8
+
9
+ // Tests
10
+ "jquery": "node_modules/jquery/dist/jquery",
11
+ "sinon": "node_modules/sinon/pkg/sinon",
12
+ "sinon-qunit": "node_modules/sinon-qunit/lib/sinon-qunit",
13
+ "tests": "tests/tests"
14
+ },
15
+
16
+ shim: {
17
+ 'sinon-qunit': { deps: ['sinon']}
18
+ }
19
+ });
20
+
21
+ require(["tests", "strophe"], function (tests, Strophe) {
22
+ window.Strophe = Strophe;
23
+
24
+ QUnit.done(function (details) {
25
+ console.log("Total: "+details.total+" Failed: "+details.failed+" Passed: "+details.passed+" Runtime: "+details.runtime);
26
+ console.log("All tests completed!");
27
+ });
28
+
29
+ QUnit.testDone(function (details) {
30
+ var result = {
31
+ "Module name": details.module,
32
+ "Test name": details.name,
33
+ "Assertions": {
34
+ "Total": details.total,
35
+ "Passed": details.passed,
36
+ "Failed": details.failed
37
+ },
38
+ "Skipped": details.skipped,
39
+ "Todo": details.todo,
40
+ "Runtime": details.runtime
41
+ };
42
+ console.log(JSON.stringify(result, null, 2));
43
+ });
44
+
45
+ QUnit.start();
46
+ QUnit.begin(function (details) {
47
+ tests.run();
48
+ });
49
+ });