jsf.js_next_gen 4.0.0-RC.1 → 4.0.0-RC.2
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/dist/docs/functions/faces.push.init.html +5 -1
- package/dist/window/faces-development.js +65 -23
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +76 -23
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +1 -1
- package/src/main/typescript/api/_api.ts +3 -1
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/PushImpl.ts +38 -12
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +24 -12
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +6 -0
- package/target/api/_api.js +3 -2
- package/target/api/_api.js.map +1 -1
- package/target/api/jsf.js +11 -0
- package/target/api/jsf.js.map +1 -1
- package/target/impl/PushImpl.js +44 -14
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +18 -7
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +5 -0
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
package/package.json
CHANGED
|
@@ -201,6 +201,7 @@ export module faces {
|
|
|
201
201
|
* @param channel the channel name/id
|
|
202
202
|
* @param onopen The function to be invoked when the web socket is opened.
|
|
203
203
|
* @param onmessage The function to be invoked when a message is received.
|
|
204
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
204
205
|
* @param onclose The function to be invoked when the web socket is closed.
|
|
205
206
|
* @param behaviors functions which are invoked whenever a message is received
|
|
206
207
|
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
@@ -210,10 +211,11 @@ export module faces {
|
|
|
210
211
|
channel: string,
|
|
211
212
|
onopen: Function,
|
|
212
213
|
onmessage: Function,
|
|
214
|
+
onerror: Function,
|
|
213
215
|
onclose: Function,
|
|
214
216
|
behaviors: any,
|
|
215
217
|
autoConnect: boolean): void {
|
|
216
|
-
PushImpl.init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect);
|
|
218
|
+
PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
/**
|
|
@@ -26,6 +26,24 @@ if(!window?.jsf) {
|
|
|
26
26
|
(window as any)['jsf'] = window?.jsf ?? faces;
|
|
27
27
|
window.jsf.specversion = 230000;
|
|
28
28
|
delete window.jsf.contextpath;
|
|
29
|
+
|
|
30
|
+
let faces4Init = faces.push.init;
|
|
31
|
+
/*
|
|
32
|
+
* we shim back the breaking api change from 3.0 to 4.0
|
|
33
|
+
* onerror is gone
|
|
34
|
+
*/
|
|
35
|
+
faces.push.init = (socketClientId: string,
|
|
36
|
+
url: string,
|
|
37
|
+
channel: string,
|
|
38
|
+
onopen: Function,
|
|
39
|
+
onmessage: Function,
|
|
40
|
+
// no on error api change for 4.0
|
|
41
|
+
//onerror: Function,
|
|
42
|
+
onclose: Function,
|
|
43
|
+
behaviors: any,
|
|
44
|
+
autoConnect: boolean) => {
|
|
45
|
+
faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
|
|
46
|
+
}
|
|
29
47
|
}
|
|
30
48
|
if(!window?.myfaces?.ab) {
|
|
31
49
|
const myfaces = require("./_api").myfaces;
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
* Typescript port of the faces\.push part in the myfaces implementation
|
|
19
19
|
*/
|
|
20
20
|
import {MAX_RECONNECT_ATTEMPTS, REASON_EXPIRED, RECONNECT_INTERVAL} from "./core/Const";
|
|
21
|
+
import {DQ} from "mona-dish";
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Implementation class for the push functionality
|
|
24
25
|
*/
|
|
25
26
|
export module PushImpl {
|
|
26
27
|
|
|
27
|
-
const URL_PROTOCOL =
|
|
28
|
+
const URL_PROTOCOL = DQ.global().location.protocol.replace("http", "ws") + "//";
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
// we expose the member variables for testing purposes
|
|
@@ -55,6 +56,7 @@ export module PushImpl {
|
|
|
55
56
|
* @param channel the channel name/id
|
|
56
57
|
* @param onopen The function to be invoked when the web socket is opened.
|
|
57
58
|
* @param onmessage The function to be invoked when a message is received.
|
|
59
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
58
60
|
* @param onclose The function to be invoked when the web socket is closed.
|
|
59
61
|
* @param behaviors functions which are invoked whenever a message is received
|
|
60
62
|
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
@@ -64,12 +66,13 @@ export module PushImpl {
|
|
|
64
66
|
channel: string,
|
|
65
67
|
onopen: Function,
|
|
66
68
|
onmessage: Function,
|
|
69
|
+
onerror: Function,
|
|
67
70
|
onclose: Function,
|
|
68
71
|
behaviors: any,
|
|
69
72
|
autoConnect: boolean) {
|
|
70
73
|
onclose = resolveFunction(onclose);
|
|
71
74
|
|
|
72
|
-
if (!
|
|
75
|
+
if (!DQ.global().WebSocket) { // IE6-9.
|
|
73
76
|
onclose(-1, channel);
|
|
74
77
|
return;
|
|
75
78
|
}
|
|
@@ -81,6 +84,7 @@ export module PushImpl {
|
|
|
81
84
|
'channelToken': channelToken,
|
|
82
85
|
'onopen': resolveFunction(onopen),
|
|
83
86
|
'onmessage' : resolveFunction(onmessage),
|
|
87
|
+
'onerror' : resolveFunction(onerror),
|
|
84
88
|
'onclose': onclose,
|
|
85
89
|
'behaviors': behaviors,
|
|
86
90
|
'autoconnect': autoConnect};
|
|
@@ -95,16 +99,16 @@ export module PushImpl {
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
if (autoConnect) {
|
|
98
|
-
(
|
|
102
|
+
(DQ.global()?.faces ?? DQ.global()?.jsf).push.open(socketClientId);
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
export function open(socketClientId: string) {
|
|
103
|
-
getSocket(components
|
|
107
|
+
getSocket(components[socketClientId]?.channelToken).open();
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
export function close(socketClientId: string) {
|
|
107
|
-
getSocket(components
|
|
111
|
+
getSocket(components[socketClientId].channelToken).close();
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
// Private helper classes
|
|
@@ -142,24 +146,45 @@ export module PushImpl {
|
|
|
142
146
|
let clientIds = clientIdsByTokens[this.channelToken];
|
|
143
147
|
for (let i = clientIds.length - 1; i >= 0; i--) {
|
|
144
148
|
let socketClientId = clientIds[i];
|
|
145
|
-
components[socketClientId]['onopen'](this.channel);
|
|
149
|
+
components[socketClientId]?.['onopen']?.(this.channel);
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
this.reconnectAttempts = 0;
|
|
149
153
|
}
|
|
150
154
|
|
|
155
|
+
onerror(event: any) {
|
|
156
|
+
let message = JSON.parse(event.data);
|
|
157
|
+
//TODO replace this with a more readable Stream code
|
|
158
|
+
for (let i = clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
|
|
159
|
+
let socketClientId = clientIdsByTokens[this.channelToken][i];
|
|
160
|
+
if (document.getElementById(socketClientId)) {
|
|
161
|
+
try {
|
|
162
|
+
components[socketClientId]?.['onerror']?.(message, this.channel, event);
|
|
163
|
+
} catch (e) {
|
|
164
|
+
//Ignore
|
|
165
|
+
}
|
|
166
|
+
} else {
|
|
167
|
+
clientIdsByTokens[this.channelToken].splice(i, 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (clientIdsByTokens[this.channelToken].length == 0) {
|
|
171
|
+
// tag disappeared
|
|
172
|
+
this.close();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
151
176
|
onmmessage(event: any) {
|
|
152
177
|
let message = JSON.parse(event.data);
|
|
153
178
|
for (let i = clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
|
|
154
179
|
let socketClientId = clientIdsByTokens[this.channelToken][i];
|
|
155
180
|
if (document.getElementById(socketClientId)) {
|
|
156
181
|
try {
|
|
157
|
-
components[socketClientId]['onmessage'](message, this.channel, event);
|
|
182
|
+
components[socketClientId]?.['onmessage']?.(message, this.channel, event);
|
|
158
183
|
} catch (e) {
|
|
159
184
|
//Ignore
|
|
160
185
|
}
|
|
161
|
-
let behaviors = components[socketClientId]['behaviors'];
|
|
162
|
-
let functions = behaviors[message];
|
|
186
|
+
let behaviors = components?.[socketClientId]?.['behaviors'];
|
|
187
|
+
let functions = behaviors?.[message];
|
|
163
188
|
if (functions && functions.length) {
|
|
164
189
|
for (let j = 0; j < functions.length; j++) {
|
|
165
190
|
try {
|
|
@@ -188,7 +213,7 @@ export module PushImpl {
|
|
|
188
213
|
let clientIds = clientIdsByTokens[this.channelToken];
|
|
189
214
|
for (let i = clientIds.length - 1; i >= 0; i--) {
|
|
190
215
|
let socketClientId = clientIds[i];
|
|
191
|
-
components[socketClientId]['onclose'](event?.code, this?.channel, event);
|
|
216
|
+
components?.[socketClientId]?.['onclose']?.(event?.code, this?.channel, event);
|
|
192
217
|
}
|
|
193
218
|
} else {
|
|
194
219
|
setTimeout(this.open, RECONNECT_INTERVAL * this.reconnectAttempts++);
|
|
@@ -210,6 +235,7 @@ export module PushImpl {
|
|
|
210
235
|
this.socket.onopen = (event: Event) => this.onopen(event);
|
|
211
236
|
this.socket.onmessage = (event: Event) => this.onmmessage(event);
|
|
212
237
|
this.socket.onclose = (event: Event) => this.onclose(event);
|
|
238
|
+
this.socket.onerror = (event: Event) => this.onerror(event);
|
|
213
239
|
}
|
|
214
240
|
}
|
|
215
241
|
|
|
@@ -217,7 +243,7 @@ export module PushImpl {
|
|
|
217
243
|
|
|
218
244
|
function getBaseURL(url: string) {
|
|
219
245
|
if (url.indexOf("://") < 0) {
|
|
220
|
-
let base =
|
|
246
|
+
let base = DQ.global().location.hostname + ":" + DQ.global().location.port;
|
|
221
247
|
return URL_PROTOCOL + base + url;
|
|
222
248
|
} else {
|
|
223
249
|
return url;
|
|
@@ -242,7 +268,7 @@ export module PushImpl {
|
|
|
242
268
|
|
|
243
269
|
function resolveFunction(fn: Function | string = () => {
|
|
244
270
|
}): Function {
|
|
245
|
-
return <Function>((typeof fn !== "function") && (fn =
|
|
271
|
+
return <Function>((typeof fn !== "function") && (fn = DQ.global()[fn]), fn);
|
|
246
272
|
}
|
|
247
273
|
|
|
248
274
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import {ArrayCollector, Config, DQ, Lang, LazyStream, Stream} from "mona-dish";
|
|
17
17
|
import {EMPTY_STR, IDENT_ALL, IDENT_FORM, P_VIEWSTATE} from "../core/Const";
|
|
18
18
|
import isString = Lang.isString;
|
|
19
|
-
import {ExtConfig} from "../util/ExtDomQuery";
|
|
19
|
+
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -54,15 +54,20 @@ export class XhrFormData extends Config {
|
|
|
54
54
|
//a call to getViewState before must pass the encoded line
|
|
55
55
|
//a call from getViewState passes the form element as datasource,
|
|
56
56
|
//so we have two call points
|
|
57
|
+
// atm we basically encode twice, to keep the code leaner
|
|
58
|
+
// this will be later optmized, practically elements
|
|
59
|
+
// which are already covered by an external viewstate do not need
|
|
60
|
+
// the encoding a second time, because they are overwritten by the viewstate again
|
|
57
61
|
if (isString(dataSource)) {
|
|
58
62
|
this.assignEncodedString(<string>this.dataSource);
|
|
59
63
|
} else {
|
|
60
64
|
this.applyFormDataToConfig();
|
|
61
65
|
}
|
|
62
|
-
|
|
66
|
+
//now assign the external viewstate overrides
|
|
67
|
+
if ('undefined' != typeof viewState) {
|
|
63
68
|
this.assignEncodedString(viewState)
|
|
64
69
|
}
|
|
65
|
-
if(executes) {
|
|
70
|
+
if (executes) {
|
|
66
71
|
this.postInit(...executes);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
@@ -73,14 +78,17 @@ export class XhrFormData extends Config {
|
|
|
73
78
|
* in our ajax request
|
|
74
79
|
*/
|
|
75
80
|
postInit(...executes: Array<string>) {
|
|
76
|
-
let
|
|
81
|
+
let fetchFileInputs = (id: string): DQ => {
|
|
82
|
+
const INPUT_FILE = "input[type='file']";
|
|
77
83
|
if (id == IDENT_ALL) {
|
|
78
|
-
return DQ.querySelectorAllDeep(
|
|
84
|
+
return DQ.querySelectorAllDeep(INPUT_FILE);
|
|
79
85
|
} else if (id == IDENT_FORM) {
|
|
80
|
-
return (<DQ>this.dataSource).
|
|
86
|
+
return (<DQ>this.dataSource).matchesSelector(INPUT_FILE) ?
|
|
87
|
+
(<DQ>this.dataSource) :
|
|
88
|
+
(<DQ>this.dataSource).querySelectorAllDeep(INPUT_FILE);
|
|
81
89
|
} else {
|
|
82
90
|
let element = DQ.byId(id, true);
|
|
83
|
-
return this.getFileInputs(element);
|
|
91
|
+
return element.matchesSelector(INPUT_FILE) ? element : this.getFileInputs(element);
|
|
84
92
|
}
|
|
85
93
|
};
|
|
86
94
|
|
|
@@ -90,7 +98,7 @@ export class XhrFormData extends Config {
|
|
|
90
98
|
|
|
91
99
|
|
|
92
100
|
this.isMultipartRequest = LazyStream.of(...executes)
|
|
93
|
-
.map(
|
|
101
|
+
.map(fetchFileInputs)
|
|
94
102
|
.filter(inputExists)
|
|
95
103
|
.first().isPresent();
|
|
96
104
|
}
|
|
@@ -113,8 +121,8 @@ export class XhrFormData extends Config {
|
|
|
113
121
|
assignEncodedString(encoded: string) {
|
|
114
122
|
// this code filters out empty strings as key value pairs
|
|
115
123
|
let keyValueEntries = decodeURIComponent(encoded).split(/&/gi)
|
|
116
|
-
|
|
117
|
-
.replace(/\s+/g,''));
|
|
124
|
+
.filter(item => !!(item || '')
|
|
125
|
+
.replace(/\s+/g, ''));
|
|
118
126
|
this.assignString(keyValueEntries);
|
|
119
127
|
}
|
|
120
128
|
|
|
@@ -133,8 +141,8 @@ export class XhrFormData extends Config {
|
|
|
133
141
|
return keyVal.length < 3 ? [keyVal?.[0] ?? [], keyVal?.[1] ?? []] : keyVal;
|
|
134
142
|
}
|
|
135
143
|
|
|
144
|
+
//TODO fix files...
|
|
136
145
|
Stream.of(...keyValueEntries)
|
|
137
|
-
//split only the first =
|
|
138
146
|
.map(line => splitToKeyVal(line))
|
|
139
147
|
//special case of having keys without values
|
|
140
148
|
.map(keyVal => fixKeyWithoutVal(keyVal))
|
|
@@ -171,7 +179,11 @@ export class XhrFormData extends Config {
|
|
|
171
179
|
}
|
|
172
180
|
let entries = LazyStream.of(...Object.keys(this.value))
|
|
173
181
|
.filter(key => this.value.hasOwnProperty(key))
|
|
174
|
-
.flatMap(key => Stream.of(...this.value[key]).map(val => [key, val])
|
|
182
|
+
.flatMap(key => Stream.of(...this.value[key]).map(val => [key, val])
|
|
183
|
+
//we cannot encode file elements that is handled by multipart requests anyway
|
|
184
|
+
.filter(([, value]) => !(value instanceof ExtDomQuery.global().File))
|
|
185
|
+
.collect(new ArrayCollector()))
|
|
186
|
+
|
|
175
187
|
.map(keyVal => {
|
|
176
188
|
return `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;
|
|
177
189
|
})
|
|
@@ -198,14 +198,20 @@ describe('Tests after core when it hits response', function () {
|
|
|
198
198
|
render: "@form",
|
|
199
199
|
pass1: "pass1",
|
|
200
200
|
pass2: "pass2",
|
|
201
|
+
message: "Hello World",
|
|
201
202
|
onevent: (evt: any) => {
|
|
202
203
|
localCnt++;
|
|
203
204
|
}
|
|
204
205
|
});
|
|
205
206
|
|
|
206
207
|
let xhrReq = this.requests[0];
|
|
208
|
+
let requestBody = xhrReq.requestBody.split("&");
|
|
207
209
|
|
|
208
210
|
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
211
|
+
expect(requestBody.indexOf("pass1=pass1")).not.to.eq(-1);
|
|
212
|
+
expect(requestBody.indexOf("pass2=pass2")).not.to.eq(-1);
|
|
213
|
+
expect(requestBody.indexOf("message=Hello%20World")).not.to.eq(-1);
|
|
214
|
+
|
|
209
215
|
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
210
216
|
//success ommitted due to fake response
|
|
211
217
|
expect(globalCnt == 3).to.eq(true);
|
package/target/api/_api.js
CHANGED
|
@@ -194,12 +194,13 @@ var faces;
|
|
|
194
194
|
* @param channel the channel name/id
|
|
195
195
|
* @param onopen The function to be invoked when the web socket is opened.
|
|
196
196
|
* @param onmessage The function to be invoked when a message is received.
|
|
197
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
197
198
|
* @param onclose The function to be invoked when the web socket is closed.
|
|
198
199
|
* @param behaviors functions which are invoked whenever a message is received
|
|
199
200
|
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
200
201
|
*/
|
|
201
|
-
function init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect) {
|
|
202
|
-
PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect);
|
|
202
|
+
function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
|
|
203
|
+
PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
|
|
203
204
|
}
|
|
204
205
|
push.init = init;
|
|
205
206
|
/**
|
package/target/api/_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAA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,CAAC,CAAC;IACvE,CAAC;IAZe,UAAE,KAYjB,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EA/Ba,OAAO,GAAP,eAAO,KAAP,eAAO,QA+BpB"}
|
package/target/api/jsf.js
CHANGED
|
@@ -28,6 +28,17 @@ if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
|
|
|
28
28
|
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
|
|
29
29
|
window.jsf.specversion = 230000;
|
|
30
30
|
delete window.jsf.contextpath;
|
|
31
|
+
let faces4Init = faces.push.init;
|
|
32
|
+
/*
|
|
33
|
+
* we shim back the breaking api change from 3.0 to 4.0
|
|
34
|
+
* onerror is gone
|
|
35
|
+
*/
|
|
36
|
+
faces.push.init = (socketClientId, url, channel, onopen, onmessage,
|
|
37
|
+
// no on error api change for 4.0
|
|
38
|
+
//onerror: Function,
|
|
39
|
+
onclose, behaviors, autoConnect) => {
|
|
40
|
+
faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
|
|
41
|
+
};
|
|
31
42
|
}
|
|
32
43
|
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
33
44
|
const myfaces = require("./_api").myfaces;
|
package/target/api/jsf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACrC,MAAc,CAAC,KAAK,CAAC,GAAG,MAAA,MAAM,aAAN,M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;IAC1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;QACrB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;QAC1C,qEAAqE;QACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,eAAC,OAAA,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;KACpG;CACJ;AAEU,QAAA,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;AACjB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC"}
|
package/target/impl/PushImpl.js
CHANGED
|
@@ -20,12 +20,13 @@ exports.PushImpl = void 0;
|
|
|
20
20
|
* Typescript port of the faces\.push part in the myfaces implementation
|
|
21
21
|
*/
|
|
22
22
|
const Const_1 = require("./core/Const");
|
|
23
|
+
const mona_dish_1 = require("mona-dish");
|
|
23
24
|
/**
|
|
24
25
|
* Implementation class for the push functionality
|
|
25
26
|
*/
|
|
26
27
|
var PushImpl;
|
|
27
28
|
(function (PushImpl) {
|
|
28
|
-
const URL_PROTOCOL =
|
|
29
|
+
const URL_PROTOCOL = mona_dish_1.DQ.global().location.protocol.replace("http", "ws") + "//";
|
|
29
30
|
// we expose the member variables for testing purposes
|
|
30
31
|
// they are not directly touched outside of tests
|
|
31
32
|
/* socket map by token */
|
|
@@ -50,14 +51,15 @@ var PushImpl;
|
|
|
50
51
|
* @param channel the channel name/id
|
|
51
52
|
* @param onopen The function to be invoked when the web socket is opened.
|
|
52
53
|
* @param onmessage The function to be invoked when a message is received.
|
|
54
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
53
55
|
* @param onclose The function to be invoked when the web socket is closed.
|
|
54
56
|
* @param behaviors functions which are invoked whenever a message is received
|
|
55
57
|
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
56
58
|
*/
|
|
57
|
-
function init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect) {
|
|
58
|
-
var _a;
|
|
59
|
+
function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
|
|
60
|
+
var _a, _b, _c;
|
|
59
61
|
onclose = resolveFunction(onclose);
|
|
60
|
-
if (!
|
|
62
|
+
if (!mona_dish_1.DQ.global().WebSocket) { // IE6-9.
|
|
61
63
|
onclose(-1, channel);
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
@@ -67,6 +69,7 @@ var PushImpl;
|
|
|
67
69
|
'channelToken': channelToken,
|
|
68
70
|
'onopen': resolveFunction(onopen),
|
|
69
71
|
'onmessage': resolveFunction(onmessage),
|
|
72
|
+
'onerror': resolveFunction(onerror),
|
|
70
73
|
'onclose': onclose,
|
|
71
74
|
'behaviors': behaviors,
|
|
72
75
|
'autoconnect': autoConnect
|
|
@@ -80,17 +83,17 @@ var PushImpl;
|
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
if (autoConnect) {
|
|
83
|
-
((_a =
|
|
86
|
+
((_b = (_a = mona_dish_1.DQ.global()) === null || _a === void 0 ? void 0 : _a.faces) !== null && _b !== void 0 ? _b : (_c = mona_dish_1.DQ.global()) === null || _c === void 0 ? void 0 : _c.jsf).push.open(socketClientId);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
PushImpl.init = init;
|
|
87
90
|
function open(socketClientId) {
|
|
88
91
|
var _a;
|
|
89
|
-
getSocket((_a = PushImpl.components
|
|
92
|
+
getSocket((_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a.channelToken).open();
|
|
90
93
|
}
|
|
91
94
|
PushImpl.open = open;
|
|
92
95
|
function close(socketClientId) {
|
|
93
|
-
getSocket(PushImpl.components
|
|
96
|
+
getSocket(PushImpl.components[socketClientId].channelToken).close();
|
|
94
97
|
}
|
|
95
98
|
PushImpl.close = close;
|
|
96
99
|
// Private helper classes
|
|
@@ -120,28 +123,53 @@ var PushImpl;
|
|
|
120
123
|
}
|
|
121
124
|
// noinspection JSUnusedLocalSymbols
|
|
122
125
|
onopen(event) {
|
|
126
|
+
var _a, _b;
|
|
123
127
|
if (!this.reconnectAttempts) {
|
|
124
128
|
let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
|
|
125
129
|
for (let i = clientIds.length - 1; i >= 0; i--) {
|
|
126
130
|
let socketClientId = clientIds[i];
|
|
127
|
-
PushImpl.components[socketClientId]['onopen'](this.channel);
|
|
131
|
+
(_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onopen']) === null || _b === void 0 ? void 0 : _b.call(_a, this.channel);
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
this.reconnectAttempts = 0;
|
|
131
135
|
}
|
|
136
|
+
onerror(event) {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
let message = JSON.parse(event.data);
|
|
139
|
+
//TODO replace this with a more readable Stream code
|
|
140
|
+
for (let i = PushImpl.clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
|
|
141
|
+
let socketClientId = PushImpl.clientIdsByTokens[this.channelToken][i];
|
|
142
|
+
if (document.getElementById(socketClientId)) {
|
|
143
|
+
try {
|
|
144
|
+
(_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onerror']) === null || _b === void 0 ? void 0 : _b.call(_a, message, this.channel, event);
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
//Ignore
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
PushImpl.clientIdsByTokens[this.channelToken].splice(i, 1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (PushImpl.clientIdsByTokens[this.channelToken].length == 0) {
|
|
155
|
+
// tag disappeared
|
|
156
|
+
this.close();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
132
159
|
onmmessage(event) {
|
|
160
|
+
var _a, _b, _c;
|
|
133
161
|
let message = JSON.parse(event.data);
|
|
134
162
|
for (let i = PushImpl.clientIdsByTokens[this.channelToken].length - 1; i >= 0; i--) {
|
|
135
163
|
let socketClientId = PushImpl.clientIdsByTokens[this.channelToken][i];
|
|
136
164
|
if (document.getElementById(socketClientId)) {
|
|
137
165
|
try {
|
|
138
|
-
PushImpl.components[socketClientId]['onmessage'](message, this.channel, event);
|
|
166
|
+
(_b = (_a = PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onmessage']) === null || _b === void 0 ? void 0 : _b.call(_a, message, this.channel, event);
|
|
139
167
|
}
|
|
140
168
|
catch (e) {
|
|
141
169
|
//Ignore
|
|
142
170
|
}
|
|
143
|
-
let behaviors = PushImpl.components[socketClientId]['behaviors'];
|
|
144
|
-
let functions = behaviors[message];
|
|
171
|
+
let behaviors = (_c = PushImpl.components === null || PushImpl.components === void 0 ? void 0 : PushImpl.components[socketClientId]) === null || _c === void 0 ? void 0 : _c['behaviors'];
|
|
172
|
+
let functions = behaviors === null || behaviors === void 0 ? void 0 : behaviors[message];
|
|
145
173
|
if (functions && functions.length) {
|
|
146
174
|
for (let j = 0; j < functions.length; j++) {
|
|
147
175
|
try {
|
|
@@ -163,6 +191,7 @@ var PushImpl;
|
|
|
163
191
|
}
|
|
164
192
|
}
|
|
165
193
|
onclose(event) {
|
|
194
|
+
var _a, _b;
|
|
166
195
|
if (!this.socket
|
|
167
196
|
|| (event.code == 1000 && event.reason == Const_1.REASON_EXPIRED)
|
|
168
197
|
|| (event.code == 1008)
|
|
@@ -171,7 +200,7 @@ var PushImpl;
|
|
|
171
200
|
let clientIds = PushImpl.clientIdsByTokens[this.channelToken];
|
|
172
201
|
for (let i = clientIds.length - 1; i >= 0; i--) {
|
|
173
202
|
let socketClientId = clientIds[i];
|
|
174
|
-
PushImpl.components[socketClientId]['onclose'](event === null || event === void 0 ? void 0 : event.code, this === null || this === void 0 ? void 0 : this.channel, event);
|
|
203
|
+
(_b = (_a = PushImpl.components === null || PushImpl.components === void 0 ? void 0 : PushImpl.components[socketClientId]) === null || _a === void 0 ? void 0 : _a['onclose']) === null || _b === void 0 ? void 0 : _b.call(_a, event === null || event === void 0 ? void 0 : event.code, this === null || this === void 0 ? void 0 : this.channel, event);
|
|
175
204
|
}
|
|
176
205
|
}
|
|
177
206
|
else {
|
|
@@ -193,12 +222,13 @@ var PushImpl;
|
|
|
193
222
|
this.socket.onopen = (event) => this.onopen(event);
|
|
194
223
|
this.socket.onmessage = (event) => this.onmmessage(event);
|
|
195
224
|
this.socket.onclose = (event) => this.onclose(event);
|
|
225
|
+
this.socket.onerror = (event) => this.onerror(event);
|
|
196
226
|
}
|
|
197
227
|
}
|
|
198
228
|
// Private static functions ---------------------------------------------------------------------------------------
|
|
199
229
|
function getBaseURL(url) {
|
|
200
230
|
if (url.indexOf("://") < 0) {
|
|
201
|
-
let base =
|
|
231
|
+
let base = mona_dish_1.DQ.global().location.hostname + ":" + mona_dish_1.DQ.global().location.port;
|
|
202
232
|
return URL_PROTOCOL + base + url;
|
|
203
233
|
}
|
|
204
234
|
else {
|
|
@@ -223,7 +253,7 @@ var PushImpl;
|
|
|
223
253
|
}
|
|
224
254
|
function resolveFunction(fn = () => {
|
|
225
255
|
}) {
|
|
226
|
-
return ((typeof fn !== "function") && (fn =
|
|
256
|
+
return ((typeof fn !== "function") && (fn = mona_dish_1.DQ.global()[fn]), fn);
|
|
227
257
|
}
|
|
228
258
|
})(PushImpl = exports.PushImpl || (exports.PushImpl = {}));
|
|
229
259
|
//# sourceMappingURL=PushImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushImpl.js","sourceRoot":"","sources":["../../src/main/typescript/impl/PushImpl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AACH,wCAAwF;
|
|
1
|
+
{"version":3,"file":"PushImpl.js","sourceRoot":"","sources":["../../src/main/typescript/impl/PushImpl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AACH,wCAAwF;AACxF,yCAA6B;AAE7B;;GAEG;AACH,IAAc,QAAQ,CAwPrB;AAxPD,WAAc,QAAQ;IAElB,MAAM,YAAY,GAAG,cAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;IAGhF,sDAAsD;IACtD,iDAAiD;IAEjD,yBAAyB;IACd,gBAAO,GAAG,EAAE,CAAC;IACxB,sCAAsC;IAC3B,mBAAU,GAAG,EAAE,CAAC;IAC3B,sDAAsD;IAC3C,0BAAiB,GAAG,EAAE,CAAC;IAGlC,qBAAqB;IACrB,SAAgB,KAAK;QACjB,SAAA,OAAO,GAAG,EAAE,CAAC;QACb,SAAA,UAAU,GAAG,EAAE,CAAA;QACf,SAAA,iBAAiB,GAAG,EAAE,CAAA;IAC1B,CAAC;IAJe,cAAK,QAIpB,CAAA;IAED;;OAEG;IAEH;;;;;;;;;;OAUG;IACH,SAAgB,IAAI,CAAC,cAAsB,EACtB,GAAW,EACX,OAAe,EACf,MAAgB,EAChB,SAAmB,EACnB,OAAiB,EACjB,OAAiB,EACjB,SAAc,EACd,WAAoB;;QACrC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAEnC,IAAI,CAAC,cAAE,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS;YACnC,OAAO,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