jsf.js_next_gen 4.1.0-beta.2 → 4.1.0-beta.21
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/AI_CONTRIBUTIONS.md +71 -0
- package/README.md +254 -78
- package/api-extractor.faces.json +38 -0
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/functions/faces.ajax.addOnError.html +2 -2
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -2
- package/dist/docs/functions/faces.ajax.request.html +2 -2
- package/dist/docs/functions/faces.ajax.response.html +2 -2
- package/dist/docs/functions/faces.getClientWindow.html +2 -2
- package/dist/docs/functions/faces.getProjectStage.html +2 -2
- package/dist/docs/functions/faces.getViewState.html +1 -1
- package/dist/docs/functions/faces.push.close.html +1 -1
- package/dist/docs/functions/faces.push.init.html +6 -6
- package/dist/docs/functions/faces.push.open.html +1 -1
- package/dist/docs/functions/faces.util.chain.html +2 -2
- package/dist/docs/functions/myfaces.ab.html +3 -3
- package/dist/docs/functions/myfaces.onDomReady.html +1 -1
- package/dist/docs/functions/myfaces.reserveNamespace.html +1 -1
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +292 -71
- package/dist/docs/interfaces/faces.AjaxData.html +6 -0
- package/dist/docs/interfaces/faces.AjaxError.html +18 -0
- package/dist/docs/interfaces/faces.AjaxEvent.html +8 -0
- package/dist/docs/interfaces/faces.ajax.RequestContext.html +6 -0
- package/dist/docs/interfaces/faces.ajax.RequestOptions.html +10 -0
- package/dist/docs/modules/faces.ajax.html +1 -1
- package/dist/docs/modules/faces.html +1 -1
- package/dist/docs/modules/faces.push.html +1 -1
- package/dist/docs/modules/faces.util.html +1 -1
- package/dist/docs/modules/myfaces.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/faces.AjaxErrorStatus.html +2 -0
- package/dist/docs/types/faces.AjaxEventStatus.html +2 -0
- package/dist/docs/types/faces.ProjectStage.html +2 -0
- package/dist/docs/types/faces.ajax.OnErrorCallback.html +2 -0
- package/dist/docs/types/faces.ajax.OnEventCallback.html +2 -0
- package/dist/docs/types/faces.push.OnCloseHandler.html +2 -0
- package/dist/docs/types/faces.push.OnErrorHandler.html +2 -0
- package/dist/docs/types/faces.push.OnMessageHandler.html +2 -0
- package/dist/docs/types/faces.push.OnOpenHandler.html +2 -0
- package/dist/docs/variables/faces.contextpath.html +1 -1
- package/dist/docs/variables/faces.implversion.html +1 -1
- package/dist/docs/variables/faces.separatorchar.html +1 -1
- package/dist/docs/variables/faces.specversion.html +1 -1
- package/dist/docs/variables/myfaces.oam.html +1 -1
- package/dist/window/faces-development.js +1801 -499
- package/dist/window/faces-development.js.map +1 -1
- package/{target/api/_api.js → dist/window/faces.d.ts} +124 -151
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.LICENSE.txt +0 -17
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +1806 -513
- package/dist/window/jsf-development.js.map +1 -1
- package/{target/src/main/typescript/api/_api.js → dist/window/jsf.d.ts} +125 -153
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.LICENSE.txt +0 -17
- package/dist/window/jsf.js.map +1 -1
- package/package.json +22 -18
- package/scripts/build-dts.mjs +239 -0
- package/src/main/typescript/@types/definitions/index.d.ts +22 -122
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test2.js → src/main/typescript/@types/definitions/modules.d.ts} +18 -2
- package/src/main/typescript/api/_api.ts +132 -29
- package/{target/test/frameworkBase/_ext/monadish/fixtures/test.js → src/main/typescript/api/_api_ae_stub.d.ts} +6 -2
- package/src/main/typescript/api/faces.ts +2 -2
- package/src/main/typescript/api/jsf.ts +15 -23
- package/src/main/typescript/impl/AjaxImpl.ts +15 -15
- package/src/main/typescript/impl/PushImpl.ts +139 -69
- package/src/main/typescript/impl/core/Const.ts +2 -2
- package/src/main/typescript/impl/i18n/Messages.ts +1 -1
- package/src/main/typescript/impl/util/Assertions.ts +1 -2
- package/src/main/typescript/impl/util/AsyncRunnable.ts +3 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +19 -19
- package/src/main/typescript/impl/util/FileUtils.ts +30 -14
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +34 -34
- package/src/main/typescript/impl/util/Lang.ts +19 -22
- package/src/main/typescript/impl/util/XhrQueueController.ts +25 -3
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +17 -12
- package/src/main/typescript/impl/xhrCore/EventData.ts +8 -7
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +3 -3
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +7 -6
- package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
- package/src/main/typescript/impl/xhrCore/ResponseDataResolver.ts +0 -38
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +17 -15
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +72 -63
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -134
- package/src/main/typescript/mona_dish_shim.ts +6 -2
- package/src/main/typescript/myfaces/OamSubmit.ts +10 -6
- package/src/main/typescript/test/api/JsfPushShimTest.spec.ts +126 -0
- package/src/main/typescript/test/api/MyFacesABTest.spec.ts +16 -0
- package/src/main/typescript/test/api/PushTypeCompatibility.ts +65 -0
- package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +16 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +55 -9
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +16 -0
- package/src/main/typescript/test/impl/AssertionsTest.spec.ts +168 -0
- package/src/main/typescript/test/impl/FileUtilsTest.spec.ts +126 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +75 -1
- package/src/main/typescript/test/impl/ResponseDataResolverTest.spec.ts +62 -0
- package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +91 -1
- package/src/main/typescript/test/impl/util/ExtLangTest.spec.ts +110 -0
- package/src/main/typescript/test/impl/util/HiddenInputBuilderTest.spec.ts +74 -0
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +61 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +191 -2
- package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +16 -0
- package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +14 -0
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +21 -5
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +363 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +218 -4
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/WebsocketTest.spec.ts +764 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +265 -62
- package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +16 -0
- package/{target/src/main/typescript/test/xhrCore/FakeWebsocket.js → src/main/typescript/tsconfig.ae.json} +16 -23
- package/src/main/typescript/{tsconfig.json → tsconfig.dts.json} +11 -27
- package/src/main/typescript/tsconfig.test.json +17 -0
- package/tsconfig.api-extractor.json +17 -0
- package/.claude/settings.local.json +0 -16
- package/.github/workflows/codeql-analysis.yml +0 -83
- package/.github/workflows/nodejs.yml +0 -26
- package/.mocharc.json +0 -10
- package/.nyc_output/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
- package/.nyc_output/processinfo/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
- package/.nyc_output/processinfo/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.nycrc +0 -6
- package/build.cmd +0 -1
- package/build.sh +0 -3
- package/mvnw +0 -286
- package/mvnw.cmd +0 -161
- package/plans for 4.0.1.txt +0 -8
- package/remap.ts +0 -51
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +0 -221
- package/target/api/_api.js.map +0 -1
- package/target/api/faces.js +0 -45
- package/target/api/faces.js.map +0 -1
- package/target/api/jsf.js +0 -56
- package/target/api/jsf.js.map +0 -1
- package/target/impl/AjaxImpl.js +0 -748
- package/target/impl/AjaxImpl.js.map +0 -1
- package/target/impl/PushImpl.js +0 -265
- package/target/impl/PushImpl.js.map +0 -1
- package/target/impl/core/Const.js +0 -177
- package/target/impl/core/Const.js.map +0 -1
- package/target/impl/core/ImplTypes.js +0 -38
- package/target/impl/core/ImplTypes.js.map +0 -1
- package/target/impl/i18n/Messages.js +0 -113
- package/target/impl/i18n/Messages.js.map +0 -1
- package/target/impl/util/Assertions.js +0 -101
- package/target/impl/util/Assertions.js.map +0 -1
- package/target/impl/util/AsyncRunnable.js +0 -78
- package/target/impl/util/AsyncRunnable.js.map +0 -1
- package/target/impl/util/ExtDomQuery.js +0 -306
- package/target/impl/util/ExtDomQuery.js.map +0 -1
- package/target/impl/util/FileUtils.js +0 -98
- package/target/impl/util/FileUtils.js.map +0 -1
- package/target/impl/util/HiddenInputBuilder.js +0 -83
- package/target/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/impl/util/IListener.js +0 -3
- package/target/impl/util/IListener.js.map +0 -1
- package/target/impl/util/Lang.js +0 -263
- package/target/impl/util/Lang.js.map +0 -1
- package/target/impl/util/XhrQueueController.js +0 -92
- package/target/impl/util/XhrQueueController.js.map +0 -1
- package/target/impl/xhrCore/ErrorData.js +0 -87
- package/target/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/impl/xhrCore/EventData.js +0 -52
- package/target/impl/xhrCore/EventData.js.map +0 -1
- package/target/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/Response.js +0 -186
- package/target/impl/xhrCore/Response.js.map +0 -1
- package/target/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/impl/xhrCore/XhrFormData.js +0 -163
- package/target/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/impl/xhrCore/XhrRequest.js +0 -433
- package/target/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/mona_dish_shim.js +0 -70
- package/target/mona_dish_shim.js.map +0 -1
- package/target/myfaces/OamSubmit.js +0 -128
- package/target/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/api/_api.js.map +0 -1
- package/target/src/main/typescript/api/faces.js +0 -45
- package/target/src/main/typescript/api/faces.js.map +0 -1
- package/target/src/main/typescript/api/jsf.js +0 -56
- package/target/src/main/typescript/api/jsf.js.map +0 -1
- package/target/src/main/typescript/impl/AjaxImpl.js +0 -748
- package/target/src/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/src/main/typescript/impl/PushImpl.js +0 -265
- package/target/src/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/src/main/typescript/impl/core/Const.js +0 -177
- package/target/src/main/typescript/impl/core/Const.js.map +0 -1
- package/target/src/main/typescript/impl/core/ImplTypes.js +0 -38
- package/target/src/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/src/main/typescript/impl/i18n/Messages.js +0 -113
- package/target/src/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/src/main/typescript/impl/util/Assertions.js +0 -101
- package/target/src/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/src/main/typescript/impl/util/AsyncRunnable.js +0 -78
- package/target/src/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/src/main/typescript/impl/util/ExtDomQuery.js +0 -306
- package/target/src/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/src/main/typescript/impl/util/FileUtils.js +0 -98
- package/target/src/main/typescript/impl/util/FileUtils.js.map +0 -1
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js +0 -83
- package/target/src/main/typescript/impl/util/HiddenInputBuilder.js.map +0 -1
- package/target/src/main/typescript/impl/util/IListener.js +0 -3
- package/target/src/main/typescript/impl/util/IListener.js.map +0 -1
- package/target/src/main/typescript/impl/util/Lang.js +0 -263
- package/target/src/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/src/main/typescript/impl/util/XhrQueueController.js +0 -92
- package/target/src/main/typescript/impl/util/XhrQueueController.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js +0 -87
- package/target/src/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/EventData.js +0 -52
- package/target/src/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/Response.js +0 -186
- package/target/src/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js +0 -104
- package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -468
- package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js +0 -163
- package/target/src/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js +0 -433
- package/target/src/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/src/main/typescript/mona_dish_shim.js +0 -70
- package/target/src/main/typescript/mona_dish_shim.js.map +0 -1
- package/target/src/main/typescript/myfaces/OamSubmit.js +0 -128
- package/target/src/main/typescript/myfaces/OamSubmit.js.map +0 -1
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js +0 -117
- package/target/src/main/typescript/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -2
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest.spec.js +0 -225
- package/target/src/main/typescript/test/impl/ImplTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js +0 -143
- package/target/src/main/typescript/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js +0 -57
- package/target/src/main/typescript/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js +0 -93
- package/target/src/main/typescript/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js +0 -184
- package/target/src/main/typescript/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js +0 -207
- package/target/src/main/typescript/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/api/MyFacesABTest.spec.js +0 -117
- package/target/test/api/MyFacesABTest.spec.js.map +0 -1
- package/target/test/frameworkBase/LangTest.spec.js +0 -123
- package/target/test/frameworkBase/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/fixtures/test2.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +0 -16
- package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js.map +0 -1
- package/target/test/impl/ImplTest.spec.js +0 -225
- package/target/test/impl/ImplTest.spec.js.map +0 -1
- package/target/test/impl/ImplTest_23.spec.js +0 -143
- package/target/test/impl/ImplTest_23.spec.js.map +0 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +0 -106
- package/target/test/impl/SeparatorCharsTest.spec.js.map +0 -1
- package/target/test/impl/util/ExtDomQueryTest.spec.js +0 -77
- package/target/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
- package/target/test/myfaces/OamSubmit.spec.js +0 -118
- package/target/test/myfaces/OamSubmit.spec.js.map +0 -1
- package/target/test/myfaces/OnLoad.spec.js +0 -57
- package/target/test/myfaces/OnLoad.spec.js.map +0 -1
- package/target/test/myfaces/ReserveNamespace.spec.js +0 -60
- package/target/test/myfaces/ReserveNamespace.spec.js.map +0 -1
- package/target/test/queue/AsynchronousProbe.js +0 -93
- package/target/test/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +0 -133
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
- package/target/test/xhrCore/ClientWindow.spec.js +0 -101
- package/target/test/xhrCore/ClientWindow.spec.js.map +0 -1
- package/target/test/xhrCore/ErrorChainTest.spec.js +0 -175
- package/target/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
- package/target/test/xhrCore/EventTests.spec.js +0 -184
- package/target/test/xhrCore/EventTests.spec.js.map +0 -1
- package/target/test/xhrCore/FakeWebsocket.js +0 -38
- package/target/test/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +0 -181
- package/target/test/xhrCore/FileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +0 -199
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +0 -567
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest.spec.js +0 -845
- package/target/test/xhrCore/RequestTest.spec.js.map +0 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +0 -382
- package/target/test/xhrCore/RequestTest_23.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest.spec.js +0 -667
- package/target/test/xhrCore/ResponseTest.spec.js.map +0 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +0 -367
- package/target/test/xhrCore/ResponseTest23.spec.js.map +0 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +0 -123
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
- package/target/test/xhrCore/WebsocketTest.js +0 -207
- package/target/test/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +0 -149
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
- package/target/test/xhrCore/XhrRequestProgress.spec.js +0 -130
- package/target/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead1.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead1.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead2.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead2.js.map +0 -1
- package/target/test/xhrCore/fixtures/addedViewHead3.js +0 -17
- package/target/test/xhrCore/fixtures/addedViewHead3.js.map +0 -1
- package/target/test/xhrCore/fixtures/nonce_script.js +0 -17
- package/target/test/xhrCore/fixtures/nonce_script.js.map +0 -1
- package/tsconfig.json +0 -9
- package/webpack.config.ts +0 -54
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
46
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
47
|
-
* this work for additional information regarding copyright ownership.
|
|
48
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
49
|
-
* (the "License"); you may not use this file except in compliance with
|
|
50
|
-
* the License. You may obtain a copy of the License at
|
|
51
|
-
*
|
|
52
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
53
|
-
*
|
|
54
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
55
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
56
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
57
|
-
* See the License for the specific language governing permissions and
|
|
58
|
-
* limitations under the License.
|
|
59
|
-
*/
|
|
60
|
-
const mocha_1 = require("mocha");
|
|
61
|
-
const sinon = __importStar(require("sinon"));
|
|
62
|
-
const chai_1 = require("chai");
|
|
63
|
-
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
64
|
-
const mona_dish_1 = require("mona-dish");
|
|
65
|
-
const AjaxImpl_1 = require("../../impl/AjaxImpl");
|
|
66
|
-
const defaultFileForm = StandardInits_1.StandardInits.tobagoFileForm;
|
|
67
|
-
const nise = __importStar(require("nise"));
|
|
68
|
-
/**
|
|
69
|
-
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
70
|
-
*/
|
|
71
|
-
(0, mocha_1.describe)('Tests on the xhr core when it starts to call the request', function () {
|
|
72
|
-
let oldFlatMap = null;
|
|
73
|
-
beforeEach(function () {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
let waitForResult = defaultFileForm();
|
|
76
|
-
return waitForResult.then((close) => {
|
|
77
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
78
|
-
this.requests = [];
|
|
79
|
-
this.respond = (response) => {
|
|
80
|
-
let xhrReq = this.requests.shift();
|
|
81
|
-
xhrReq.responsetype = "text/xml";
|
|
82
|
-
xhrReq.respond(200, { 'Content-Type': 'text/xml' }, response);
|
|
83
|
-
return xhrReq;
|
|
84
|
-
};
|
|
85
|
-
this.xhr.onCreate = (xhr) => {
|
|
86
|
-
this.requests.push(xhr);
|
|
87
|
-
};
|
|
88
|
-
global.XMLHttpRequest = this.xhr;
|
|
89
|
-
window.XMLHttpRequest = this.xhr;
|
|
90
|
-
oldFlatMap = Array.prototype["flatMap"];
|
|
91
|
-
window["Es2019Array"] = mona_dish_1._Es2019Array;
|
|
92
|
-
delete Array.prototype["flatMap"];
|
|
93
|
-
this.closeIt = () => {
|
|
94
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
95
|
-
AjaxImpl_1.Implementation.reset();
|
|
96
|
-
close();
|
|
97
|
-
if (oldFlatMap) {
|
|
98
|
-
Array.prototype["flatMap"] = oldFlatMap;
|
|
99
|
-
oldFlatMap = null;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
afterEach(function () {
|
|
106
|
-
this.closeIt();
|
|
107
|
-
});
|
|
108
|
-
(0, mocha_1.it)('tobago file upload', function (done) {
|
|
109
|
-
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
110
|
-
const POST = "POST";
|
|
111
|
-
try {
|
|
112
|
-
let fileUploadField = mona_dish_1.DomQuery.byId("page:fileAjax::field");
|
|
113
|
-
let actionElement = mona_dish_1.DomQuery.byId("page:fileAjax");
|
|
114
|
-
fileUploadField.addEventListener("change", (event) => {
|
|
115
|
-
faces.ajax.request(actionElement, event, {
|
|
116
|
-
"jakarta.faces.behavior.event": "change",
|
|
117
|
-
execute: 'page:fileAjax',
|
|
118
|
-
render: null
|
|
119
|
-
});
|
|
120
|
-
}).dispatchEvent(new Event("change"));
|
|
121
|
-
(0, chai_1.expect)(this.requests.length).to.eq(1);
|
|
122
|
-
let request = this.requests[0];
|
|
123
|
-
(0, chai_1.expect)(request.method).to.eq(POST);
|
|
124
|
-
(0, chai_1.expect)(request.async).to.be.true;
|
|
125
|
-
(0, chai_1.expect)(send.called).to.be.true;
|
|
126
|
-
(0, chai_1.expect)(send.callCount).to.eq(1);
|
|
127
|
-
(0, chai_1.expect)(request.requestBody instanceof FormData).to.be.true;
|
|
128
|
-
let formData = request.requestBody;
|
|
129
|
-
(0, chai_1.expect)(formData.get("page::lastFocusId")).to.eq("");
|
|
130
|
-
(0, chai_1.expect)(formData.get("org.apache.myfaces.tobago.webapp.Secret")).to.eq("secretValue");
|
|
131
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.ViewState")).to.eq("viewStateValue");
|
|
132
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.RenderKitId")).to.eq("tobago");
|
|
133
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.ClientWindow")).to.eq("clientWindowValue");
|
|
134
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.behavior.event")).to.eq("change");
|
|
135
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.partial.event")).to.eq("change");
|
|
136
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.source")).to.eq("page:fileAjax");
|
|
137
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.partial.ajax")).to.eq("true");
|
|
138
|
-
(0, chai_1.expect)(formData.get("page::form")).to.eq("page::form");
|
|
139
|
-
(0, chai_1.expect)(formData.get("jakarta.faces.partial.execute")).to.eq("page:fileAjax");
|
|
140
|
-
}
|
|
141
|
-
finally {
|
|
142
|
-
send.restore();
|
|
143
|
-
}
|
|
144
|
-
done();
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
//# sourceMappingURL=TobagoFileUploadTest.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TobagoFileUploadTest.spec.js","sourceRoot":"","sources":["../../../../../../src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,iCAAmC;AACnC,6CAA+B;AAC/B,+BAA4B;AAC5B,8EAAyE;AACzE,yCAAiD;AACjD,kDAAmD;AACnD,MAAM,eAAe,GAAG,6BAAa,CAAC,cAAc,CAAC;AACrD,2CAA6B;AAG7B;;GAEG;AACH,IAAA,gBAAQ,EAAC,0DAA0D,EAAE;IACnE,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC;;YAET,IAAI,aAAa,GAAG,eAAe,EAAE,CAAC;YACtC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBAElC,IAAI,CAAC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AA4B,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;YACjE,IAAA,aAAM,EAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;YACvD,IAAA,aAAM,EAAC,QAAQ,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;QAE/E,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;QACD,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
46
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
47
|
-
* this work for additional information regarding copyright ownership.
|
|
48
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
49
|
-
* (the "License"); you may not use this file except in compliance with
|
|
50
|
-
* the License. You may obtain a copy of the License at
|
|
51
|
-
*
|
|
52
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
53
|
-
*
|
|
54
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
55
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
56
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
57
|
-
* See the License for the specific language governing permissions and
|
|
58
|
-
* limitations under the License.
|
|
59
|
-
*/
|
|
60
|
-
const mocha_1 = require("mocha");
|
|
61
|
-
const sinon = __importStar(require("sinon"));
|
|
62
|
-
const nise = __importStar(require("nise"));
|
|
63
|
-
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
64
|
-
const AjaxImpl_1 = require("../../impl/AjaxImpl");
|
|
65
|
-
const chai_1 = require("chai");
|
|
66
|
-
const defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
|
|
67
|
-
const mona_dish_1 = require("mona-dish");
|
|
68
|
-
const FakeWebsocket_1 = require("./FakeWebsocket");
|
|
69
|
-
const assertType = mona_dish_1.Lang.assertType;
|
|
70
|
-
(0, mocha_1.describe)('Tests the jsf websocket client side api on high level (generic test without any myfaces dependencies', function () {
|
|
71
|
-
let oldFlatMap = null;
|
|
72
|
-
beforeEach(function () {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
let oldFlatMap = null;
|
|
75
|
-
let waitForResult = defaultMyFaces();
|
|
76
|
-
return waitForResult.then((close) => {
|
|
77
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
78
|
-
this.requests = [];
|
|
79
|
-
this.xhr.onCreate = (xhr) => {
|
|
80
|
-
this.requests.push(xhr);
|
|
81
|
-
};
|
|
82
|
-
global.XMLHttpRequest = this.xhr;
|
|
83
|
-
window.XMLHttpRequest = this.xhr;
|
|
84
|
-
this.jsfAjaxResponse = sinon.stub(global.faces.ajax, "response");
|
|
85
|
-
this.fakeWebsocket = new FakeWebsocket_1.FakeWebsocket();
|
|
86
|
-
this.socket = sinon.stub(window, 'WebSocket').returns(this.fakeWebsocket);
|
|
87
|
-
global.WebSocket = this.socket;
|
|
88
|
-
this.pushImpl = global.PushImpl;
|
|
89
|
-
this.initSpy = sinon.spy(this.pushImpl, "init");
|
|
90
|
-
oldFlatMap = Array.prototype["flatMap"];
|
|
91
|
-
window["Es2019Array"] = mona_dish_1._Es2019Array;
|
|
92
|
-
delete Array.prototype["flatMap"];
|
|
93
|
-
this.closeIt = () => {
|
|
94
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
95
|
-
this.jsfAjaxResponse.restore();
|
|
96
|
-
this.socket.restore();
|
|
97
|
-
this.initSpy.restore();
|
|
98
|
-
delete global.WebSocket;
|
|
99
|
-
AjaxImpl_1.Implementation.reset();
|
|
100
|
-
close();
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
afterEach(function () {
|
|
106
|
-
this.closeIt();
|
|
107
|
-
if (oldFlatMap) {
|
|
108
|
-
Array.prototype["flatMap"] = oldFlatMap;
|
|
109
|
-
oldFlatMap = null;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
it("must register a channel", function (done) {
|
|
113
|
-
/**
|
|
114
|
-
* export function init(socketClientId: string,
|
|
115
|
-
uri: string,
|
|
116
|
-
channel: string,
|
|
117
|
-
onopen: Function,
|
|
118
|
-
onmessage: Function,
|
|
119
|
-
onclose: Function,
|
|
120
|
-
behaviorScripts: any,
|
|
121
|
-
autoconnect: boolean) {
|
|
122
|
-
PushImpl.init(socketClientId, uri, channel, onopen, onmessage, onclose, behaviorScripts, autoconnect);
|
|
123
|
-
}
|
|
124
|
-
*/
|
|
125
|
-
var _a, _b;
|
|
126
|
-
try {
|
|
127
|
-
faces.push.init("clientId1", "booga.ws", "mychannel", () => {
|
|
128
|
-
done();
|
|
129
|
-
}, () => {
|
|
130
|
-
}, () => {
|
|
131
|
-
}, "", true);
|
|
132
|
-
(0, chai_1.expect)(this.initSpy.called).to.be.true;
|
|
133
|
-
let calledArgs = (_b = (_a = this.initSpy) === null || _a === void 0 ? void 0 : _a.getCall(0)) === null || _b === void 0 ? void 0 : _b.args;
|
|
134
|
-
(0, chai_1.expect)(calledArgs[0] == "clientId1").to.be.true;
|
|
135
|
-
(0, chai_1.expect)(calledArgs[1] == "booga.ws").to.be.true;
|
|
136
|
-
(0, chai_1.expect)(calledArgs[2] == "mychannel").to.be.true;
|
|
137
|
-
(0, chai_1.expect)(assertType(calledArgs[3], "function")).to.be.true;
|
|
138
|
-
(0, chai_1.expect)(assertType(calledArgs[4], "function")).to.be.true;
|
|
139
|
-
(0, chai_1.expect)(assertType(calledArgs[5], "function")).to.be.true;
|
|
140
|
-
//implementation specific
|
|
141
|
-
(0, chai_1.expect)("clientId1" in this.pushImpl.components, "a component must be registered").to.be.true;
|
|
142
|
-
(0, chai_1.expect)("booga.ws" in this.pushImpl.sockets, "a socket must be registered").to.be.true;
|
|
143
|
-
}
|
|
144
|
-
finally {
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
it("callbacks must be called", function (done) {
|
|
148
|
-
let openCalled = false;
|
|
149
|
-
let closeCalled = false;
|
|
150
|
-
let messageCalled = false;
|
|
151
|
-
let msg = null;
|
|
152
|
-
let cnl = null;
|
|
153
|
-
new Promise((resolve) => {
|
|
154
|
-
faces.push.init("blarg", "booga.ws", "mychannel", () => {
|
|
155
|
-
openCalled = true;
|
|
156
|
-
this.fakeWebsocket._respond({ data: '"booga"' });
|
|
157
|
-
}, (message, channel) => {
|
|
158
|
-
messageCalled = true;
|
|
159
|
-
msg = message;
|
|
160
|
-
cnl = channel;
|
|
161
|
-
resolve(() => true);
|
|
162
|
-
}, () => {
|
|
163
|
-
closeCalled = true;
|
|
164
|
-
}, "", true);
|
|
165
|
-
}).then(() => {
|
|
166
|
-
(0, chai_1.expect)(openCalled, "Open must have been called due to autoConnect").to.be.true;
|
|
167
|
-
(0, chai_1.expect)(messageCalled, "on a server response the message must have been called").to.be.true;
|
|
168
|
-
(0, chai_1.expect)(msg, "proper message must be passed").to.eq("booga");
|
|
169
|
-
(0, chai_1.expect)(cnl, "proper message must be passed").to.eq("mychannel");
|
|
170
|
-
(0, chai_1.expect)(closeCalled, "websocket still open").to.be.false;
|
|
171
|
-
faces.push.close("blarg");
|
|
172
|
-
(0, chai_1.expect)(closeCalled, "websocket now closed").to.be.true;
|
|
173
|
-
done();
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
it("manual open must work", function (done) {
|
|
177
|
-
let openCalled = false;
|
|
178
|
-
let closeCalled = false;
|
|
179
|
-
let messageCalled = false;
|
|
180
|
-
let msg = null;
|
|
181
|
-
let cnl = null;
|
|
182
|
-
new Promise((resolve) => {
|
|
183
|
-
faces.push.init("blarg", "booga.ws", "mychannel", () => {
|
|
184
|
-
openCalled = true;
|
|
185
|
-
this.fakeWebsocket._respond({ data: '"booga"' });
|
|
186
|
-
}, (message, channel) => {
|
|
187
|
-
messageCalled = true;
|
|
188
|
-
msg = message;
|
|
189
|
-
cnl = channel;
|
|
190
|
-
resolve(() => true);
|
|
191
|
-
}, () => {
|
|
192
|
-
closeCalled = true;
|
|
193
|
-
}, "", false);
|
|
194
|
-
faces.push.open("blarg");
|
|
195
|
-
}).then(() => {
|
|
196
|
-
(0, chai_1.expect)(openCalled, "Open must have been called due to open").to.be.true;
|
|
197
|
-
(0, chai_1.expect)(messageCalled, "on a server response the message must have been called").to.be.true;
|
|
198
|
-
(0, chai_1.expect)(msg, "proper message must be passed").to.eq("booga");
|
|
199
|
-
(0, chai_1.expect)(cnl, "proper message must be passed").to.eq("mychannel");
|
|
200
|
-
(0, chai_1.expect)(closeCalled, "websocket still open").to.be.false;
|
|
201
|
-
faces.push.close("blarg");
|
|
202
|
-
(0, chai_1.expect)(closeCalled, "websocket now closed").to.be.true;
|
|
203
|
-
done();
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
//# sourceMappingURL=WebsocketTest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebsocketTest.js","sourceRoot":"","sources":["../../../../../../src/main/typescript/test/xhrCore/WebsocketTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GA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AC,GAAG,EAAE;YACT,IAAA,aAAM,EAAC,UAAU,EAAE,wCAAwC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAExE,IAAA,aAAM,EAAC,aAAa,EAAE,wDAAwD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAC3F,IAAA,aAAM,EAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAA,aAAM,EAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;YAEhE,IAAA,aAAM,EAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YAExD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1B,IAAA,aAAM,EAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAGvD,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
-
* this work for additional information regarding copyright ownership.
|
|
5
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
-
* (the "License"); you may not use this file except in compliance with
|
|
7
|
-
* the License. You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
51
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
52
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
54
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
55
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
const mocha_1 = require("mocha");
|
|
61
|
-
const mona_dish_1 = require("mona-dish");
|
|
62
|
-
const sinon = __importStar(require("sinon"));
|
|
63
|
-
const XhrFormData_1 = require("../../impl/xhrCore/XhrFormData");
|
|
64
|
-
const chai_1 = require("chai");
|
|
65
|
-
const StandardInits_1 = require("../frameworkBase/_ext/shared/StandardInits");
|
|
66
|
-
const defaultMyFaces = StandardInits_1.StandardInits.defaultMyFaces;
|
|
67
|
-
const AjaxImpl_1 = require("../../impl/AjaxImpl");
|
|
68
|
-
const jsdom = require("jsdom");
|
|
69
|
-
const { JSDOM } = jsdom;
|
|
70
|
-
const nise = __importStar(require("nise"));
|
|
71
|
-
(0, mocha_1.describe)('XhrFormData tests', function () {
|
|
72
|
-
let oldFlatMap = null;
|
|
73
|
-
beforeEach(function () {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
let waitForResult = defaultMyFaces();
|
|
76
|
-
return waitForResult.then((close) => {
|
|
77
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
78
|
-
this.requests = [];
|
|
79
|
-
this.xhr.onCreate = (xhr) => {
|
|
80
|
-
this.requests.push(xhr);
|
|
81
|
-
};
|
|
82
|
-
global.XMLHttpRequest = this.xhr;
|
|
83
|
-
window.XMLHttpRequest = this.xhr;
|
|
84
|
-
this.jsfAjaxResponse = sinon.spy(global.faces.ajax, "response");
|
|
85
|
-
oldFlatMap = Array.prototype["flatMap"];
|
|
86
|
-
window["Es2019Array"] = mona_dish_1._Es2019Array;
|
|
87
|
-
delete Array.prototype["flatMap"];
|
|
88
|
-
this.closeIt = () => {
|
|
89
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
90
|
-
this.jsfAjaxResponse.restore();
|
|
91
|
-
AjaxImpl_1.Implementation.reset();
|
|
92
|
-
close();
|
|
93
|
-
if (oldFlatMap) {
|
|
94
|
-
Array.prototype["flatMap"] = oldFlatMap;
|
|
95
|
-
oldFlatMap = null;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
beforeEach(function () {
|
|
102
|
-
let waitForResult = defaultMyFaces();
|
|
103
|
-
return waitForResult.then((close) => {
|
|
104
|
-
global.window = window;
|
|
105
|
-
global.body = window.document.body;
|
|
106
|
-
global.document = window.document;
|
|
107
|
-
global.body.innerHTML = `
|
|
108
|
-
<div id="id_1"></div>
|
|
109
|
-
<div id="id_2" booga="blarg"></div>
|
|
110
|
-
<div id="id_3"></div>
|
|
111
|
-
<div id="id_4"></div>
|
|
112
|
-
`;
|
|
113
|
-
global.navigator = {
|
|
114
|
-
language: "en-En"
|
|
115
|
-
};
|
|
116
|
-
this.xhr = nise.fakeXhr.useFakeXMLHttpRequest();
|
|
117
|
-
this.requests = [];
|
|
118
|
-
this.xhr.onCreate = (xhr) => {
|
|
119
|
-
this.requests.push(xhr);
|
|
120
|
-
};
|
|
121
|
-
global.XMLHttpRequest = this.xhr;
|
|
122
|
-
window.XMLHttpRequest = this.xhr;
|
|
123
|
-
});
|
|
124
|
-
this.afterEach(function () {
|
|
125
|
-
global.XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
(0, mocha_1.it)("must have multiple values for a name", function () {
|
|
129
|
-
window.document.body.innerHTML = `<form id="page::form">
|
|
130
|
-
<tobago-select-many-checkbox id="page:animals">
|
|
131
|
-
<label for="page:animals">Checkbox Group</label>
|
|
132
|
-
<label><input type="checkbox" name="page:animals" id="page:animals::0" value="Cat" checked="checked">Cat</label>
|
|
133
|
-
<label><input type="checkbox" name="page:animals" id="page:animals::1" value="Dog">Dog</label>
|
|
134
|
-
<label><input type="checkbox" name="page:animals" id="page:animals::2" value="Fox" checked="checked">Fox</label>
|
|
135
|
-
<label><input type="checkbox" name="page:animals" id="page:animals::3" value="Rabbit">Rabbit</label>
|
|
136
|
-
</tobago-select-many-checkbox>
|
|
137
|
-
<div id="page:animalsOutput">
|
|
138
|
-
<label for="page:animalsOutput">Selected Animals</label>
|
|
139
|
-
<span>Cat, Fox</span>
|
|
140
|
-
</div>
|
|
141
|
-
</form>`;
|
|
142
|
-
global.debugf2 = true;
|
|
143
|
-
const xhrFormData = new XhrFormData_1.XhrFormData(mona_dish_1.DQ.byId("page::form"));
|
|
144
|
-
const formData = xhrFormData.toString();
|
|
145
|
-
(0, chai_1.expect)(formData).to.contain("animals=Cat");
|
|
146
|
-
(0, chai_1.expect)(formData).to.contain("animals=Fox");
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
//# sourceMappingURL=XhrFormDataTest.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XhrFormDataTest.spec.js","sourceRoot":"","sources":["../../../../../../src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iCAAmC;AACnC,yCAA2C;AAC3C,6CAA+B;AAC/B,gEAA2D;AAC3D,+BAA4B;AAC5B,8EAAyE;AACzE,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC;AACpD,kDAAmD;AAEnD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,EAAC,KAAK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