quickblox 2.17.2-beta.2-logger → 2.17.3-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.
- package/LICENSE +330 -201
- package/README.md +2 -2
- package/package.json +1 -2
- package/quickblox.js +19389 -21772
- package/quickblox.min.js +1 -1
- package/src/libs/strophe/strophe.common.js +6657 -0
- package/src/libs/strophe/strophe.esm.js +6649 -0
- package/src/libs/strophe/strophe.umd.js +6862 -0
- package/src/libs/strophe/strophe.umd.min.js +1 -0
- package/src/modules/chat/qbChat.js +131 -11
- package/src/modules/webrtc/qbWebRTCSignalingProcessor.js +2 -1
- package/src/modules/webrtc/qbWebRTCSignalingProvider.js +2 -1
- package/src/qbConfig.js +2 -2
- package/src/qbProxy.js +1 -1
- package/src/qbStrophe.js +2 -6
- package/strophejs-1.4.0/.eslintrc.json +264 -0
- package/strophejs-1.4.0/.gitattributes +1 -0
- package/strophejs-1.4.0/CHANGELOG.md +250 -0
- package/strophejs-1.4.0/LICENSE.txt +19 -0
- package/strophejs-1.4.0/Makefile +92 -0
- package/strophejs-1.4.0/README.md +45 -0
- package/strophejs-1.4.0/RELEASE_CHECKLIST.md +16 -0
- package/strophejs-1.4.0/contrib/discojs/README.txt +42 -0
- package/strophejs-1.4.0/contrib/discojs/css/disco.css +16 -0
- package/strophejs-1.4.0/contrib/discojs/index.html +47 -0
- package/strophejs-1.4.0/contrib/discojs/punjab.tac +18 -0
- package/strophejs-1.4.0/contrib/discojs/scripts/basic.js +102 -0
- package/strophejs-1.4.0/contrib/discojs/scripts/disco.js +60 -0
- package/strophejs-1.4.0/docs.css +797 -0
- package/strophejs-1.4.0/examples/amd.html +21 -0
- package/strophejs-1.4.0/examples/attach/README +37 -0
- package/strophejs-1.4.0/examples/attach/__init__.py +0 -0
- package/strophejs-1.4.0/examples/attach/attacher/__init__.py +0 -0
- package/strophejs-1.4.0/examples/attach/attacher/views.py +18 -0
- package/strophejs-1.4.0/examples/attach/boshclient.py +158 -0
- package/strophejs-1.4.0/examples/attach/manage.py +11 -0
- package/strophejs-1.4.0/examples/attach/settings.py +85 -0
- package/strophejs-1.4.0/examples/attach/templates/attacher/index.html +88 -0
- package/strophejs-1.4.0/examples/attach/urls.py +19 -0
- package/strophejs-1.4.0/examples/basic.html +23 -0
- package/strophejs-1.4.0/examples/basic.js +73 -0
- package/strophejs-1.4.0/examples/echobot.html +25 -0
- package/strophejs-1.4.0/examples/echobot.js +79 -0
- package/strophejs-1.4.0/examples/main.js +59 -0
- package/strophejs-1.4.0/examples/prebind.html +39 -0
- package/strophejs-1.4.0/examples/prebind.js +103 -0
- package/strophejs-1.4.0/examples/restore.html +24 -0
- package/strophejs-1.4.0/examples/restore.js +71 -0
- package/strophejs-1.4.0/package-lock.json +8631 -0
- package/strophejs-1.4.0/package.json +84 -0
- package/strophejs-1.4.0/rollup.config.js +76 -0
- package/strophejs-1.4.0/src/bosh.js +916 -0
- package/strophejs-1.4.0/src/core.js +3530 -0
- package/strophejs-1.4.0/src/md5.js +204 -0
- package/strophejs-1.4.0/src/sha1.js +172 -0
- package/strophejs-1.4.0/src/shared-connection-worker.js +114 -0
- package/strophejs-1.4.0/src/shims.js +123 -0
- package/strophejs-1.4.0/src/strophe.js +14 -0
- package/strophejs-1.4.0/src/utils.js +63 -0
- package/strophejs-1.4.0/src/websocket.js +557 -0
- package/strophejs-1.4.0/src/worker-websocket.js +150 -0
- package/strophejs-1.4.0/tests/index.html +21 -0
- package/strophejs-1.4.0/tests/main.js +49 -0
- package/strophejs-1.4.0/tests/tests.js +929 -0
- package/strophejs-1.6.1/.eslintrc.json +264 -0
- package/strophejs-1.6.1/.gitattributes +1 -0
- package/strophejs-1.6.1/.nvmrc +1 -0
- package/strophejs-1.6.1/CHANGELOG.md +288 -0
- package/strophejs-1.6.1/LICENSE.txt +19 -0
- package/strophejs-1.6.1/Makefile +92 -0
- package/strophejs-1.6.1/README.md +46 -0
- package/strophejs-1.6.1/RELEASE_CHECKLIST.md +18 -0
- package/strophejs-1.6.1/babel.config.json +10 -0
- package/strophejs-1.6.1/contrib/discojs/README.txt +42 -0
- package/strophejs-1.6.1/contrib/discojs/css/disco.css +16 -0
- package/strophejs-1.6.1/contrib/discojs/index.html +47 -0
- package/strophejs-1.6.1/contrib/discojs/punjab.tac +18 -0
- package/strophejs-1.6.1/contrib/discojs/scripts/basic.js +102 -0
- package/strophejs-1.6.1/contrib/discojs/scripts/disco.js +60 -0
- package/strophejs-1.6.1/docs.css +797 -0
- package/strophejs-1.6.1/examples/amd.html +21 -0
- package/strophejs-1.6.1/examples/attach/README +37 -0
- package/strophejs-1.6.1/examples/attach/__init__.py +0 -0
- package/strophejs-1.6.1/examples/attach/attacher/__init__.py +0 -0
- package/strophejs-1.6.1/examples/attach/attacher/views.py +18 -0
- package/strophejs-1.6.1/examples/attach/boshclient.py +158 -0
- package/strophejs-1.6.1/examples/attach/manage.py +11 -0
- package/strophejs-1.6.1/examples/attach/settings.py +85 -0
- package/strophejs-1.6.1/examples/attach/templates/attacher/index.html +88 -0
- package/strophejs-1.6.1/examples/attach/urls.py +19 -0
- package/strophejs-1.6.1/examples/basic.html +23 -0
- package/strophejs-1.6.1/examples/basic.js +73 -0
- package/strophejs-1.6.1/examples/echobot.html +25 -0
- package/strophejs-1.6.1/examples/echobot.js +79 -0
- package/strophejs-1.6.1/examples/main.js +59 -0
- package/strophejs-1.6.1/examples/prebind.html +39 -0
- package/strophejs-1.6.1/examples/prebind.js +103 -0
- package/strophejs-1.6.1/examples/restore.html +24 -0
- package/strophejs-1.6.1/examples/restore.js +71 -0
- package/strophejs-1.6.1/package-lock.json +18461 -0
- package/strophejs-1.6.1/package.json +87 -0
- package/strophejs-1.6.1/rollup.config.js +70 -0
- package/strophejs-1.6.1/src/bosh.js +916 -0
- package/strophejs-1.6.1/src/builder.js +239 -0
- package/strophejs-1.6.1/src/constants.js +155 -0
- package/strophejs-1.6.1/src/core.js +2377 -0
- package/strophejs-1.6.1/src/sasl-anon.js +17 -0
- package/strophejs-1.6.1/src/sasl-external.js +27 -0
- package/strophejs-1.6.1/src/sasl-oauthbearer.js +30 -0
- package/strophejs-1.6.1/src/sasl-plain.js +32 -0
- package/strophejs-1.6.1/src/sasl-sha1.js +24 -0
- package/strophejs-1.6.1/src/sasl-sha256.js +24 -0
- package/strophejs-1.6.1/src/sasl-sha384.js +24 -0
- package/strophejs-1.6.1/src/sasl-sha512.js +24 -0
- package/strophejs-1.6.1/src/sasl-xoauth2.js +27 -0
- package/strophejs-1.6.1/src/sasl.js +143 -0
- package/strophejs-1.6.1/src/scram.js +182 -0
- package/strophejs-1.6.1/src/shared-connection-worker.js +114 -0
- package/strophejs-1.6.1/src/shims.js +122 -0
- package/strophejs-1.6.1/src/strophe.js +15 -0
- package/strophejs-1.6.1/src/utils.js +626 -0
- package/strophejs-1.6.1/src/websocket.js +556 -0
- package/strophejs-1.6.1/src/worker-websocket.js +149 -0
- package/strophejs-1.6.1/tests.js +993 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { NS } from './constants.js';
|
|
2
|
+
import { copyElement, createHtml, serialize, xmlElement, xmlGenerator, xmlTextNode } from './utils.js';
|
|
3
|
+
|
|
4
|
+
/** Class: Strophe.Builder
|
|
5
|
+
* XML DOM builder.
|
|
6
|
+
*
|
|
7
|
+
* This object provides an interface similar to JQuery but for building
|
|
8
|
+
* DOM elements easily and rapidly. All the functions except for toString()
|
|
9
|
+
* and tree() return the object, so calls can be chained. Here's an
|
|
10
|
+
* example using the $iq() builder helper.
|
|
11
|
+
* > $iq({to: 'you', from: 'me', type: 'get', id: '1'})
|
|
12
|
+
* > .c('query', {xmlns: 'strophe:example'})
|
|
13
|
+
* > .c('example')
|
|
14
|
+
* > .toString()
|
|
15
|
+
*
|
|
16
|
+
* The above generates this XML fragment
|
|
17
|
+
* > <iq to='you' from='me' type='get' id='1'>
|
|
18
|
+
* > <query xmlns='strophe:example'>
|
|
19
|
+
* > <example/>
|
|
20
|
+
* > </query>
|
|
21
|
+
* > </iq>
|
|
22
|
+
* The corresponding DOM manipulations to get a similar fragment would be
|
|
23
|
+
* a lot more tedious and probably involve several helper variables.
|
|
24
|
+
*
|
|
25
|
+
* Since adding children makes new operations operate on the child, up()
|
|
26
|
+
* is provided to traverse up the tree. To add two children, do
|
|
27
|
+
* > builder.c('child1', ...).up().c('child2', ...)
|
|
28
|
+
* The next operation on the Builder will be relative to the second child.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Constructor: Strophe.Builder
|
|
32
|
+
* Create a Strophe.Builder object.
|
|
33
|
+
*
|
|
34
|
+
* The attributes should be passed in object notation. For example
|
|
35
|
+
* > let b = new Builder('message', {to: 'you', from: 'me'});
|
|
36
|
+
* or
|
|
37
|
+
* > let b = new Builder('messsage', {'xml:lang': 'en'});
|
|
38
|
+
*
|
|
39
|
+
* Parameters:
|
|
40
|
+
* (String) name - The name of the root element.
|
|
41
|
+
* (Object) attrs - The attributes for the root element in object notation.
|
|
42
|
+
*
|
|
43
|
+
* Returns:
|
|
44
|
+
* A new Strophe.Builder.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export default class Builder {
|
|
48
|
+
|
|
49
|
+
constructor (name, attrs) {
|
|
50
|
+
// Set correct namespace for jabber:client elements
|
|
51
|
+
if (name === 'presence' || name === 'message' || name === 'iq') {
|
|
52
|
+
if (attrs && !attrs.xmlns) {
|
|
53
|
+
attrs.xmlns = NS.CLIENT;
|
|
54
|
+
} else if (!attrs) {
|
|
55
|
+
attrs = { xmlns: NS.CLIENT };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Holds the tree being built.
|
|
59
|
+
this.nodeTree = xmlElement(name, attrs);
|
|
60
|
+
// Points to the current operation node.
|
|
61
|
+
this.node = this.nodeTree;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Function: tree
|
|
65
|
+
* Return the DOM tree.
|
|
66
|
+
*
|
|
67
|
+
* This function returns the current DOM tree as an element object. This
|
|
68
|
+
* is suitable for passing to functions like Strophe.Connection.send().
|
|
69
|
+
*
|
|
70
|
+
* Returns:
|
|
71
|
+
* The DOM tree as a element object.
|
|
72
|
+
*/
|
|
73
|
+
tree () {
|
|
74
|
+
return this.nodeTree;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Function: toString
|
|
78
|
+
* Serialize the DOM tree to a String.
|
|
79
|
+
*
|
|
80
|
+
* This function returns a string serialization of the current DOM
|
|
81
|
+
* tree. It is often used internally to pass data to a
|
|
82
|
+
* Strophe.Request object.
|
|
83
|
+
*
|
|
84
|
+
* Returns:
|
|
85
|
+
* The serialized DOM tree in a String.
|
|
86
|
+
*/
|
|
87
|
+
toString () {
|
|
88
|
+
return serialize(this.nodeTree);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Function: up
|
|
92
|
+
* Make the current parent element the new current element.
|
|
93
|
+
*
|
|
94
|
+
* This function is often used after c() to traverse back up the tree.
|
|
95
|
+
* For example, to add two children to the same element
|
|
96
|
+
* > builder.c('child1', {}).up().c('child2', {});
|
|
97
|
+
*
|
|
98
|
+
* Returns:
|
|
99
|
+
* The Stophe.Builder object.
|
|
100
|
+
*/
|
|
101
|
+
up () {
|
|
102
|
+
this.node = this.node.parentNode;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Function: root
|
|
107
|
+
* Make the root element the new current element.
|
|
108
|
+
*
|
|
109
|
+
* When at a deeply nested element in the tree, this function can be used
|
|
110
|
+
* to jump back to the root of the tree, instead of having to repeatedly
|
|
111
|
+
* call up().
|
|
112
|
+
*
|
|
113
|
+
* Returns:
|
|
114
|
+
* The Stophe.Builder object.
|
|
115
|
+
*/
|
|
116
|
+
root () {
|
|
117
|
+
this.node = this.nodeTree;
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Function: attrs
|
|
122
|
+
* Add or modify attributes of the current element.
|
|
123
|
+
*
|
|
124
|
+
* The attributes should be passed in object notation. This function
|
|
125
|
+
* does not move the current element pointer.
|
|
126
|
+
*
|
|
127
|
+
* Parameters:
|
|
128
|
+
* (Object) moreattrs - The attributes to add/modify in object notation.
|
|
129
|
+
*
|
|
130
|
+
* Returns:
|
|
131
|
+
* The Strophe.Builder object.
|
|
132
|
+
*/
|
|
133
|
+
attrs (moreattrs) {
|
|
134
|
+
for (const k in moreattrs) {
|
|
135
|
+
if (Object.prototype.hasOwnProperty.call(moreattrs, k)) {
|
|
136
|
+
if (moreattrs[k] === undefined) {
|
|
137
|
+
this.node.removeAttribute(k);
|
|
138
|
+
} else {
|
|
139
|
+
this.node.setAttribute(k, moreattrs[k]);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Function: c
|
|
147
|
+
* Add a child to the current element and make it the new current
|
|
148
|
+
* element.
|
|
149
|
+
*
|
|
150
|
+
* This function moves the current element pointer to the child,
|
|
151
|
+
* unless text is provided. If you need to add another child, it
|
|
152
|
+
* is necessary to use up() to go back to the parent in the tree.
|
|
153
|
+
*
|
|
154
|
+
* Parameters:
|
|
155
|
+
* (String) name - The name of the child.
|
|
156
|
+
* (Object) attrs - The attributes of the child in object notation.
|
|
157
|
+
* (String) text - The text to add to the child.
|
|
158
|
+
*
|
|
159
|
+
* Returns:
|
|
160
|
+
* The Strophe.Builder object.
|
|
161
|
+
*/
|
|
162
|
+
c (name, attrs, text) {
|
|
163
|
+
const child = xmlElement(name, attrs, text);
|
|
164
|
+
this.node.appendChild(child);
|
|
165
|
+
if (typeof text !== 'string' && typeof text !== 'number') {
|
|
166
|
+
this.node = child;
|
|
167
|
+
}
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Function: cnode
|
|
172
|
+
* Add a child to the current element and make it the new current
|
|
173
|
+
* element.
|
|
174
|
+
*
|
|
175
|
+
* This function is the same as c() except that instead of using a
|
|
176
|
+
* name and an attributes object to create the child it uses an
|
|
177
|
+
* existing DOM element object.
|
|
178
|
+
*
|
|
179
|
+
* Parameters:
|
|
180
|
+
* (XMLElement) elem - A DOM element.
|
|
181
|
+
*
|
|
182
|
+
* Returns:
|
|
183
|
+
* The Strophe.Builder object.
|
|
184
|
+
*/
|
|
185
|
+
cnode (elem) {
|
|
186
|
+
let impNode;
|
|
187
|
+
const xmlGen = xmlGenerator();
|
|
188
|
+
try {
|
|
189
|
+
impNode = xmlGen.importNode !== undefined;
|
|
190
|
+
} catch (e) {
|
|
191
|
+
impNode = false;
|
|
192
|
+
}
|
|
193
|
+
const newElem = impNode ? xmlGen.importNode(elem, true) : copyElement(elem);
|
|
194
|
+
this.node.appendChild(newElem);
|
|
195
|
+
this.node = newElem;
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Function: t
|
|
200
|
+
* Add a child text element.
|
|
201
|
+
*
|
|
202
|
+
* This *does not* make the child the new current element since there
|
|
203
|
+
* are no children of text elements.
|
|
204
|
+
*
|
|
205
|
+
* Parameters:
|
|
206
|
+
* (String) text - The text data to append to the current element.
|
|
207
|
+
*
|
|
208
|
+
* Returns:
|
|
209
|
+
* The Strophe.Builder object.
|
|
210
|
+
*/
|
|
211
|
+
t (text) {
|
|
212
|
+
const child = xmlTextNode(text);
|
|
213
|
+
this.node.appendChild(child);
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Function: h
|
|
218
|
+
* Replace current element contents with the HTML passed in.
|
|
219
|
+
*
|
|
220
|
+
* This *does not* make the child the new current element
|
|
221
|
+
*
|
|
222
|
+
* Parameters:
|
|
223
|
+
* (String) html - The html to insert as contents of current element.
|
|
224
|
+
*
|
|
225
|
+
* Returns:
|
|
226
|
+
* The Strophe.Builder object.
|
|
227
|
+
*/
|
|
228
|
+
h (html) {
|
|
229
|
+
const fragment = xmlGenerator().createElement('body');
|
|
230
|
+
// force the browser to try and fix any invalid HTML tags
|
|
231
|
+
fragment.innerHTML = html;
|
|
232
|
+
// copy cleaned html into an xml dom
|
|
233
|
+
const xhtml = createHtml(fragment);
|
|
234
|
+
while (xhtml.childNodes.length > 0) {
|
|
235
|
+
this.node.appendChild(xhtml.childNodes[0]);
|
|
236
|
+
}
|
|
237
|
+
return this;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/** Constants: XMPP Namespace Constants
|
|
2
|
+
* Common namespace constants from the XMPP RFCs and XEPs.
|
|
3
|
+
*
|
|
4
|
+
* Strophe.NS.HTTPBIND - HTTP BIND namespace from XEP 124.
|
|
5
|
+
* Strophe.NS.BOSH - BOSH namespace from XEP 206.
|
|
6
|
+
* Strophe.NS.CLIENT - Main XMPP client namespace.
|
|
7
|
+
* Strophe.NS.AUTH - Legacy authentication namespace.
|
|
8
|
+
* Strophe.NS.ROSTER - Roster operations namespace.
|
|
9
|
+
* Strophe.NS.PROFILE - Profile namespace.
|
|
10
|
+
* Strophe.NS.DISCO_INFO - Service discovery info namespace from XEP 30.
|
|
11
|
+
* Strophe.NS.DISCO_ITEMS - Service discovery items namespace from XEP 30.
|
|
12
|
+
* Strophe.NS.MUC - Multi-User Chat namespace from XEP 45.
|
|
13
|
+
* Strophe.NS.SASL - XMPP SASL namespace from RFC 3920.
|
|
14
|
+
* Strophe.NS.STREAM - XMPP Streams namespace from RFC 3920.
|
|
15
|
+
* Strophe.NS.BIND - XMPP Binding namespace from RFC 3920 and RFC 6120.
|
|
16
|
+
* Strophe.NS.SESSION - XMPP Session namespace from RFC 3920.
|
|
17
|
+
* Strophe.NS.XHTML_IM - XHTML-IM namespace from XEP 71.
|
|
18
|
+
* Strophe.NS.XHTML - XHTML body namespace from XEP 71.
|
|
19
|
+
*/
|
|
20
|
+
export const NS = {
|
|
21
|
+
HTTPBIND: "http://jabber.org/protocol/httpbind",
|
|
22
|
+
BOSH: "urn:xmpp:xbosh",
|
|
23
|
+
CLIENT: "jabber:client",
|
|
24
|
+
AUTH: "jabber:iq:auth",
|
|
25
|
+
ROSTER: "jabber:iq:roster",
|
|
26
|
+
PROFILE: "jabber:iq:profile",
|
|
27
|
+
DISCO_INFO: "http://jabber.org/protocol/disco#info",
|
|
28
|
+
DISCO_ITEMS: "http://jabber.org/protocol/disco#items",
|
|
29
|
+
MUC: "http://jabber.org/protocol/muc",
|
|
30
|
+
SASL: "urn:ietf:params:xml:ns:xmpp-sasl",
|
|
31
|
+
STREAM: "http://etherx.jabber.org/streams",
|
|
32
|
+
FRAMING: "urn:ietf:params:xml:ns:xmpp-framing",
|
|
33
|
+
BIND: "urn:ietf:params:xml:ns:xmpp-bind",
|
|
34
|
+
SESSION: "urn:ietf:params:xml:ns:xmpp-session",
|
|
35
|
+
VERSION: "jabber:iq:version",
|
|
36
|
+
STANZAS: "urn:ietf:params:xml:ns:xmpp-stanzas",
|
|
37
|
+
XHTML_IM: "http://jabber.org/protocol/xhtml-im",
|
|
38
|
+
XHTML: "http://www.w3.org/1999/xhtml",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Constants: XHTML_IM Namespace
|
|
42
|
+
* contains allowed tags, tag attributes, and css properties.
|
|
43
|
+
* Used in the createHtml function to filter incoming html into the allowed XHTML-IM subset.
|
|
44
|
+
* See http://xmpp.org/extensions/xep-0071.html#profile-summary for the list of recommended
|
|
45
|
+
* allowed tags and their attributes.
|
|
46
|
+
*/
|
|
47
|
+
export const XHTML = {
|
|
48
|
+
tags: ['a','blockquote','br','cite','em','img','li','ol','p','span','strong','ul','body'],
|
|
49
|
+
attributes: {
|
|
50
|
+
'a': ['href'],
|
|
51
|
+
'blockquote': ['style'],
|
|
52
|
+
'br': [],
|
|
53
|
+
'cite': ['style'],
|
|
54
|
+
'em': [],
|
|
55
|
+
'img': ['src', 'alt', 'style', 'height', 'width'],
|
|
56
|
+
'li': ['style'],
|
|
57
|
+
'ol': ['style'],
|
|
58
|
+
'p': ['style'],
|
|
59
|
+
'span': ['style'],
|
|
60
|
+
'strong': [],
|
|
61
|
+
'ul': ['style'],
|
|
62
|
+
'body': []
|
|
63
|
+
},
|
|
64
|
+
css: ['background-color','color','font-family','font-size','font-style','font-weight','margin-left','margin-right','text-align','text-decoration'],
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Constants: Connection Status Constants
|
|
68
|
+
* Connection status constants for use by the connection handler
|
|
69
|
+
* callback.
|
|
70
|
+
*
|
|
71
|
+
* Strophe.Status.ERROR - An error has occurred
|
|
72
|
+
* Strophe.Status.CONNECTING - The connection is currently being made
|
|
73
|
+
* Strophe.Status.CONNFAIL - The connection attempt failed
|
|
74
|
+
* Strophe.Status.AUTHENTICATING - The connection is authenticating
|
|
75
|
+
* Strophe.Status.AUTHFAIL - The authentication attempt failed
|
|
76
|
+
* Strophe.Status.CONNECTED - The connection has succeeded
|
|
77
|
+
* Strophe.Status.DISCONNECTED - The connection has been terminated
|
|
78
|
+
* Strophe.Status.DISCONNECTING - The connection is currently being terminated
|
|
79
|
+
* Strophe.Status.ATTACHED - The connection has been attached
|
|
80
|
+
* Strophe.Status.REDIRECT - The connection has been redirected
|
|
81
|
+
* Strophe.Status.CONNTIMEOUT - The connection has timed out
|
|
82
|
+
*/
|
|
83
|
+
export const Status = {
|
|
84
|
+
ERROR: 0,
|
|
85
|
+
CONNECTING: 1,
|
|
86
|
+
CONNFAIL: 2,
|
|
87
|
+
AUTHENTICATING: 3,
|
|
88
|
+
AUTHFAIL: 4,
|
|
89
|
+
CONNECTED: 5,
|
|
90
|
+
DISCONNECTED: 6,
|
|
91
|
+
DISCONNECTING: 7,
|
|
92
|
+
ATTACHED: 8,
|
|
93
|
+
REDIRECT: 9,
|
|
94
|
+
CONNTIMEOUT: 10,
|
|
95
|
+
BINDREQUIRED: 11,
|
|
96
|
+
ATTACHFAIL: 12
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const ErrorCondition = {
|
|
100
|
+
BAD_FORMAT: "bad-format",
|
|
101
|
+
CONFLICT: "conflict",
|
|
102
|
+
MISSING_JID_NODE: "x-strophe-bad-non-anon-jid",
|
|
103
|
+
NO_AUTH_MECH: "no-auth-mech",
|
|
104
|
+
UNKNOWN_REASON: "unknown",
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/** Constants: Log Level Constants
|
|
109
|
+
* Logging level indicators.
|
|
110
|
+
*
|
|
111
|
+
* Strophe.LogLevel.DEBUG - Debug output
|
|
112
|
+
* Strophe.LogLevel.INFO - Informational output
|
|
113
|
+
* Strophe.LogLevel.WARN - Warnings
|
|
114
|
+
* Strophe.LogLevel.ERROR - Errors
|
|
115
|
+
* Strophe.LogLevel.FATAL - Fatal errors
|
|
116
|
+
*/
|
|
117
|
+
export const LogLevel = {
|
|
118
|
+
DEBUG: 0,
|
|
119
|
+
INFO: 1,
|
|
120
|
+
WARN: 2,
|
|
121
|
+
ERROR: 3,
|
|
122
|
+
FATAL: 4
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** PrivateConstants: DOM Element Type Constants
|
|
126
|
+
* DOM element types.
|
|
127
|
+
*
|
|
128
|
+
* ElementType.NORMAL - Normal element.
|
|
129
|
+
* ElementType.TEXT - Text data element.
|
|
130
|
+
* ElementType.FRAGMENT - XHTML fragment element.
|
|
131
|
+
*/
|
|
132
|
+
export const ElementType = {
|
|
133
|
+
NORMAL: 1,
|
|
134
|
+
TEXT: 3,
|
|
135
|
+
CDATA: 4,
|
|
136
|
+
FRAGMENT: 11,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/** PrivateConstants: Timeout Values
|
|
141
|
+
* Timeout values for error states. These values are in seconds.
|
|
142
|
+
* These should not be changed unless you know exactly what you are
|
|
143
|
+
* doing.
|
|
144
|
+
*
|
|
145
|
+
* TIMEOUT - Timeout multiplier. A waiting request will be considered
|
|
146
|
+
* failed after Math.floor(TIMEOUT * wait) seconds have elapsed.
|
|
147
|
+
* This defaults to 1.1, and with default wait, 66 seconds.
|
|
148
|
+
* SECONDARY_TIMEOUT - Secondary timeout multiplier. In cases where
|
|
149
|
+
* Strophe can detect early failure, it will consider the request
|
|
150
|
+
* failed if it doesn't return after
|
|
151
|
+
* Math.floor(SECONDARY_TIMEOUT * wait) seconds have elapsed.
|
|
152
|
+
* This defaults to 0.1, and with default wait, 6 seconds.
|
|
153
|
+
*/
|
|
154
|
+
export const TIMEOUT = 1.1;
|
|
155
|
+
export const SECONDARY_TIMEOUT = 0.1;
|