jsf.js_next_gen 4.0.0-beta-23 → 4.0.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/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +7 -22
- package/dist/docs/assets/main.js +56 -52
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +23 -0
- package/dist/docs/functions/faces.ajax.addOnError.html +6 -4
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
- package/dist/docs/functions/faces.ajax.request.html +7 -7
- package/dist/docs/functions/faces.ajax.response.html +0 -1
- package/dist/docs/functions/faces.push.close.html +4 -2
- package/dist/docs/functions/faces.push.init.html +19 -7
- package/dist/docs/functions/faces.push.open.html +4 -2
- package/dist/docs/functions/faces.util.chain.html +3 -3
- package/dist/docs/functions/myfaces.ab.html +9 -4
- package/dist/docs/functions/myfaces.onOnDomReady.html +72 -0
- package/dist/docs/index.html +7 -18
- package/dist/docs/modules/myfaces.html +3 -1
- package/dist/docs/variables/myfaces.oam.html +2 -1
- package/dist/window/faces-development.js +2147 -1779
- 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.LICENSE.txt +17 -2
- 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 +2156 -1777
- 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.LICENSE.txt +17 -2
- 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 +19 -18
- package/pom.xml +1 -1
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +24 -7
- package/src/main/typescript/api/_api.ts +79 -37
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +168 -78
- package/src/main/typescript/impl/PushImpl.ts +63 -38
- package/src/main/typescript/impl/core/Const.ts +52 -39
- package/src/main/typescript/impl/util/Assertions.ts +16 -8
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +4 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +58 -45
- package/src/main/typescript/impl/util/FileUtils.ts +104 -0
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
- package/src/main/typescript/impl/util/Lang.ts +30 -31
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
- package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +202 -131
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +79 -166
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -68
- package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +19 -22
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +108 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +242 -11
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +373 -35
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
- package/src/main/typescript/test.xml +6 -0
- package/src/main/typescript/tsconfig.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/src/tmp/test.html +12 -88
- package/target/api/_api.js +72 -31
- 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/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +144 -59
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +66 -35
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +51 -38
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +12 -7
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +58 -40
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +96 -0
- package/target/impl/util/FileUtils.js.map +1 -0
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +79 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/impl/util/Lang.js +29 -30
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/URLCodec.js +77 -0
- package/target/impl/util/URLCodec.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +82 -0
- package/target/impl/util/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +10 -8
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +1 -1
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +70 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +44 -29
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +182 -116
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +68 -156
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrQueHandler.js +11 -0
- package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
- package/target/impl/xhrCore/XhrQueueController.js +62 -0
- package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +68 -59
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +23 -14
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +16 -16
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +100 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/myfaces/OnLoadSpec.js +57 -0
- package/target/test/myfaces/OnLoadSpec.js.map +1 -0
- package/target/test/xhrCore/EventTests.spec.js +1 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +217 -9
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +34 -2
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +308 -24
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/target/types/index.js +0 -18
- package/target/types/index.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
* this work for additional information regarding copyright ownership.
|
|
4
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
5
|
+
* (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import {describe, it} from "mocha";
|
|
17
|
+
import * as sinon from "sinon";
|
|
18
|
+
import {expect} from "chai";
|
|
19
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
20
|
+
import {DomQuery} from "mona-dish";
|
|
21
|
+
import {Implementation} from "../../impl/AjaxImpl";
|
|
22
|
+
import defaultFileForm = StandardInits.tobagoFileForm;
|
|
23
|
+
|
|
24
|
+
declare var faces: any;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
28
|
+
*/
|
|
29
|
+
describe('Tests on the xhr core when it starts to call the request', function () {
|
|
30
|
+
beforeEach(async function () {
|
|
31
|
+
|
|
32
|
+
let waitForResult = defaultFileForm();
|
|
33
|
+
return waitForResult.then((close) => {
|
|
34
|
+
|
|
35
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
36
|
+
this.requests = [];
|
|
37
|
+
|
|
38
|
+
this.respond = (response: string): XMLHttpRequest => {
|
|
39
|
+
let xhrReq = this.requests.shift();
|
|
40
|
+
xhrReq.responsetype = "text/xml";
|
|
41
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, response);
|
|
42
|
+
return xhrReq;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
this.xhr.onCreate = (xhr) => {
|
|
46
|
+
this.requests.push(xhr);
|
|
47
|
+
};
|
|
48
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
49
|
+
window.XMLHttpRequest = this.xhr;
|
|
50
|
+
|
|
51
|
+
this.closeIt = () => {
|
|
52
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
53
|
+
Implementation.reset();
|
|
54
|
+
close();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
});
|
|
59
|
+
afterEach(function () {
|
|
60
|
+
this.closeIt();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('tobago file upload', function (done) {
|
|
64
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
65
|
+
|
|
66
|
+
const POST = "POST";
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
let fileUploadField = DomQuery.byId("page:fileAjax::field");
|
|
70
|
+
let actionElement = DomQuery.byId("page:fileAjax");
|
|
71
|
+
|
|
72
|
+
fileUploadField.addEventListener("change", (event: Event) => {
|
|
73
|
+
faces.ajax.request(
|
|
74
|
+
actionElement,
|
|
75
|
+
event,
|
|
76
|
+
{
|
|
77
|
+
"javax.faces.behavior.event": "change",
|
|
78
|
+
execute: 'page:fileAjax',
|
|
79
|
+
render: null
|
|
80
|
+
});
|
|
81
|
+
}).dispatchEvent(new Event("change"));
|
|
82
|
+
|
|
83
|
+
expect(this.requests.length).to.eq(1);
|
|
84
|
+
let request = this.requests[0];
|
|
85
|
+
expect(request.method).to.eq(POST);
|
|
86
|
+
expect(request.async).to.be.true;
|
|
87
|
+
expect(send.called).to.be.true;
|
|
88
|
+
expect(send.callCount).to.eq(1);
|
|
89
|
+
expect(request.requestBody instanceof FormData).to.be.true;
|
|
90
|
+
|
|
91
|
+
let formData: FormData = request.requestBody;
|
|
92
|
+
expect(formData.get("page::lastFocusId")).to.eq("");
|
|
93
|
+
expect(formData.get("org.apache.myfaces.tobago.webapp.Secret")).to.eq("secretValue");
|
|
94
|
+
expect(formData.get("javax.faces.ViewState")).to.eq("viewStateValue");
|
|
95
|
+
expect(formData.get("javax.faces.RenderKitId")).to.eq("tobago");
|
|
96
|
+
expect(formData.get("javax.faces.ClientWindow")).to.eq("clientWindowValue");
|
|
97
|
+
expect(formData.get("javax.faces.behavior.event")).to.eq("change");
|
|
98
|
+
expect(formData.get("jakarta.faces.partial.event")).to.eq("change");
|
|
99
|
+
expect(formData.get("jakarta.faces.source")).to.eq("page:fileAjax");
|
|
100
|
+
expect(formData.get("jakarta.faces.partial.ajax")).to.eq("true");
|
|
101
|
+
expect(formData.get("page::form")).to.eq("page::form");
|
|
102
|
+
expect(formData.get("jakarta.faces.partial.execute")).to.eq("page:fileAjax");
|
|
103
|
+
|
|
104
|
+
} finally {
|
|
105
|
+
send.restore();
|
|
106
|
+
}
|
|
107
|
+
done();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -19,58 +19,75 @@ import {DQ} from "mona-dish";
|
|
|
19
19
|
import * as sinon from 'sinon';
|
|
20
20
|
import {XhrFormData} from "../../impl/xhrCore/XhrFormData";
|
|
21
21
|
import {expect} from "chai";
|
|
22
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
23
|
+
import defaultMyFaces = StandardInits.defaultMyFaces;
|
|
24
|
+
import {Implementation} from "../../impl/AjaxImpl";
|
|
22
25
|
|
|
23
26
|
const jsdom = require("jsdom");
|
|
24
27
|
const {JSDOM} = jsdom;
|
|
25
28
|
|
|
26
29
|
describe('XhrFormData tests', function () {
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
beforeEach(async function () {
|
|
32
|
+
|
|
33
|
+
let waitForResult = defaultMyFaces();
|
|
34
|
+
|
|
35
|
+
return waitForResult.then((close) => {
|
|
36
|
+
|
|
37
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
38
|
+
this.requests = [];
|
|
39
|
+
this.xhr.onCreate = (xhr) => {
|
|
40
|
+
this.requests.push(xhr);
|
|
41
|
+
};
|
|
42
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
43
|
+
window.XMLHttpRequest = this.xhr;
|
|
44
|
+
|
|
45
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).faces.ajax, "response");
|
|
46
|
+
|
|
47
|
+
this.closeIt = () => {
|
|
48
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
49
|
+
this.jsfAjaxResponse.restore();
|
|
50
|
+
Implementation.reset();
|
|
51
|
+
close();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
});
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
56
|
+
beforeEach(function () {
|
|
57
|
+
|
|
58
|
+
let waitForResult = defaultMyFaces();
|
|
59
|
+
|
|
60
|
+
return waitForResult.then((close) => {
|
|
61
|
+
(<any>global).window = window;
|
|
62
|
+
(<any>global).body = window.document.body;
|
|
63
|
+
(<any>global).document = window.document;
|
|
64
|
+
global.body.innerHTML = `
|
|
65
|
+
<div id="id_1"></div>
|
|
66
|
+
<div id="id_2" booga="blarg"></div>
|
|
67
|
+
<div id="id_3"></div>
|
|
68
|
+
<div id="id_4"></div>
|
|
69
|
+
`;
|
|
70
|
+
(<any>global).navigator = {
|
|
71
|
+
language: "en-En"
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
75
|
+
this.requests = [];
|
|
76
|
+
this.xhr.onCreate = (xhr) => {
|
|
77
|
+
this.requests.push(xhr);
|
|
78
|
+
};
|
|
79
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
80
|
+
window.XMLHttpRequest = this.xhr;
|
|
81
|
+
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
this.afterEach(function () {
|
|
85
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("must have multiple values for a name", function () {
|
|
90
|
+
window.document.body.innerHTML = `<form id="page::form">
|
|
74
91
|
<tobago-select-many-checkbox id="page:animals">
|
|
75
92
|
<label for="page:animals">Checkbox Group</label>
|
|
76
93
|
<label><input type="checkbox" name="page:animals" id="page:animals::0" value="Cat" checked="checked">Cat</label>
|
|
@@ -84,10 +101,11 @@ describe('XhrFormData tests', function () {
|
|
|
84
101
|
</div>
|
|
85
102
|
</form>`;
|
|
86
103
|
|
|
87
|
-
|
|
88
|
-
|
|
104
|
+
global.debugf2 = true;
|
|
105
|
+
const xhrFormData = new XhrFormData(DQ.byId("page::form"));
|
|
106
|
+
const formData = xhrFormData.toString();
|
|
89
107
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
108
|
+
expect(formData).to.contain("animals=Cat");
|
|
109
|
+
expect(formData).to.contain("animals=Fox");
|
|
110
|
+
});
|
|
93
111
|
});
|
|
@@ -3121,7 +3121,7 @@ var XhrFormData = /** @class */ (function (_super) {
|
|
|
3121
3121
|
*/
|
|
3122
3122
|
XhrFormData.prototype.assignEncodedString = function (encoded) {
|
|
3123
3123
|
var keyValueEntries = decodeURIComponent(encoded).split(/&/gi);
|
|
3124
|
-
this.
|
|
3124
|
+
this.assignKeyValueEntries(keyValueEntries);
|
|
3125
3125
|
};
|
|
3126
3126
|
XhrFormData.prototype.assignString = function (keyValueEntries) {
|
|
3127
3127
|
var toMerge = new mona_dish_1.Config({});
|
package/src/tmp/test.html
CHANGED
|
@@ -1,92 +1,16 @@
|
|
|
1
|
-
<h2>protocol testcase1</h2>
|
|
2
|
-
|
|
3
|
-
<div id="centerDiv">
|
|
4
|
-
|
|
5
|
-
<h1>Selenium Testprobe for insert update delete and attribute change</h1>
|
|
6
|
-
|
|
7
|
-
<h2>This test tests all aspects of the protocol, under xhr and iframe conditions</h2>
|
|
8
|
-
|
|
9
|
-
<div id="testResults">
|
|
10
|
-
|
|
11
|
-
<h3>Test Results</h3>
|
|
12
|
-
|
|
13
|
-
<div id="evalarea1">booga</div>
|
|
14
|
-
|
|
15
|
-
<div id="evalarea2">eval area 2 triggered by update</div>
|
|
16
|
-
|
|
17
|
-
<div id="evalarea3">eval area 3 triggered by insert</div>
|
|
18
|
-
|
|
19
|
-
<div id="evalarea4">eval area 4 triggered by a click on the changed attributes area</div>
|
|
20
|
-
|
|
21
|
-
<div id="changesArea">update insert area</div>
|
|
22
|
-
|
|
23
|
-
<div id="deleteable">delete area will be deleted once you press the delete button</div>
|
|
24
|
-
|
|
25
|
-
<div id="attributeChange">attributes changes area</div>
|
|
26
|
-
|
|
27
|
-
<div id="resource_area_1"></div>
|
|
28
|
-
<div id="resource_area_2"></div>
|
|
29
|
-
<div id="resource_area_3"></div>
|
|
30
|
-
<script nonce="test12d3" type="text/javascript" src="../../../xhrCore/fixtures/nonce_script.js"></script>
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<h2>Call actions via normal ppr</h2>
|
|
35
|
-
|
|
36
|
-
<form id="form1" action="./test.mockup">
|
|
37
|
-
|
|
38
|
-
<input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb">
|
|
39
|
-
|
|
40
|
-
<input type="button" id="cmd_eval" value="eval"
|
|
41
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'eval1');">
|
|
42
|
-
|
|
43
|
-
<input type="button" id="cmd_update_insert" value="update insert"
|
|
44
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert1');">
|
|
45
|
-
|
|
46
|
-
<input type="button" id="cmd_simple_resource" value="simple resource"
|
|
47
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'simpleresource');">
|
|
48
|
-
|
|
49
|
-
<input type="button" id="cmd_complex_resource" value="complex resource"
|
|
50
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource');">
|
|
51
|
-
|
|
52
|
-
<input type="button" id="cmd_complex_resource2" value="complex resource2"
|
|
53
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource2');">
|
|
54
|
-
|
|
55
|
-
<input type="button" id="cmd_update_insert2" value="update insert second protocol path"
|
|
56
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert2');">
|
|
57
|
-
|
|
58
|
-
<input type="button" id="cmd_delete" value="delete"
|
|
59
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'delete1');">
|
|
60
|
-
|
|
61
|
-
<input type="button" id="cmd_replace" value="Replace Body"
|
|
62
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'body_replace1');">
|
|
63
|
-
|
|
64
|
-
<input type="button" id="cmd_attributeschange" value="change attributes"
|
|
65
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'attributes');">
|
|
66
|
-
|
|
67
|
-
<input type="button" id="cmd_illegalresponse" value="illegal response, error trigger"
|
|
68
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'illegalResponse');">
|
|
69
|
-
|
|
70
|
-
<input type="button" id="cmd_viewstate" value="Viewstate only update trigger"
|
|
71
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'viewstate');">
|
|
72
|
-
|
|
73
|
-
<input type="button" id="cmd_error" value="Server error with error response"
|
|
74
|
-
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'errors');">
|
|
75
|
-
|
|
76
|
-
<input type="button" id="cmd_error_component" value="Error: no component given"
|
|
77
|
-
onclick="(window.faces || window.jsf).ajax.request(null, event, {}); return false">
|
|
78
1
|
|
|
2
|
+
<div id="viewroot_1">
|
|
3
|
+
<form id="viewroot_1:form1">
|
|
4
|
+
<button type="submit" id="viewroot_1:submit_1"></button>
|
|
5
|
+
<input type="hidden" id="viewroot_1:form1:jakarta.faces.ViewState:1" name="jakarta.faces.ViewState" value="updatedVST">
|
|
79
6
|
</form>
|
|
7
|
+
<form id="viewroot_1:form2">
|
|
8
|
+
<button type="submit" id="viewroot_1:submit_2"></button>
|
|
9
|
+
</form>
|
|
10
|
+
</div>
|
|
80
11
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function emitPPR(source, event, action, useIframe, formName) {
|
|
87
|
-
document.getElementById(formName || "form1").action = target;
|
|
88
|
-
|
|
89
|
-
(window?.faces ?? window.jsf).ajax.request(/*String|Dom Node*/ source, /*|EVENT|*/ (window.event) ? window.event : event, /*{|OPTIONS|}*/ {op: action});
|
|
90
|
-
}
|
|
91
|
-
</script>
|
|
12
|
+
<div id="viewroot_2">
|
|
13
|
+
<form id="viewroot_2:form1">
|
|
14
|
+
<button type="submit" id="viewroot_1:submit_2"></button>
|
|
15
|
+
</form>
|
|
92
16
|
</div>
|
package/target/api/_api.js
CHANGED
|
@@ -47,9 +47,9 @@ var faces;
|
|
|
47
47
|
faces.implversion = 0;
|
|
48
48
|
/**
|
|
49
49
|
* SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()
|
|
50
|
-
* @type {Char}
|
|
51
50
|
*/
|
|
52
51
|
faces.separatorchar = getSeparatorChar();
|
|
52
|
+
// noinspection JSUnusedGlobalSymbols
|
|
53
53
|
/**
|
|
54
54
|
* Context Path as defined externalContext.requestContextPath
|
|
55
55
|
*/
|
|
@@ -95,7 +95,7 @@ var faces;
|
|
|
95
95
|
return AjaxImpl_1.Implementation.getClientWindow(rootNode);
|
|
96
96
|
}
|
|
97
97
|
faces.getClientWindow = getClientWindow;
|
|
98
|
-
//private helper functions
|
|
98
|
+
// private helper functions
|
|
99
99
|
function getSeparatorChar() {
|
|
100
100
|
const sep = '#{facesContext.namingContainerSeparatorChar}';
|
|
101
101
|
//We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior
|
|
@@ -109,12 +109,12 @@ var faces;
|
|
|
109
109
|
/**
|
|
110
110
|
* this function has to send the ajax requests
|
|
111
111
|
*
|
|
112
|
-
* following
|
|
112
|
+
* following request conditions must be met:
|
|
113
113
|
* <ul>
|
|
114
|
-
* <li> the
|
|
115
|
-
* <li> the
|
|
116
|
-
* <li> the
|
|
117
|
-
* <li> all requests must be queued with a client side
|
|
114
|
+
* <li> the request must be sent asynchronously! </li>
|
|
115
|
+
* <li> the request must be a POST!!! request </li>
|
|
116
|
+
* <li> the request url must be the form action attribute </li>
|
|
117
|
+
* <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
|
|
118
118
|
* </ul>
|
|
119
119
|
*
|
|
120
120
|
* @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
|
|
@@ -130,7 +130,6 @@ var faces;
|
|
|
130
130
|
* @param request the request object having triggered this response
|
|
131
131
|
* @param context the request context
|
|
132
132
|
*
|
|
133
|
-
* TODO add info on what can be in the context
|
|
134
133
|
*/
|
|
135
134
|
function response(request, context) {
|
|
136
135
|
AjaxImpl_1.Implementation.response(request, context);
|
|
@@ -145,13 +144,13 @@ var faces;
|
|
|
145
144
|
* <li> errorData.status : the error status message</li>
|
|
146
145
|
* <li> errorData.serverErrorName : the server error name in case of a server error</li>
|
|
147
146
|
* <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
|
|
148
|
-
* <li> errorData.source : the issuing source element which triggered the
|
|
149
|
-
* <li> eventData.responseCode: the response code (aka http
|
|
150
|
-
* <li> eventData.responseText: the
|
|
151
|
-
* <li> eventData.responseXML: the
|
|
147
|
+
* <li> errorData.source : the issuing source element which triggered the request </li>
|
|
148
|
+
* <li> eventData.responseCode: the response code (aka http request response code, 401 etc...) </li>
|
|
149
|
+
* <li> eventData.responseText: the request response text </li>
|
|
150
|
+
* <li> eventData.responseXML: the request response xml </li>
|
|
152
151
|
* </ul>
|
|
153
152
|
*
|
|
154
|
-
* @param
|
|
153
|
+
* @param errorFunc error handler must be of the format <i>function errorListener(<errorData>)</i>
|
|
155
154
|
*/
|
|
156
155
|
function addOnError(errorFunc) {
|
|
157
156
|
AjaxImpl_1.Implementation.addOnError(errorFunc);
|
|
@@ -161,7 +160,7 @@ var faces;
|
|
|
161
160
|
* Adds a global event listener to the ajax event queue. The event listener must be a function
|
|
162
161
|
* of following format: <i>function eventListener(<eventData>)</i>
|
|
163
162
|
*
|
|
164
|
-
* @param
|
|
163
|
+
* @param eventFunc event must be of the format <i>function eventListener(<eventData>)</i>
|
|
165
164
|
*/
|
|
166
165
|
function addOnEvent(eventFunc) {
|
|
167
166
|
AjaxImpl_1.Implementation.addOnEvent(eventFunc);
|
|
@@ -176,7 +175,7 @@ var faces;
|
|
|
176
175
|
* if any of the code returns false, the execution
|
|
177
176
|
* is terminated prematurely skipping the rest of the code!
|
|
178
177
|
*
|
|
179
|
-
* @param {
|
|
178
|
+
* @param {HTMLElement | String} source, the callee object
|
|
180
179
|
* @param {Event} event, the event object of the callee event triggering this function
|
|
181
180
|
* @param funcs ... arbitrary array of functions or strings
|
|
182
181
|
* @returns true if the chain has succeeded false otherwise
|
|
@@ -189,19 +188,24 @@ var faces;
|
|
|
189
188
|
let push;
|
|
190
189
|
(function (push) {
|
|
191
190
|
/**
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
195
|
-
* @param
|
|
191
|
+
* @param socketClientId the sockets client identifier
|
|
192
|
+
* @param url the uri to reach the socket
|
|
193
|
+
* @param channel the channel name/id
|
|
194
|
+
* @param onopen The function to be invoked when the web socket is opened.
|
|
195
|
+
* @param onmessage The function to be invoked when a message is received.
|
|
196
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
197
|
+
* @param onclose The function to be invoked when the web socket is closed.
|
|
198
|
+
* @param behaviors functions which are invoked whenever a message is received
|
|
199
|
+
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
196
200
|
*/
|
|
197
|
-
function init(socketClientId,
|
|
198
|
-
PushImpl_1.PushImpl.init(socketClientId,
|
|
201
|
+
function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
|
|
202
|
+
PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
|
|
199
203
|
}
|
|
200
204
|
push.init = init;
|
|
201
205
|
/**
|
|
202
206
|
* Open the web socket on the given channel.
|
|
203
|
-
* @param
|
|
204
|
-
* @throws
|
|
207
|
+
* @param socketClientId The name of the web socket channel.
|
|
208
|
+
* @throws Error is thrown, if the channel is unknown.
|
|
205
209
|
*/
|
|
206
210
|
function open(socketClientId) {
|
|
207
211
|
PushImpl_1.PushImpl.open(socketClientId);
|
|
@@ -209,8 +213,8 @@ var faces;
|
|
|
209
213
|
push.open = open;
|
|
210
214
|
/**
|
|
211
215
|
* Close the web socket on the given channel.
|
|
212
|
-
* @param
|
|
213
|
-
* @throws
|
|
216
|
+
* @param socketClientId The id of the web socket client.
|
|
217
|
+
* @throws Error is thrown, if the channel is unknown.
|
|
214
218
|
*/
|
|
215
219
|
function close(socketClientId) {
|
|
216
220
|
PushImpl_1.PushImpl.close(socketClientId);
|
|
@@ -229,23 +233,60 @@ var myfaces;
|
|
|
229
233
|
* @param event the event
|
|
230
234
|
* @param eventName event name for java.jakarta.faces.behavior.evemnt
|
|
231
235
|
* @param execute execute list as passed down in faces.ajax.request
|
|
232
|
-
* @param render
|
|
233
|
-
* @param options
|
|
236
|
+
* @param render the render list as string
|
|
237
|
+
* @param options the options which need to be mered in
|
|
234
238
|
*/
|
|
235
239
|
function ab(source, event, eventName, execute, render, options = {}) {
|
|
236
|
-
var _a;
|
|
240
|
+
var _a, _b;
|
|
237
241
|
if (eventName) {
|
|
238
|
-
options[(0
|
|
242
|
+
options[Const_1.CTX_OPTIONS_PARAMS] = (_a = options === null || options === void 0 ? void 0 : options[Const_1.CTX_OPTIONS_PARAMS]) !== null && _a !== void 0 ? _a : {};
|
|
243
|
+
options[Const_1.CTX_OPTIONS_PARAMS][(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
|
|
239
244
|
}
|
|
240
245
|
if (execute) {
|
|
241
|
-
options[Const_1.
|
|
246
|
+
options[Const_1.CTX_OPTIONS_EXECUTE] = execute;
|
|
242
247
|
}
|
|
243
248
|
if (render) {
|
|
244
249
|
options[Const_1.CTX_PARAM_RENDER] = render;
|
|
245
250
|
}
|
|
246
|
-
((
|
|
251
|
+
((_b = window === null || window === void 0 ? void 0 : window.faces) !== null && _b !== void 0 ? _b : window.jsf).ajax.request(source, event, options);
|
|
247
252
|
}
|
|
248
253
|
myfaces.ab = ab;
|
|
254
|
+
const onReadyChain = [];
|
|
255
|
+
let readyStateListener = null;
|
|
256
|
+
// noinspection JSUnusedGlobalSymbols
|
|
257
|
+
/**
|
|
258
|
+
* Helper function in the myfaces namespace to handle document ready properly for the load case
|
|
259
|
+
* the ajax case, does not need proper treatment, since it is deferred anyway.
|
|
260
|
+
* Used by command script as helper function!
|
|
261
|
+
*
|
|
262
|
+
* @param executionFunc the function to be executed upon ready
|
|
263
|
+
*/
|
|
264
|
+
function onOnDomReady(executionFunc) {
|
|
265
|
+
if (document.readyState !== "complete") {
|
|
266
|
+
onReadyChain.push(executionFunc);
|
|
267
|
+
if (!readyStateListener) {
|
|
268
|
+
readyStateListener = () => {
|
|
269
|
+
window.removeEventListener("DOMContentLoaded", readyStateListener);
|
|
270
|
+
readyStateListener = null;
|
|
271
|
+
try {
|
|
272
|
+
onReadyChain.forEach(func => func());
|
|
273
|
+
}
|
|
274
|
+
finally {
|
|
275
|
+
//done we clear now the ready chain
|
|
276
|
+
onReadyChain.length = 0;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
window.addEventListener("DOMContentLoaded", readyStateListener);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
if (readyStateListener) {
|
|
284
|
+
readyStateListener();
|
|
285
|
+
}
|
|
286
|
+
executionFunc();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
myfaces.onOnDomReady = onOnDomReady;
|
|
249
290
|
/**
|
|
250
291
|
* legacy oam functions
|
|
251
292
|
*/
|
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,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AACjD,8CAAqH;AAIrH,4EAA4E;AAC5E,yBAAyB;AACzB,IAAc,KAAK,CAsNlB;AAtND,WAAc,KAAK;IAGf;;;;;;;;;;OAUG;IACQ,iBAAW,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACQ,iBAAW,GAAG,CAAC,CAAC;IAE3B;;OAEG;IACQ,mBAAa,GAAW,gBAAgB,EAAE,CAAC;IAEtD,qCAAqC;IACrC;;OAEG;IACQ,iBAAW,GAAW,oDAAoD,CAAC;IACtF,0CAA0C;IAE1C;;;;;;;;;;;;;;OAcG;IACH,SAAgB,eAAe;QAC3B,OAAO,yBAAc,CAAC,eAAe,EAAE,CAAC;IA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AAC,CAAC;qBACxC;4BAAS;wBACN,mCAAmC;wBACnC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;qBAC3B;gBACL,CAAC,CAAC;gBACF,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;aACnE;SACJ;aAAM;YACH,IAAG,kBAAkB,EAAE;gBACnB,kBAAkB,EAAE,CAAC;aACxB;YACD,aAAa,EAAE,CAAC;SACnB;IAEL,CAAC;IAvBe,oBAAY,eAuB3B,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EApEa,OAAO,GAAP,eAAO,KAAP,eAAO,QAoEpB"}
|
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":[],"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