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
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
import {describe} from "mocha";
|
|
18
|
+
import * as sinon from "sinon";
|
|
19
|
+
import {expect} from "chai";
|
|
20
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
+
import {FakeWebsocket} from "../xhrCore/FakeWebsocket";
|
|
22
|
+
|
|
23
|
+
const defaultMyFaces23 = StandardInits.defaultMyFaces23;
|
|
24
|
+
|
|
25
|
+
describe("JSF 2.3 push compatibility shim", function () {
|
|
26
|
+
beforeEach(async function () {
|
|
27
|
+
return defaultMyFaces23().then((close) => {
|
|
28
|
+
this.fakeWebsocket = new FakeWebsocket();
|
|
29
|
+
this.socket = sinon.stub(window, 'WebSocket').returns(this.fakeWebsocket);
|
|
30
|
+
(global as any).WebSocket = this.socket;
|
|
31
|
+
this.pushImpl = (global as any).PushImpl;
|
|
32
|
+
this.initSpy = sinon.spy(this.pushImpl, "init");
|
|
33
|
+
this.closeIt = () => {
|
|
34
|
+
this.initSpy.restore();
|
|
35
|
+
this.socket.restore();
|
|
36
|
+
delete (global as any).WebSocket;
|
|
37
|
+
this.pushImpl.reset();
|
|
38
|
+
close();
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterEach(function () {
|
|
44
|
+
this.closeIt();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("must adapt legacy jsf.push.init without onerror to the Faces 4 init signature", function () {
|
|
48
|
+
const onopen = () => {};
|
|
49
|
+
const onmessage = () => {};
|
|
50
|
+
const onclose = () => {};
|
|
51
|
+
const behaviors = {"event": [() => {}]};
|
|
52
|
+
|
|
53
|
+
window.jsf.push.init("blarg", "booga.ws", "mychannel",
|
|
54
|
+
onopen,
|
|
55
|
+
onmessage,
|
|
56
|
+
onclose,
|
|
57
|
+
behaviors,
|
|
58
|
+
false
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
expect(this.initSpy.calledOnce).to.be.true;
|
|
62
|
+
const args = this.initSpy.firstCall.args;
|
|
63
|
+
expect(args[0]).to.eq("blarg");
|
|
64
|
+
expect(args[1]).to.eq("booga.ws");
|
|
65
|
+
expect(args[2]).to.eq("mychannel");
|
|
66
|
+
expect(args[3]).to.eq(onopen);
|
|
67
|
+
expect(args[4]).to.eq(onmessage);
|
|
68
|
+
expect(args[5], "legacy shim must pass null for Faces 4 onerror").to.eq(null);
|
|
69
|
+
expect(args[6]).to.eq(onclose);
|
|
70
|
+
expect(args[7]).to.eq(behaviors);
|
|
71
|
+
expect(args[8]).to.eq(false);
|
|
72
|
+
expect(args.length).to.eq(9);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("must route legacy terminal close through onclose", function () {
|
|
76
|
+
let closeCalled = false;
|
|
77
|
+
let closeCode: any = null;
|
|
78
|
+
let closeChannel: any = null;
|
|
79
|
+
let closeEvent: any = null;
|
|
80
|
+
|
|
81
|
+
window.jsf.push.init("blarg", "booga.ws", "mychannel",
|
|
82
|
+
() => {},
|
|
83
|
+
() => {},
|
|
84
|
+
(code: number, channel: string, event: any) => {
|
|
85
|
+
closeCalled = true;
|
|
86
|
+
closeCode = code;
|
|
87
|
+
closeChannel = channel;
|
|
88
|
+
closeEvent = event;
|
|
89
|
+
},
|
|
90
|
+
"",
|
|
91
|
+
true
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const event = {code: 1000, reason: "Normal Closure"};
|
|
95
|
+
this.fakeWebsocket._close(event);
|
|
96
|
+
|
|
97
|
+
expect(closeCalled, "legacy jsf.push terminal close must call onclose").to.be.true;
|
|
98
|
+
expect(closeCode).to.eq(1000);
|
|
99
|
+
expect(closeChannel).to.eq("mychannel");
|
|
100
|
+
expect(closeEvent).to.eq(event);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("must keep legacy reconnectable broken connection internal without calling onclose", function () {
|
|
104
|
+
const clock = sinon.useFakeTimers();
|
|
105
|
+
let closeCalled = false;
|
|
106
|
+
let openCount = 0;
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
window.jsf.push.init("blarg", "booga.ws", "mychannel",
|
|
110
|
+
() => { openCount++; },
|
|
111
|
+
() => {},
|
|
112
|
+
() => { closeCalled = true; },
|
|
113
|
+
"",
|
|
114
|
+
true
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
this.fakeWebsocket.onopen({});
|
|
118
|
+
this.fakeWebsocket._close({code: 1006, reason: "abnormal"});
|
|
119
|
+
|
|
120
|
+
expect(openCount, "legacy onopen must fire for the first connection attempt").to.eq(1);
|
|
121
|
+
expect(closeCalled, "legacy onclose must not fire while reconnect is possible").to.be.false;
|
|
122
|
+
} finally {
|
|
123
|
+
clock.restore();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
import {describe} from "mocha";
|
|
2
18
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
3
19
|
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
|
|
18
|
+
import type { faces } from '../../api/_api';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Compatibility interface covering both the faces 9-param form (with onerror)
|
|
22
|
+
* and the JSF 2.3 8-param form (without onerror). Both must be callable so
|
|
23
|
+
* that the runtime implementation works correctly in both the faces and JSF realms.
|
|
24
|
+
* This file is never executed — tsc rejecting it signals a broken signature.
|
|
25
|
+
*/
|
|
26
|
+
interface PushCompat {
|
|
27
|
+
init(socketClientId: string, url: string, channel: string,
|
|
28
|
+
onopen: faces.push.OnOpenHandler | string | null,
|
|
29
|
+
onmessage: faces.push.OnMessageHandler | string | null,
|
|
30
|
+
onerror: faces.push.OnErrorHandler | string | null,
|
|
31
|
+
onclose: faces.push.OnCloseHandler | string | null,
|
|
32
|
+
behaviors: Record<string, Array<() => void>>,
|
|
33
|
+
autoConnect: boolean): void;
|
|
34
|
+
init(socketClientId: string, url: string, channel: string,
|
|
35
|
+
onopen: faces.push.OnOpenHandler | string | null,
|
|
36
|
+
onmessage: faces.push.OnMessageHandler | string | null,
|
|
37
|
+
onclose: faces.push.OnCloseHandler | string | null,
|
|
38
|
+
behaviors: Record<string, Array<() => void>>,
|
|
39
|
+
autoConnect: boolean): void;
|
|
40
|
+
open(socketClientId: string): void;
|
|
41
|
+
close(socketClientId: string): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function verifyPushInitTypeCompatibility(push: PushCompat): void {
|
|
45
|
+
// faces 4.0 form — with onerror
|
|
46
|
+
push.init("clientId1", "booga.ws", "mychannel",
|
|
47
|
+
() => {},
|
|
48
|
+
() => {},
|
|
49
|
+
() => {},
|
|
50
|
+
() => {},
|
|
51
|
+
{},
|
|
52
|
+
true
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// JSF 2.3 legacy form — without onerror
|
|
56
|
+
push.init("clientId1", "booga.ws", "mychannel",
|
|
57
|
+
() => {},
|
|
58
|
+
() => {},
|
|
59
|
+
() => {},
|
|
60
|
+
{},
|
|
61
|
+
true
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
verifyPushInitTypeCompatibility;
|
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
import {expect} from 'chai';
|
|
2
18
|
import {describe, it} from 'mocha';
|
|
3
19
|
import {Lang} from "mona-dish";
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
|
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
export const tobagoSheetWithHeader = `<tobago-sheet id="page:mainForm:s1" data-tobago-selection-mode="multi" data-tobago-first="0" rows="0" row-count="88" data-tobago-layout="{"columns":[1.0]}">
|
|
2
18
|
<style nonce="" id="page:mainForm:s1:j_id_2n">#page\\:mainForm\\:s1{max-height:486px;}
|
|
3
19
|
</style>
|
package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
export const tobagoSheetWithoutHeader = `<tobago-sheet id="page:mainForm:s1" data-tobago-selection-mode="multi" data-tobago-first="0" rows="0" row-count="88" data-tobago-layout="{"columns":[1.0]}">
|
|
2
18
|
<style nonce="" id="page:mainForm:s1:j_id_2n">#page\\:mainForm\\:s1{max-height:486px;}
|
|
3
19
|
</style>
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
import {DomQuery} from "mona-dish";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
declare let global;
|
|
19
|
+
declare let global: any;
|
|
22
20
|
declare let faces: any;
|
|
23
21
|
declare let jsf: any;
|
|
24
22
|
declare let myfaces: any;
|
|
@@ -38,6 +36,49 @@ declare let myfaces: any;
|
|
|
38
36
|
*/
|
|
39
37
|
export namespace StandardInits {
|
|
40
38
|
|
|
39
|
+
type GlobalJsdom = (html?: string, options?: object) => () => void;
|
|
40
|
+
type GlobalJsdomModule = GlobalJsdom | { default?: GlobalJsdom };
|
|
41
|
+
|
|
42
|
+
function resolveGlobalJsdom(domIt: GlobalJsdomModule): GlobalJsdom {
|
|
43
|
+
return typeof domIt === "function" ? domIt : domIt.default;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createStorageMock(): Storage {
|
|
47
|
+
const data: Record<string, string> = {};
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
get length() {
|
|
51
|
+
return Object.keys(data).length;
|
|
52
|
+
},
|
|
53
|
+
clear() {
|
|
54
|
+
Object.keys(data).forEach(key => delete data[key]);
|
|
55
|
+
},
|
|
56
|
+
getItem(key: string) {
|
|
57
|
+
return Object.prototype.hasOwnProperty.call(data, key) ? data[key] : null;
|
|
58
|
+
},
|
|
59
|
+
key(index: number) {
|
|
60
|
+
return Object.keys(data)[index] ?? null;
|
|
61
|
+
},
|
|
62
|
+
removeItem(key: string) {
|
|
63
|
+
delete data[key];
|
|
64
|
+
},
|
|
65
|
+
setItem(key: string, value: string) {
|
|
66
|
+
data[key] = `${value}`;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function installStorageMocks(window: Window) {
|
|
72
|
+
Object.defineProperty(window, "localStorage", {
|
|
73
|
+
configurable: true,
|
|
74
|
+
value: createStorageMock()
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(window, "sessionStorage", {
|
|
77
|
+
configurable: true,
|
|
78
|
+
value: createStorageMock()
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
41
82
|
export const HTML_DEFAULT = `<!DOCTYPE html>
|
|
42
83
|
<html lang="en">
|
|
43
84
|
<head>
|
|
@@ -637,15 +678,17 @@ function triggerRequestChain(event) {
|
|
|
637
678
|
*/
|
|
638
679
|
let initJSDOM = async function (template: string) {
|
|
639
680
|
// @ts-ignore
|
|
640
|
-
return import('jsdom
|
|
681
|
+
return import('global-jsdom').then((domIt) => {
|
|
682
|
+
(global as any).document?.destroy?.();
|
|
641
683
|
let params = {
|
|
642
684
|
contentType: "text/html",
|
|
643
685
|
runScripts: "dangerously",
|
|
644
686
|
resources: "usable",
|
|
645
|
-
url: `file://${__dirname}/index.html
|
|
687
|
+
url: `file://${__dirname}/index.html`,
|
|
688
|
+
beforeParse: installStorageMocks
|
|
646
689
|
};
|
|
647
690
|
//we have two different apis depending whether we allow module interop with sinon or not
|
|
648
|
-
return (domIt
|
|
691
|
+
return resolveGlobalJsdom(domIt)(template, params);
|
|
649
692
|
});
|
|
650
693
|
};
|
|
651
694
|
|
|
@@ -700,8 +743,11 @@ function triggerRequestChain(event) {
|
|
|
700
743
|
await initJSF(IS_JSF_40);
|
|
701
744
|
} else {
|
|
702
745
|
// @ts-ignore
|
|
703
|
-
await import('jsdom
|
|
704
|
-
clean = (domIt
|
|
746
|
+
await import('global-jsdom').then((domIt) => {
|
|
747
|
+
clean = resolveGlobalJsdom(domIt)(template, {
|
|
748
|
+
url: `file://${__dirname}/index.html`,
|
|
749
|
+
beforeParse: installStorageMocks
|
|
750
|
+
});
|
|
705
751
|
});
|
|
706
752
|
}
|
|
707
753
|
//the async is returning a promise on the caller level
|
|
@@ -709,4 +755,4 @@ function triggerRequestChain(event) {
|
|
|
709
755
|
return clean;
|
|
710
756
|
|
|
711
757
|
}
|
|
712
|
-
}
|
|
758
|
+
}
|
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
|
|
1
17
|
export class XmlResponses {
|
|
2
18
|
|
|
3
19
|
static EVAL_1 = `
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
// AI-generated: this file was created with assistance from Claude (Anthropic) — see AI_CONTRIBUTIONS.md
|
|
17
|
+
import {describe, it} from "mocha";
|
|
18
|
+
import {expect} from "chai";
|
|
19
|
+
import {XMLQuery} from "mona-dish";
|
|
20
|
+
import {Assertions} from "../../impl/util/Assertions";
|
|
21
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
22
|
+
import {Implementation} from "../../impl/AjaxImpl";
|
|
23
|
+
|
|
24
|
+
const defaultMyFaces = StandardInits.defaultMyFaces;
|
|
25
|
+
|
|
26
|
+
// Pure functions — no DOM required.
|
|
27
|
+
describe("Assertions.assert", () => {
|
|
28
|
+
|
|
29
|
+
it("does not throw when the value is truthy", () => {
|
|
30
|
+
expect(() => Assertions.assert(true, "msg")).not.to.throw();
|
|
31
|
+
expect(() => Assertions.assert(1, "msg")).not.to.throw();
|
|
32
|
+
expect(() => Assertions.assert("x", "msg")).not.to.throw();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("throws when the value is falsy", () => {
|
|
36
|
+
expect(() => Assertions.assert(false, "must fail")).to.throw();
|
|
37
|
+
expect(() => Assertions.assert(0, "must fail")).to.throw();
|
|
38
|
+
expect(() => Assertions.assert(null, "must fail")).to.throw();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("includes the message in the thrown error", () => {
|
|
42
|
+
expect(() => Assertions.assert(false, "sentinel message"))
|
|
43
|
+
.to.throw(/sentinel message/);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe("Assertions.assertType", () => {
|
|
48
|
+
|
|
49
|
+
it("does not throw when value is null or undefined", () => {
|
|
50
|
+
expect(() => Assertions.assertType(null, "function")).not.to.throw();
|
|
51
|
+
expect(() => Assertions.assertType(undefined, "function")).not.to.throw();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("does not throw when value matches the expected type", () => {
|
|
55
|
+
expect(() => Assertions.assertType(() => {}, "function")).not.to.throw();
|
|
56
|
+
expect(() => Assertions.assertType("hello", "string")).not.to.throw();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("throws when value is truthy but does not match the expected type", () => {
|
|
60
|
+
expect(() => Assertions.assertType(42, "function", "bad type")).to.throw();
|
|
61
|
+
expect(() => Assertions.assertType("str", "function", "bad type")).to.throw();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe("Assertions.assertFunction", () => {
|
|
66
|
+
|
|
67
|
+
it("does not throw for null or undefined (falsy passthrough)", () => {
|
|
68
|
+
expect(() => Assertions.assertFunction(null)).not.to.throw();
|
|
69
|
+
expect(() => Assertions.assertFunction(undefined)).not.to.throw();
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("does not throw for an actual function", () => {
|
|
73
|
+
expect(() => Assertions.assertFunction(() => {})).not.to.throw();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("throws when a non-function truthy value is passed", () => {
|
|
77
|
+
expect(() => Assertions.assertFunction(42 as any)).to.throw();
|
|
78
|
+
expect(() => Assertions.assertFunction("callback" as any)).to.throw();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe("Assertions.assertDelay", () => {
|
|
83
|
+
|
|
84
|
+
it("does not throw for zero", () => {
|
|
85
|
+
expect(() => Assertions.assertDelay(0)).not.to.throw();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("does not throw for positive numbers", () => {
|
|
89
|
+
expect(() => Assertions.assertDelay(100)).not.to.throw();
|
|
90
|
+
expect(() => Assertions.assertDelay(0.5)).not.to.throw();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("throws for negative numbers", () => {
|
|
94
|
+
expect(() => Assertions.assertDelay(-1)).to.throw("Invalid delay value");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("throws for NaN", () => {
|
|
98
|
+
expect(() => Assertions.assertDelay(NaN)).to.throw("Invalid delay value");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("throws for a non-numeric string", () => {
|
|
102
|
+
expect(() => Assertions.assertDelay("fast" as any)).to.throw("Invalid delay value");
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe("Assertions.raiseError", () => {
|
|
107
|
+
|
|
108
|
+
it("returns an Error instance", () => {
|
|
109
|
+
const err = Assertions.raiseError(new Error(), "something went wrong");
|
|
110
|
+
expect(err).to.be.instanceOf(Error);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("falls back to MALFORMEDXML when title and name are omitted", () => {
|
|
114
|
+
const err = Assertions.raiseError(new Error(), "msg", "caller") as any;
|
|
115
|
+
expect(err).to.be.instanceOf(Error);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("uses the supplied title and name when provided", () => {
|
|
119
|
+
const err = Assertions.raiseError(new Error(), "msg", "caller", "MyTitle", "MyName") as any;
|
|
120
|
+
expect(err).to.be.instanceOf(Error);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Tests that require XMLQuery / DOMParser — JSDOM setup needed.
|
|
125
|
+
describe("Assertions XML (requires DOM)", () => {
|
|
126
|
+
|
|
127
|
+
beforeEach(async function () {
|
|
128
|
+
return defaultMyFaces().then((close) => {
|
|
129
|
+
this.closeIt = () => { Implementation.reset(); close(); };
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
afterEach(function () { this.closeIt(); });
|
|
134
|
+
|
|
135
|
+
describe("assertUrlExists", () => {
|
|
136
|
+
|
|
137
|
+
function xqWithUrl(present: boolean): XMLQuery {
|
|
138
|
+
// assertUrlExists only calls node.attr(ATTR_URL).isAbsent()
|
|
139
|
+
return { attr: (_: string) => ({ isAbsent: () => !present }) } as any;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
it("does not throw when the url attribute is present", () => {
|
|
143
|
+
expect(() => Assertions.assertUrlExists(xqWithUrl(true))).not.to.throw();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("throws when the url attribute is absent", () => {
|
|
147
|
+
expect(() => Assertions.assertUrlExists(xqWithUrl(false))).to.throw();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe("assertValidXMLResponse", () => {
|
|
152
|
+
|
|
153
|
+
it("does not throw for a well-formed partial-response document", () => {
|
|
154
|
+
const doc = new DOMParser().parseFromString(
|
|
155
|
+
'<partial-response><changes/></partial-response>', "text/xml");
|
|
156
|
+
expect(() => Assertions.assertValidXMLResponse(new XMLQuery(doc))).not.to.throw();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("throws when the response is absent (null)", () => {
|
|
160
|
+
expect(() => Assertions.assertValidXMLResponse(new XMLQuery(null as any))).to.throw();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("throws when the partial-response root element is missing", () => {
|
|
164
|
+
const doc = new DOMParser().parseFromString('<other-root/>', "text/xml");
|
|
165
|
+
expect(() => Assertions.assertValidXMLResponse(new XMLQuery(doc))).to.throw();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|