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.
Files changed (413) hide show
  1. package/AI_CONTRIBUTIONS.md +71 -0
  2. package/README.md +254 -78
  3. package/api-extractor.faces.json +38 -0
  4. package/dist/docs/assets/hierarchy.js +1 -1
  5. package/dist/docs/assets/navigation.js +1 -1
  6. package/dist/docs/assets/search.js +1 -1
  7. package/dist/docs/functions/faces.ajax.addOnError.html +2 -2
  8. package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -2
  9. package/dist/docs/functions/faces.ajax.request.html +2 -2
  10. package/dist/docs/functions/faces.ajax.response.html +2 -2
  11. package/dist/docs/functions/faces.getClientWindow.html +2 -2
  12. package/dist/docs/functions/faces.getProjectStage.html +2 -2
  13. package/dist/docs/functions/faces.getViewState.html +1 -1
  14. package/dist/docs/functions/faces.push.close.html +1 -1
  15. package/dist/docs/functions/faces.push.init.html +6 -6
  16. package/dist/docs/functions/faces.push.open.html +1 -1
  17. package/dist/docs/functions/faces.util.chain.html +2 -2
  18. package/dist/docs/functions/myfaces.ab.html +3 -3
  19. package/dist/docs/functions/myfaces.onDomReady.html +1 -1
  20. package/dist/docs/functions/myfaces.reserveNamespace.html +1 -1
  21. package/dist/docs/hierarchy.html +1 -1
  22. package/dist/docs/index.html +292 -71
  23. package/dist/docs/interfaces/faces.AjaxData.html +6 -0
  24. package/dist/docs/interfaces/faces.AjaxError.html +18 -0
  25. package/dist/docs/interfaces/faces.AjaxEvent.html +8 -0
  26. package/dist/docs/interfaces/faces.ajax.RequestContext.html +6 -0
  27. package/dist/docs/interfaces/faces.ajax.RequestOptions.html +10 -0
  28. package/dist/docs/modules/faces.ajax.html +1 -1
  29. package/dist/docs/modules/faces.html +1 -1
  30. package/dist/docs/modules/faces.push.html +1 -1
  31. package/dist/docs/modules/faces.util.html +1 -1
  32. package/dist/docs/modules/myfaces.html +1 -1
  33. package/dist/docs/modules.html +1 -1
  34. package/dist/docs/types/faces.AjaxErrorStatus.html +2 -0
  35. package/dist/docs/types/faces.AjaxEventStatus.html +2 -0
  36. package/dist/docs/types/faces.ProjectStage.html +2 -0
  37. package/dist/docs/types/faces.ajax.OnErrorCallback.html +2 -0
  38. package/dist/docs/types/faces.ajax.OnEventCallback.html +2 -0
  39. package/dist/docs/types/faces.push.OnCloseHandler.html +2 -0
  40. package/dist/docs/types/faces.push.OnErrorHandler.html +2 -0
  41. package/dist/docs/types/faces.push.OnMessageHandler.html +2 -0
  42. package/dist/docs/types/faces.push.OnOpenHandler.html +2 -0
  43. package/dist/docs/variables/faces.contextpath.html +1 -1
  44. package/dist/docs/variables/faces.implversion.html +1 -1
  45. package/dist/docs/variables/faces.separatorchar.html +1 -1
  46. package/dist/docs/variables/faces.specversion.html +1 -1
  47. package/dist/docs/variables/myfaces.oam.html +1 -1
  48. package/dist/window/faces-development.js +1801 -499
  49. package/dist/window/faces-development.js.map +1 -1
  50. package/{target/api/_api.js → dist/window/faces.d.ts} +124 -151
  51. package/dist/window/faces.js +1 -1
  52. package/dist/window/faces.js.LICENSE.txt +0 -17
  53. package/dist/window/faces.js.map +1 -1
  54. package/dist/window/jsf-development.js +1806 -513
  55. package/dist/window/jsf-development.js.map +1 -1
  56. package/{target/src/main/typescript/api/_api.js → dist/window/jsf.d.ts} +125 -153
  57. package/dist/window/jsf.js +1 -1
  58. package/dist/window/jsf.js.LICENSE.txt +0 -17
  59. package/dist/window/jsf.js.map +1 -1
  60. package/package.json +22 -18
  61. package/scripts/build-dts.mjs +239 -0
  62. package/src/main/typescript/@types/definitions/index.d.ts +22 -122
  63. package/{target/test/frameworkBase/_ext/monadish/fixtures/test2.js → src/main/typescript/@types/definitions/modules.d.ts} +18 -2
  64. package/src/main/typescript/api/_api.ts +132 -29
  65. package/{target/test/frameworkBase/_ext/monadish/fixtures/test.js → src/main/typescript/api/_api_ae_stub.d.ts} +6 -2
  66. package/src/main/typescript/api/faces.ts +2 -2
  67. package/src/main/typescript/api/jsf.ts +15 -23
  68. package/src/main/typescript/impl/AjaxImpl.ts +15 -15
  69. package/src/main/typescript/impl/PushImpl.ts +139 -69
  70. package/src/main/typescript/impl/core/Const.ts +2 -2
  71. package/src/main/typescript/impl/i18n/Messages.ts +1 -1
  72. package/src/main/typescript/impl/util/Assertions.ts +1 -2
  73. package/src/main/typescript/impl/util/AsyncRunnable.ts +3 -4
  74. package/src/main/typescript/impl/util/ExtDomQuery.ts +19 -19
  75. package/src/main/typescript/impl/util/FileUtils.ts +30 -14
  76. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +34 -34
  77. package/src/main/typescript/impl/util/Lang.ts +19 -22
  78. package/src/main/typescript/impl/util/XhrQueueController.ts +25 -3
  79. package/src/main/typescript/impl/xhrCore/ErrorData.ts +17 -12
  80. package/src/main/typescript/impl/xhrCore/EventData.ts +8 -7
  81. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +3 -3
  82. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +7 -6
  83. package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
  84. package/src/main/typescript/impl/xhrCore/ResponseDataResolver.ts +0 -38
  85. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +17 -15
  86. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +72 -63
  87. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -134
  88. package/src/main/typescript/mona_dish_shim.ts +6 -2
  89. package/src/main/typescript/myfaces/OamSubmit.ts +10 -6
  90. package/src/main/typescript/test/api/JsfPushShimTest.spec.ts +126 -0
  91. package/src/main/typescript/test/api/MyFacesABTest.spec.ts +16 -0
  92. package/src/main/typescript/test/api/PushTypeCompatibility.ts +65 -0
  93. package/src/main/typescript/test/frameworkBase/LangTest.spec.ts +16 -0
  94. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -0
  95. package/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.ts +16 -0
  96. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +16 -0
  97. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +16 -0
  98. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +55 -9
  99. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +16 -0
  100. package/src/main/typescript/test/impl/AssertionsTest.spec.ts +168 -0
  101. package/src/main/typescript/test/impl/FileUtilsTest.spec.ts +126 -0
  102. package/src/main/typescript/test/impl/ImplTest.spec.ts +75 -1
  103. package/src/main/typescript/test/impl/ResponseDataResolverTest.spec.ts +62 -0
  104. package/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.ts +91 -1
  105. package/src/main/typescript/test/impl/util/ExtLangTest.spec.ts +110 -0
  106. package/src/main/typescript/test/impl/util/HiddenInputBuilderTest.spec.ts +74 -0
  107. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +61 -1
  108. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +191 -2
  109. package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +16 -0
  110. package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +14 -0
  111. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +21 -5
  112. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +363 -4
  113. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +218 -4
  114. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +1 -1
  115. package/src/main/typescript/test/xhrCore/WebsocketTest.spec.ts +764 -0
  116. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +265 -62
  117. package/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.ts +16 -0
  118. package/{target/src/main/typescript/test/xhrCore/FakeWebsocket.js → src/main/typescript/tsconfig.ae.json} +16 -23
  119. package/src/main/typescript/{tsconfig.json → tsconfig.dts.json} +11 -27
  120. package/src/main/typescript/tsconfig.test.json +17 -0
  121. package/tsconfig.api-extractor.json +17 -0
  122. package/.claude/settings.local.json +0 -16
  123. package/.github/workflows/codeql-analysis.yml +0 -83
  124. package/.github/workflows/nodejs.yml +0 -26
  125. package/.mocharc.json +0 -10
  126. package/.nyc_output/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
  127. package/.nyc_output/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
  128. package/.nyc_output/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
  129. package/.nyc_output/processinfo/384344d4-4f46-455f-84c3-010f829098cb.json +0 -1
  130. package/.nyc_output/processinfo/a0f90016-f4f9-4039-bb51-57f4f7050541.json +0 -1
  131. package/.nyc_output/processinfo/db388b5d-0b79-4bce-afd2-001aaf6f0245.json +0 -1
  132. package/.nyc_output/processinfo/index.json +0 -1
  133. package/.nycrc +0 -6
  134. package/build.cmd +0 -1
  135. package/build.sh +0 -3
  136. package/mvnw +0 -286
  137. package/mvnw.cmd +0 -161
  138. package/plans for 4.0.1.txt +0 -8
  139. package/remap.ts +0 -51
  140. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +0 -221
  141. package/target/api/_api.js.map +0 -1
  142. package/target/api/faces.js +0 -45
  143. package/target/api/faces.js.map +0 -1
  144. package/target/api/jsf.js +0 -56
  145. package/target/api/jsf.js.map +0 -1
  146. package/target/impl/AjaxImpl.js +0 -748
  147. package/target/impl/AjaxImpl.js.map +0 -1
  148. package/target/impl/PushImpl.js +0 -265
  149. package/target/impl/PushImpl.js.map +0 -1
  150. package/target/impl/core/Const.js +0 -177
  151. package/target/impl/core/Const.js.map +0 -1
  152. package/target/impl/core/ImplTypes.js +0 -38
  153. package/target/impl/core/ImplTypes.js.map +0 -1
  154. package/target/impl/i18n/Messages.js +0 -113
  155. package/target/impl/i18n/Messages.js.map +0 -1
  156. package/target/impl/util/Assertions.js +0 -101
  157. package/target/impl/util/Assertions.js.map +0 -1
  158. package/target/impl/util/AsyncRunnable.js +0 -78
  159. package/target/impl/util/AsyncRunnable.js.map +0 -1
  160. package/target/impl/util/ExtDomQuery.js +0 -306
  161. package/target/impl/util/ExtDomQuery.js.map +0 -1
  162. package/target/impl/util/FileUtils.js +0 -98
  163. package/target/impl/util/FileUtils.js.map +0 -1
  164. package/target/impl/util/HiddenInputBuilder.js +0 -83
  165. package/target/impl/util/HiddenInputBuilder.js.map +0 -1
  166. package/target/impl/util/IListener.js +0 -3
  167. package/target/impl/util/IListener.js.map +0 -1
  168. package/target/impl/util/Lang.js +0 -263
  169. package/target/impl/util/Lang.js.map +0 -1
  170. package/target/impl/util/XhrQueueController.js +0 -92
  171. package/target/impl/util/XhrQueueController.js.map +0 -1
  172. package/target/impl/xhrCore/ErrorData.js +0 -87
  173. package/target/impl/xhrCore/ErrorData.js.map +0 -1
  174. package/target/impl/xhrCore/EventData.js +0 -52
  175. package/target/impl/xhrCore/EventData.js.map +0 -1
  176. package/target/impl/xhrCore/IResponseProcessor.js +0 -3
  177. package/target/impl/xhrCore/IResponseProcessor.js.map +0 -1
  178. package/target/impl/xhrCore/RequestDataResolver.js +0 -186
  179. package/target/impl/xhrCore/RequestDataResolver.js.map +0 -1
  180. package/target/impl/xhrCore/ResonseDataResolver.js +0 -104
  181. package/target/impl/xhrCore/ResonseDataResolver.js.map +0 -1
  182. package/target/impl/xhrCore/Response.js +0 -186
  183. package/target/impl/xhrCore/Response.js.map +0 -1
  184. package/target/impl/xhrCore/ResponseDataResolver.js +0 -104
  185. package/target/impl/xhrCore/ResponseDataResolver.js.map +0 -1
  186. package/target/impl/xhrCore/ResponseProcessor.js +0 -468
  187. package/target/impl/xhrCore/ResponseProcessor.js.map +0 -1
  188. package/target/impl/xhrCore/XhrFormData.js +0 -163
  189. package/target/impl/xhrCore/XhrFormData.js.map +0 -1
  190. package/target/impl/xhrCore/XhrRequest.js +0 -433
  191. package/target/impl/xhrCore/XhrRequest.js.map +0 -1
  192. package/target/mona_dish_shim.js +0 -70
  193. package/target/mona_dish_shim.js.map +0 -1
  194. package/target/myfaces/OamSubmit.js +0 -128
  195. package/target/myfaces/OamSubmit.js.map +0 -1
  196. package/target/src/main/typescript/api/_api.js.map +0 -1
  197. package/target/src/main/typescript/api/faces.js +0 -45
  198. package/target/src/main/typescript/api/faces.js.map +0 -1
  199. package/target/src/main/typescript/api/jsf.js +0 -56
  200. package/target/src/main/typescript/api/jsf.js.map +0 -1
  201. package/target/src/main/typescript/impl/AjaxImpl.js +0 -748
  202. package/target/src/main/typescript/impl/AjaxImpl.js.map +0 -1
  203. package/target/src/main/typescript/impl/PushImpl.js +0 -265
  204. package/target/src/main/typescript/impl/PushImpl.js.map +0 -1
  205. package/target/src/main/typescript/impl/core/Const.js +0 -177
  206. package/target/src/main/typescript/impl/core/Const.js.map +0 -1
  207. package/target/src/main/typescript/impl/core/ImplTypes.js +0 -38
  208. package/target/src/main/typescript/impl/core/ImplTypes.js.map +0 -1
  209. package/target/src/main/typescript/impl/i18n/Messages.js +0 -113
  210. package/target/src/main/typescript/impl/i18n/Messages.js.map +0 -1
  211. package/target/src/main/typescript/impl/util/Assertions.js +0 -101
  212. package/target/src/main/typescript/impl/util/Assertions.js.map +0 -1
  213. package/target/src/main/typescript/impl/util/AsyncRunnable.js +0 -78
  214. package/target/src/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
  215. package/target/src/main/typescript/impl/util/ExtDomQuery.js +0 -306
  216. package/target/src/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
  217. package/target/src/main/typescript/impl/util/FileUtils.js +0 -98
  218. package/target/src/main/typescript/impl/util/FileUtils.js.map +0 -1
  219. package/target/src/main/typescript/impl/util/HiddenInputBuilder.js +0 -83
  220. package/target/src/main/typescript/impl/util/HiddenInputBuilder.js.map +0 -1
  221. package/target/src/main/typescript/impl/util/IListener.js +0 -3
  222. package/target/src/main/typescript/impl/util/IListener.js.map +0 -1
  223. package/target/src/main/typescript/impl/util/Lang.js +0 -263
  224. package/target/src/main/typescript/impl/util/Lang.js.map +0 -1
  225. package/target/src/main/typescript/impl/util/XhrQueueController.js +0 -92
  226. package/target/src/main/typescript/impl/util/XhrQueueController.js.map +0 -1
  227. package/target/src/main/typescript/impl/xhrCore/ErrorData.js +0 -87
  228. package/target/src/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
  229. package/target/src/main/typescript/impl/xhrCore/EventData.js +0 -52
  230. package/target/src/main/typescript/impl/xhrCore/EventData.js.map +0 -1
  231. package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
  232. package/target/src/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
  233. package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -186
  234. package/target/src/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
  235. package/target/src/main/typescript/impl/xhrCore/Response.js +0 -186
  236. package/target/src/main/typescript/impl/xhrCore/Response.js.map +0 -1
  237. package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js +0 -104
  238. package/target/src/main/typescript/impl/xhrCore/ResponseDataResolver.js.map +0 -1
  239. package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -468
  240. package/target/src/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
  241. package/target/src/main/typescript/impl/xhrCore/XhrFormData.js +0 -163
  242. package/target/src/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
  243. package/target/src/main/typescript/impl/xhrCore/XhrRequest.js +0 -433
  244. package/target/src/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
  245. package/target/src/main/typescript/mona_dish_shim.js +0 -70
  246. package/target/src/main/typescript/mona_dish_shim.js.map +0 -1
  247. package/target/src/main/typescript/myfaces/OamSubmit.js +0 -128
  248. package/target/src/main/typescript/myfaces/OamSubmit.js.map +0 -1
  249. package/target/src/main/typescript/test/api/MyFacesABTest.spec.js +0 -117
  250. package/target/src/main/typescript/test/api/MyFacesABTest.spec.js.map +0 -1
  251. package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js +0 -123
  252. package/target/src/main/typescript/test/frameworkBase/LangTest.spec.js.map +0 -1
  253. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
  254. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
  255. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
  256. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
  257. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
  258. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  259. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
  260. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
  261. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
  262. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
  263. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -2
  264. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
  265. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
  266. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
  267. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
  268. package/target/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
  269. package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
  270. package/target/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  271. package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
  272. package/target/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  273. package/target/src/main/typescript/test/impl/ImplTest.spec.js +0 -225
  274. package/target/src/main/typescript/test/impl/ImplTest.spec.js.map +0 -1
  275. package/target/src/main/typescript/test/impl/ImplTest_23.spec.js +0 -143
  276. package/target/src/main/typescript/test/impl/ImplTest_23.spec.js.map +0 -1
  277. package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js +0 -106
  278. package/target/src/main/typescript/test/impl/SeparatorCharsTest.spec.js.map +0 -1
  279. package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js +0 -77
  280. package/target/src/main/typescript/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
  281. package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js +0 -118
  282. package/target/src/main/typescript/test/myfaces/OamSubmit.spec.js.map +0 -1
  283. package/target/src/main/typescript/test/myfaces/OnLoad.spec.js +0 -57
  284. package/target/src/main/typescript/test/myfaces/OnLoad.spec.js.map +0 -1
  285. package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js +0 -60
  286. package/target/src/main/typescript/test/myfaces/ReserveNamespace.spec.js.map +0 -1
  287. package/target/src/main/typescript/test/queue/AsynchronousProbe.js +0 -93
  288. package/target/src/main/typescript/test/queue/AsynchronousProbe.js.map +0 -1
  289. package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js +0 -133
  290. package/target/src/main/typescript/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
  291. package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js +0 -101
  292. package/target/src/main/typescript/test/xhrCore/ClientWindow.spec.js.map +0 -1
  293. package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js +0 -175
  294. package/target/src/main/typescript/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
  295. package/target/src/main/typescript/test/xhrCore/EventTests.spec.js +0 -184
  296. package/target/src/main/typescript/test/xhrCore/EventTests.spec.js.map +0 -1
  297. package/target/src/main/typescript/test/xhrCore/FakeWebsocket.js.map +0 -1
  298. package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js +0 -181
  299. package/target/src/main/typescript/test/xhrCore/FileUploadTest.spec.js.map +0 -1
  300. package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
  301. package/target/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
  302. package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js +0 -199
  303. package/target/src/main/typescript/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
  304. package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js +0 -567
  305. package/target/src/main/typescript/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
  306. package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js +0 -845
  307. package/target/src/main/typescript/test/xhrCore/RequestTest.spec.js.map +0 -1
  308. package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js +0 -382
  309. package/target/src/main/typescript/test/xhrCore/RequestTest_23.spec.js.map +0 -1
  310. package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js +0 -667
  311. package/target/src/main/typescript/test/xhrCore/ResponseTest.spec.js.map +0 -1
  312. package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js +0 -367
  313. package/target/src/main/typescript/test/xhrCore/ResponseTest23.spec.js.map +0 -1
  314. package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js +0 -123
  315. package/target/src/main/typescript/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
  316. package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
  317. package/target/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
  318. package/target/src/main/typescript/test/xhrCore/WebsocketTest.js +0 -207
  319. package/target/src/main/typescript/test/xhrCore/WebsocketTest.js.map +0 -1
  320. package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js +0 -149
  321. package/target/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
  322. package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js +0 -130
  323. package/target/src/main/typescript/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
  324. package/target/test/api/MyFacesABTest.spec.js +0 -117
  325. package/target/test/api/MyFacesABTest.spec.js.map +0 -1
  326. package/target/test/frameworkBase/LangTest.spec.js +0 -123
  327. package/target/test/frameworkBase/LangTest.spec.js.map +0 -1
  328. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +0 -657
  329. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +0 -1
  330. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +0 -107
  331. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +0 -1
  332. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +0 -106
  333. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  334. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +0 -39
  335. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +0 -1
  336. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +0 -153
  337. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +0 -1
  338. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js +0 -1
  339. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.js.map +0 -1
  340. package/target/test/frameworkBase/_ext/monadish/fixtures/test.js.map +0 -1
  341. package/target/test/frameworkBase/_ext/monadish/fixtures/test2.js.map +0 -1
  342. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +0 -925
  343. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +0 -1
  344. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +0 -112
  345. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +0 -1
  346. package/target/test/frameworkBase/_ext/shared/StandardInits.js +0 -728
  347. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  348. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +0 -296
  349. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  350. package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +0 -16
  351. package/target/test/frameworkBase/_ext/shared/fixtures/js/tobago.js.map +0 -1
  352. package/target/test/impl/ImplTest.spec.js +0 -225
  353. package/target/test/impl/ImplTest.spec.js.map +0 -1
  354. package/target/test/impl/ImplTest_23.spec.js +0 -143
  355. package/target/test/impl/ImplTest_23.spec.js.map +0 -1
  356. package/target/test/impl/SeparatorCharsTest.spec.js +0 -106
  357. package/target/test/impl/SeparatorCharsTest.spec.js.map +0 -1
  358. package/target/test/impl/util/ExtDomQueryTest.spec.js +0 -77
  359. package/target/test/impl/util/ExtDomQueryTest.spec.js.map +0 -1
  360. package/target/test/myfaces/OamSubmit.spec.js +0 -118
  361. package/target/test/myfaces/OamSubmit.spec.js.map +0 -1
  362. package/target/test/myfaces/OnLoad.spec.js +0 -57
  363. package/target/test/myfaces/OnLoad.spec.js.map +0 -1
  364. package/target/test/myfaces/ReserveNamespace.spec.js +0 -60
  365. package/target/test/myfaces/ReserveNamespace.spec.js.map +0 -1
  366. package/target/test/queue/AsynchronousProbe.js +0 -93
  367. package/target/test/queue/AsynchronousProbe.js.map +0 -1
  368. package/target/test/queue/AsynchronousQueueTest.spec.js +0 -133
  369. package/target/test/queue/AsynchronousQueueTest.spec.js.map +0 -1
  370. package/target/test/xhrCore/ClientWindow.spec.js +0 -101
  371. package/target/test/xhrCore/ClientWindow.spec.js.map +0 -1
  372. package/target/test/xhrCore/ErrorChainTest.spec.js +0 -175
  373. package/target/test/xhrCore/ErrorChainTest.spec.js.map +0 -1
  374. package/target/test/xhrCore/EventTests.spec.js +0 -184
  375. package/target/test/xhrCore/EventTests.spec.js.map +0 -1
  376. package/target/test/xhrCore/FakeWebsocket.js +0 -38
  377. package/target/test/xhrCore/FakeWebsocket.js.map +0 -1
  378. package/target/test/xhrCore/FileUploadTest.spec.js +0 -181
  379. package/target/test/xhrCore/FileUploadTest.spec.js.map +0 -1
  380. package/target/test/xhrCore/NamespacesRequestTest.spec.js +0 -226
  381. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +0 -1
  382. package/target/test/xhrCore/OamSubmitTest.spec.js +0 -199
  383. package/target/test/xhrCore/OamSubmitTest.spec.js.map +0 -1
  384. package/target/test/xhrCore/RequestParamsTest.spec.js +0 -567
  385. package/target/test/xhrCore/RequestParamsTest.spec.js.map +0 -1
  386. package/target/test/xhrCore/RequestTest.spec.js +0 -845
  387. package/target/test/xhrCore/RequestTest.spec.js.map +0 -1
  388. package/target/test/xhrCore/RequestTest_23.spec.js +0 -382
  389. package/target/test/xhrCore/RequestTest_23.spec.js.map +0 -1
  390. package/target/test/xhrCore/ResponseTest.spec.js +0 -667
  391. package/target/test/xhrCore/ResponseTest.spec.js.map +0 -1
  392. package/target/test/xhrCore/ResponseTest23.spec.js +0 -367
  393. package/target/test/xhrCore/ResponseTest23.spec.js.map +0 -1
  394. package/target/test/xhrCore/ShadowDomTest.spec.js +0 -123
  395. package/target/test/xhrCore/ShadowDomTest.spec.js.map +0 -1
  396. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +0 -147
  397. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +0 -1
  398. package/target/test/xhrCore/WebsocketTest.js +0 -207
  399. package/target/test/xhrCore/WebsocketTest.js.map +0 -1
  400. package/target/test/xhrCore/XhrFormDataTest.spec.js +0 -149
  401. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +0 -1
  402. package/target/test/xhrCore/XhrRequestProgress.spec.js +0 -130
  403. package/target/test/xhrCore/XhrRequestProgress.spec.js.map +0 -1
  404. package/target/test/xhrCore/fixtures/addedViewHead1.js +0 -17
  405. package/target/test/xhrCore/fixtures/addedViewHead1.js.map +0 -1
  406. package/target/test/xhrCore/fixtures/addedViewHead2.js +0 -17
  407. package/target/test/xhrCore/fixtures/addedViewHead2.js.map +0 -1
  408. package/target/test/xhrCore/fixtures/addedViewHead3.js +0 -17
  409. package/target/test/xhrCore/fixtures/addedViewHead3.js.map +0 -1
  410. package/target/test/xhrCore/fixtures/nonce_script.js +0 -17
  411. package/target/test/xhrCore/fixtures/nonce_script.js.map +0 -1
  412. package/tsconfig.json +0 -9
  413. package/webpack.config.ts +0 -54
@@ -1,433 +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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.XhrRequest = void 0;
19
- const AsyncRunnable_1 = require("../util/AsyncRunnable");
20
- const mona_dish_1 = require("mona-dish");
21
- const AjaxImpl_1 = require("../AjaxImpl");
22
- const XhrFormData_1 = require("./XhrFormData");
23
- const ErrorData_1 = require("./ErrorData");
24
- const EventData_1 = require("./EventData");
25
- const Lang_1 = require("../util/Lang");
26
- const Const_1 = require("../core/Const");
27
- const RequestDataResolver_1 = require("./RequestDataResolver");
28
- const failSaveExecute = Lang_1.ExtLang.failSaveExecute;
29
- const ExtDomQuery_1 = require("../util/ExtDomQuery");
30
- /**
31
- * Faces XHR Request Wrapper
32
- * as AsyncRunnable for our Asynchronous queue
33
- * This means from the outside the
34
- * xhr request is similar to a Promise in a way
35
- * that you can add then and catch and finally callbacks.
36
- *
37
- *
38
- * The idea is that we basically just enqueue
39
- * a single ajax request into our queue
40
- * and let the queue do the processing.
41
- *
42
- *
43
- */
44
- class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
45
- /**
46
- * Required Parameters
47
- *
48
- * @param requestContext the request context with all pass through values
49
- * @param internalContext internal context with internal info which is passed through, not used by the user
50
- * Optional Parameters
51
- * @param timeout optional xhr timeout
52
- * @param ajaxType optional request type, default "POST"
53
- * @param contentType optional content type, default "application/x-www-form-urlencoded"
54
- */
55
- constructor(requestContext, internalContext, timeout = Const_1.NO_TIMEOUT, ajaxType = Const_1.REQ_TYPE_POST, contentType = Const_1.URL_ENCODED) {
56
- super();
57
- this.requestContext = requestContext;
58
- this.internalContext = internalContext;
59
- this.timeout = timeout;
60
- this.ajaxType = ajaxType;
61
- this.contentType = contentType;
62
- this.stopProgress = false;
63
- this.xhrObject = new XMLHttpRequest();
64
- // we omit promises here because we have to deal with cancel functionality,
65
- // and promises to not provide that (yet) instead we have our async queue
66
- // which uses an api internally, which is very close to promises
67
- this.registerXhrCallbacks((data) => this.resolve(data), (data) => this.reject(data));
68
- }
69
- start() {
70
- let ignoreErr = failSaveExecute;
71
- let xhrObject = this.xhrObject;
72
- let sourceForm = mona_dish_1.DQ.byId(this.internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID).value);
73
- let executesArr = () => {
74
- return this.requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).get(Const_1.IDENT_NONE).value.split(/\s+/gi);
75
- };
76
- try {
77
- // encoded we need to decode
78
- // We generated a base representation of the current form
79
- // in case someone has overloaded the viewState with additional decorators we merge
80
- // that in, there is no way around it, the spec allows it and getViewState
81
- // must be called, so whatever getViewState delivers has higher priority then
82
- // whatever the formData object delivers
83
- // the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
84
- // ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
85
- const executes = executesArr();
86
- const partialIdsArray = this.internalContext.getIf(Const_1.CTX_PARAM_PPS).value === true ? executes : [];
87
- const formData = new XhrFormData_1.XhrFormData(sourceForm, (0, RequestDataResolver_1.resoveNamingContainerMapper)(this.internalContext), executes, partialIdsArray);
88
- this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
89
- // next step the pass through parameters are merged in for post params
90
- this.requestContext.$nspEnabled = false;
91
- const requestContext = this.requestContext;
92
- const requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
93
- // we are turning off here the jsf, faces remapping because we are now dealing with
94
- // pass-through parameters
95
- requestPassThroughParams.$nspEnabled = false;
96
- // this is an extension where we allow pass through parameters to be sent down additionally
97
- // this can be used and is used in the impl to enrich the post request parameters with additional
98
- // information
99
- try {
100
- formData.shallowMerge(requestPassThroughParams, true, true);
101
- }
102
- finally {
103
- // unfortunately as long as we support
104
- // both namespaces we have to keep manual control
105
- // on the key renaming before doing ops like deep copy
106
- this.requestContext.$nspEnabled = true;
107
- requestPassThroughParams.$nspEnabled = true;
108
- }
109
- this.appendIssuingItem(formData);
110
- this.responseContext = requestPassThroughParams.deepCopy;
111
- // we have to shift the internal passthroughs around to build up our response context
112
- const responseContext = this.responseContext;
113
- responseContext.assign(Const_1.CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
114
- // per spec the onEvent and onError handlers must be passed through to the response
115
- responseContext.assign(Const_1.ON_EVENT).value = requestContext.getIf(Const_1.ON_EVENT).value;
116
- responseContext.assign(Const_1.ON_ERROR).value = requestContext.getIf(Const_1.ON_ERROR).value;
117
- xhrObject.open(this.ajaxType, (0, RequestDataResolver_1.resolveFinalUrl)(sourceForm, formData, this.ajaxType), true);
118
- // adding timeout
119
- this.timeout ? xhrObject.timeout = this.timeout : null;
120
- // a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
121
- // normal browsers should resolve this
122
- // tests can quietly fail on this one
123
- if (this.contentType != "undefined") {
124
- ignoreErr(() => xhrObject.setRequestHeader(Const_1.CONTENT_TYPE, `${this.contentType}; charset=utf-8`));
125
- }
126
- ignoreErr(() => xhrObject.setRequestHeader(Const_1.HEAD_FACES_REQ, Const_1.VAL_AJAX));
127
- // probably not needed anymore, will test this
128
- // some webkit based mobile browsers do not follow the w3c spec of
129
- // setting, they accept headers automatically
130
- ignoreErr(() => xhrObject.setRequestHeader(Const_1.REQ_ACCEPT, Const_1.STD_ACCEPT));
131
- this.sendEvent(Const_1.BEGIN);
132
- this.sendRequest(formData);
133
- }
134
- catch (e) {
135
- // this happens usually in a client side condition, hence we have to deal in with it in a client
136
- // side manner
137
- this.handleErrorAndClearQueue(e);
138
- throw e;
139
- }
140
- return this;
141
- }
142
- cancel() {
143
- try {
144
- // this causes onError to be called where the error
145
- // handling takes over
146
- this.xhrObject.abort();
147
- }
148
- catch (e) {
149
- this.handleError(e);
150
- }
151
- }
152
- /**
153
- * attaches the internal event and processing
154
- * callback within the promise to our xhr object
155
- *
156
- * @param resolve
157
- * @param reject
158
- */
159
- registerXhrCallbacks(resolve, reject) {
160
- var _a, _b;
161
- const xhrObject = this.xhrObject;
162
- xhrObject.onabort = () => {
163
- this.onAbort(resolve, reject);
164
- };
165
- xhrObject.ontimeout = () => {
166
- this.onTimeout(resolve, reject);
167
- };
168
- xhrObject.onload = () => {
169
- this.onResponseReceived(resolve);
170
- };
171
- xhrObject.onloadend = () => {
172
- this.onResponseProcessed(this.xhrObject, resolve);
173
- };
174
- if (xhrObject === null || xhrObject === void 0 ? void 0 : xhrObject.upload) {
175
- //this is an extension so that we can send the upload object of the current
176
- //request before any operation
177
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_PREINIT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload);
178
- //now we hook in the upload events
179
- xhrObject.upload.addEventListener("progress", (event) => {
180
- var _a, _b;
181
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_ON_PROGRESS)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
182
- });
183
- xhrObject.upload.addEventListener("load", (event) => {
184
- var _a, _b;
185
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_LOAD)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
186
- });
187
- xhrObject.upload.addEventListener("loadstart", (event) => {
188
- var _a, _b;
189
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_LOADSTART)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
190
- });
191
- xhrObject.upload.addEventListener("loadend", (event) => {
192
- var _a, _b;
193
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_LOADEND)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
194
- });
195
- xhrObject.upload.addEventListener("abort", (event) => {
196
- var _a, _b;
197
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_ABORT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
198
- });
199
- xhrObject.upload.addEventListener("timeout", (event) => {
200
- var _a, _b;
201
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_TIMEOUT)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
202
- });
203
- xhrObject.upload.addEventListener("error", (event) => {
204
- var _a, _b;
205
- (_b = (_a = this.internalContext.getIf(Const_1.CTX_PARAM_UPLOAD_ERROR)).value) === null || _b === void 0 ? void 0 : _b.call(_a, xhrObject.upload, event);
206
- });
207
- }
208
- xhrObject.onerror = (errorData) => {
209
- // Safari in rare cases triggers an error when cancelling a request internally, or when
210
- // in this case we simply ignore the request and clear up the queue, because
211
- // it is not safe anymore to proceed with the current queue
212
- // This bypasses a Safari issue where it keeps requests hanging after page unload
213
- // and then triggers a cancel error on then instead of just stopping
214
- // and clearing the code
215
- // in a page unload case it is safe to clear the queue
216
- // in the exact safari case any request after this one in the queue is invalid
217
- // because the queue references xhr requests to a page which already is gone!
218
- if (this.isCancelledResponse(this.xhrObject)) {
219
- /*
220
- * this triggers the catch chain and after that finally
221
- */
222
- this.stopProgress = true;
223
- reject();
224
- return;
225
- }
226
- // error already processed somewhere else
227
- if (this.stopProgress) {
228
- return;
229
- }
230
- this.handleError(errorData);
231
- };
232
- }
233
- isCancelledResponse(currentTarget) {
234
- return (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.status) === 0 && // cancelled internally by browser
235
- (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.readyState) === 4 &&
236
- (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseText) === '' &&
237
- (currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.responseXML) === null;
238
- }
239
- /*
240
- * xhr processing callbacks
241
- *
242
- * Those methods are the callbacks called by
243
- * the xhr object depending on its own state
244
- */
245
- /**
246
- * client side abort... also here for now we clean the queue
247
- *
248
- * @param resolve
249
- * @param reject
250
- * @private
251
- */
252
- onAbort(resolve, reject) {
253
- // reject means clear queue, in this case we abort entirely the processing
254
- // does not happen yet, we have to probably rethink this strategy in the future
255
- // when we introduce cancel functionality
256
- this.handleHttpError(reject);
257
- }
258
- /**
259
- * request timeout, this must be handled like a generic server error per spec
260
- * unfortunately, so we have to jump to the next item (we cancelled before)
261
- * @param resolve
262
- * @param reject
263
- * @private
264
- */
265
- onTimeout(resolve, reject) {
266
- // timeout also means we we probably should clear the queue,
267
- // the state is unsafe for the next requests
268
- this.sendEvent(Const_1.STATE_EVT_TIMEOUT);
269
- this.handleHttpError(resolve);
270
- }
271
- /**
272
- * the response is received and normally is a normal response
273
- * but also can be some kind of error (http code >= 300)
274
- * In any case the response will be resolved either as error or response
275
- * and the next item in the queue will be processed
276
- * @param resolve
277
- * @private
278
- */
279
- onResponseReceived(resolve) {
280
- var _a;
281
- this.sendEvent(Const_1.COMPLETE);
282
- //request error resolution as per spec:
283
- if (!this.processRequestErrors(resolve)) {
284
- (0, Const_1.$faces)().ajax.response(this.xhrObject, (_a = this.responseContext.value) !== null && _a !== void 0 ? _a : {});
285
- }
286
- }
287
- processRequestErrors(resolve) {
288
- var _a, _b, _c, _d, _e;
289
- const responseXML = new mona_dish_1.XMLQuery((_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseXML);
290
- const responseText = (_c = (_b = this.xhrObject) === null || _b === void 0 ? void 0 : _b.responseText) !== null && _c !== void 0 ? _c : "";
291
- const responseCode = (_e = (_d = this.xhrObject) === null || _d === void 0 ? void 0 : _d.status) !== null && _e !== void 0 ? _e : -1;
292
- if (responseXML.isXMLParserError()) {
293
- // Firefox: malformed XML produces a Document with <parsererror>
294
- const errorName = "Invalid Response";
295
- const errorMessage = "The response xml is invalid";
296
- this.handleGenericResponseError(errorName, errorMessage, Const_1.MALFORMEDXML, resolve);
297
- return true;
298
- }
299
- else if (responseXML.isAbsent() && responseText.trim().length > 0) {
300
- // Chrome: responseXML is null for unparseable XML, but responseText has content
301
- const errorName = "Invalid Response";
302
- const errorMessage = "The response xml is invalid";
303
- this.handleGenericResponseError(errorName, errorMessage, Const_1.MALFORMEDXML, resolve);
304
- return true;
305
- }
306
- else if (responseXML.isAbsent()) {
307
- // Truly empty response
308
- const errorName = "Empty Response";
309
- const errorMessage = "The response has provided no data";
310
- this.handleGenericResponseError(errorName, errorMessage, Const_1.EMPTY_RESPONSE, resolve);
311
- return true;
312
- }
313
- else if (responseCode >= 300 || responseCode < 200) {
314
- this.handleHttpError(resolve);
315
- return true;
316
- }
317
- return false;
318
- }
319
- handleGenericResponseError(errorName, errorMessage, responseStatus, resolve) {
320
- var _a, _b, _c, _d;
321
- const errorData = new ErrorData_1.ErrorData(this.internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID).value, errorName, errorMessage, (_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText) !== null && _b !== void 0 ? _b : "", (_d = (_c = this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML) !== null && _d !== void 0 ? _d : null, this.xhrObject.status, responseStatus);
322
- this.finalizeError(errorData, resolve);
323
- }
324
- handleHttpError(resolveOrReject, errorMessage = "Generic HTTP Serror") {
325
- var _a, _b, _c, _d, _e, _f;
326
- this.stopProgress = true;
327
- const errorData = new ErrorData_1.ErrorData(this.internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID).value, Const_1.HTTP_ERROR, errorMessage, (_b = (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText) !== null && _b !== void 0 ? _b : "", (_d = (_c = this.xhrObject) === null || _c === void 0 ? void 0 : _c.responseXML) !== null && _d !== void 0 ? _d : null, (_f = (_e = this.xhrObject) === null || _e === void 0 ? void 0 : _e.status) !== null && _f !== void 0 ? _f : -1, Const_1.HTTP_ERROR);
328
- this.finalizeError(errorData, resolveOrReject);
329
- }
330
- finalizeError(errorData, resolveOrReject) {
331
- try {
332
- this.handleError(errorData, true);
333
- }
334
- finally {
335
- // we issue a resolveOrReject in this case to allow the system to recover
336
- // reject would clean up the queue
337
- // resolve would trigger the next element in the queue to be processed
338
- resolveOrReject(errorData);
339
- this.stopProgress = true;
340
- }
341
- }
342
- /**
343
- * last minute cleanup, the request now either is fully done
344
- * or not by having had a cancel or error event be
345
- * @param data
346
- * @param resolve
347
- * @private
348
- */
349
- onResponseProcessed(data, resolve) {
350
- // if stop progress true, the cleanup already has been performed
351
- if (this.stopProgress) {
352
- return;
353
- }
354
- /*
355
- * normal case, cleanup == next item if possible
356
- */
357
- resolve(data);
358
- }
359
- sendRequest(formData) {
360
- const isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
361
- if (formData.isMultipartRequest) {
362
- // in case of a multipart request we send in a formData object as body
363
- this.xhrObject.send((isPost) ? formData.toFormData() : null);
364
- }
365
- else {
366
- // in case of a normal request we send it normally
367
- this.xhrObject.send((isPost) ? formData.toString() : null);
368
- }
369
- }
370
- /*
371
- * other helpers
372
- */
373
- sendEvent(evtType) {
374
- var _a;
375
- const eventData = EventData_1.EventData.createFromRequest(this.xhrObject, this.internalContext, this.requestContext, evtType);
376
- try {
377
- // User code error, we might cover
378
- // this in onError, but also we cannot swallow it.
379
- // We need to resolve the local handlers lazily,
380
- // because some frameworks might decorate them over the context in the response
381
- let eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_EVENT);
382
- AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);
383
- }
384
- catch (e) {
385
- e.source = (_a = e === null || e === void 0 ? void 0 : e.source) !== null && _a !== void 0 ? _a : this.requestContext.getIf(Const_1.SOURCE).value;
386
- // this is a client error, no save state anymore for queue processing!
387
- this.handleErrorAndClearQueue(e);
388
- // we forward the error upward like all client side errors
389
- throw e;
390
- }
391
- }
392
- handleErrorAndClearQueue(e, responseFormatError = false) {
393
- this.handleError(e, responseFormatError);
394
- this.reject(e);
395
- }
396
- handleError(exception, responseFormatError = false) {
397
- var _a;
398
- const errorData = (responseFormatError) ? ErrorData_1.ErrorData.fromHttpConnection(exception.source, exception.type, (_a = exception.message) !== null && _a !== void 0 ? _a : Const_1.EMPTY_STR, exception.responseText, exception.responseXML, exception.responseCode, exception.status) : ErrorData_1.ErrorData.fromClient(exception);
399
- const eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
400
- AjaxImpl_1.Implementation.sendError(errorData, eventHandler);
401
- }
402
- appendIssuingItem(formData) {
403
- var _a, _b;
404
- const issuingItemId = this.internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID).value;
405
- //to avoid sideffects with buttons we only can append the issuing item if no behavior event is set
406
- //MYFACES-4679!
407
- const eventType = (_b = (_a = formData.getIf((0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)).value) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null;
408
- const isBehaviorEvent = (!!eventType) && eventType != 'click';
409
- //not encoded
410
- if (issuingItemId && formData.getIf(issuingItemId).isAbsent() && !isBehaviorEvent) {
411
- const issuingItem = mona_dish_1.DQ.byId(issuingItemId);
412
- const itemValue = issuingItem.inputValue;
413
- const arr = new ExtDomQuery_1.ExtConfig({});
414
- const type = issuingItem.type.orElse("").value.toLowerCase();
415
- //Checkbox and radio only value pass if checked is set, otherwise they should not show
416
- //up at all, and if checked is set, they either can have a value or simply being boolean
417
- if ((type == XhrRequest.TYPE_CHECKBOX || type == XhrRequest.TYPE_RADIO) && !issuingItem.checked) {
418
- return;
419
- }
420
- else if ((type == XhrRequest.TYPE_CHECKBOX || type == XhrRequest.TYPE_RADIO)) {
421
- arr.assign(issuingItemId).value = itemValue.orElse(true).value;
422
- }
423
- else if (itemValue.isPresent()) {
424
- arr.assign(issuingItemId).value = itemValue.value;
425
- }
426
- formData.shallowMerge(arr, true, true);
427
- }
428
- }
429
- }
430
- exports.XhrRequest = XhrRequest;
431
- XhrRequest.TYPE_CHECKBOX = "checkbox";
432
- XhrRequest.TYPE_RADIO = "radio";
433
- //# sourceMappingURL=XhrRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XhrRequest.js","sourceRoot":"","sources":["../../../../../../src/main/typescript/impl/xhrCore/XhrRequest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yDAAoE;AACpE,yCAA+C;AAC/C,0CAA2C;AAE3C,+CAA0C;AAC1C,2CAAsC;AACtC,2CAAsC;AACtC,uCAAqC;AACrC,yCAuCuB;AACvB,+DAI+B;AAC/B,MAAM,eAAe,GAAG,cAAO,CAAC,eAAe,CAAC;AAChD,qDAA8C;AAE9C;;;;;;;;;;;;;GAaG;AAEH,MAAa,UAAW,SAAQ,6BAA6B;IAazD;;;;;;;;;OASG;IACH,YACY,cAAyB,EACzB,eAAuB,EACvB,UAAU,kBAAU,EACpB,WAAW,qBAAa,EACxB,cAAc,mBAAW;QAEjC,KAAK,EAAE,CAAC;QANA,mBAAc,GAAd,cAAc,CAAW;QACzB,oBAAe,GAAf,eAAe,CAAQ;QACvB,YAAO,GAAP,OAAO,CAAa;QACpB,aAAQ,GAAR,QAAQ,CAAgB;QACxB,gBA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AAC,OAAO,EAAE,CAAC;gBAC7F,OAAO;YACX,CAAC;iBAAM,IAAG,CAAC,IAAI,IAAI,UAAU,CAAC,aAAa,IAAI,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC5E,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;YACnE,CAAC;iBAAM,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC/B,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;YACtD,CAAC;YAED,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;;AAvbL,gCAwbC;AA/amB,wBAAa,GAAG,UAAU,AAAb,CAAc;AAC3B,qBAAU,GAAG,OAAO,AAAV,CAAW"}
@@ -1,70 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
34
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
- };
36
- var __importStar = (this && this.__importStar) || (function () {
37
- var ownKeys = function(o) {
38
- ownKeys = Object.getOwnPropertyNames || function (o) {
39
- var ar = [];
40
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
41
- return ar;
42
- };
43
- return ownKeys(o);
44
- };
45
- return function (mod) {
46
- if (mod && mod.__esModule) return mod;
47
- var result = {};
48
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
49
- __setModuleDefault(result, mod);
50
- return result;
51
- };
52
- })();
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- /**
55
- * Shim to provide a default export for mona-dish.
56
- *
57
- * The npm package only has named exports, which breaks the pattern:
58
- * import pkg from 'mona-dish'; const { Lang } = pkg;
59
- *
60
- * Used via tsconfig paths (for tests/tsx). Webpack keeps its own alias to
61
- * index_core.ts for the reduced-core production bundle.
62
- *
63
- * Both import styles work:
64
- * import { Lang } from 'mona-dish' // named import
65
- * import pkg from 'mona-dish'; const { Lang } = pkg // default import
66
- */
67
- __exportStar(require("mona-dish/src/main/typescript/index"), exports);
68
- const _monaDish = __importStar(require("mona-dish/src/main/typescript/index"));
69
- exports.default = _monaDish;
70
- //# sourceMappingURL=mona_dish_shim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mona_dish_shim.js","sourceRoot":"","sources":["../../../../src/main/typescript/mona_dish_shim.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;GAYG;AACH,sEAAoD;AACpD,+EAAiE;AACjE,kBAAe,SAAS,CAAC"}
@@ -1,128 +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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.oam = void 0;
19
- const mona_dish_1 = require("mona-dish");
20
- const Lang_1 = require("../impl/util/Lang");
21
- /**
22
- * legacy code to enable various aspects
23
- * of myfaces, used to be rendered inline
24
- * for jsf 2.0 we can externalize it into its own custom resource
25
- *
26
- * note this is a straight 1:1 port from the existing codebase
27
- * (not too much work has been spent here, the important thing is, that
28
- * the namespace and functions need to be kept intact for legacy code)
29
- *
30
- * we might move the code over in the future, but for now a straight 1:1 port suffices
31
- */
32
- var oam;
33
- (function (oam) {
34
- const ofAssoc = Lang_1.ExtLang.ofAssoc;
35
- /**
36
- * sets a hidden input field
37
- * @param formName the formName
38
- * @param name the hidden field
39
- * @param value the value to be rendered
40
- */
41
- oam.setHiddenInput = function (formName, name, value) {
42
- mona_dish_1.DQ.byId(document.forms[formName])
43
- .each(form => {
44
- const input = form.querySelectorAll(`input[type='hidden'][name='${name}']`);
45
- if (input.isPresent()) {
46
- input.inputValue.value = value;
47
- }
48
- else {
49
- const newInput = mona_dish_1.DQ.fromMarkup(`<input type='hidden' id='${name}' name='${name}'>`);
50
- newInput.inputValue.value = value;
51
- newInput.appendTo(form);
52
- }
53
- });
54
- };
55
- /**
56
- * clears a hidden input field
57
- *
58
- * @param formName formName for the input
59
- * @param name the name of the input field
60
- */
61
- oam.clearHiddenInput = function (formName, name) {
62
- var _a, _b, _c;
63
- let element = (_c = (_b = (_a = document.forms) === null || _a === void 0 ? void 0 : _a[formName]) === null || _b === void 0 ? void 0 : _b.elements) === null || _c === void 0 ? void 0 : _c[name];
64
- if (!element) {
65
- return;
66
- }
67
- mona_dish_1.DQ.byId(element).delete();
68
- };
69
- // noinspection JSUnusedGlobalSymbols,JSUnusedLocalSymbols
70
- /**
71
- * does special form submit remapping
72
- * re-maps the issuing command link into something,
73
- * the "decode" of the command link on the server can understand
74
- *
75
- * @param formName
76
- * @param linkId
77
- * @param target
78
- * @param params
79
- */
80
- oam.submitForm = function (formName, linkId = null, target = null, params = {}) {
81
- var _a, _b, _c, _d, _e, _f;
82
- //handle a possible incoming null, not sure if this is used that way anywhere, but we allow it
83
- params = (!params) ? {} : params;
84
- let clearFn = 'clearFormHiddenParams_' + formName.replace(/-/g, '\$:').replace(/:/g, '_');
85
- (_a = window === null || window === void 0 ? void 0 : window[clearFn]) === null || _a === void 0 ? void 0 : _a.call(window, formName);
86
- //autoscroll code
87
- if (((_d = (_c = (_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.autoScroll) && (window === null || window === void 0 ? void 0 : window.getScrolling)) {
88
- myfaces.oam.setHiddenInput(formName, 'autoScroll', window === null || window === void 0 ? void 0 : window.getScrolling());
89
- }
90
- let paramsStream = Array.isArray(params) ? [...params] : ofAssoc(params);
91
- paramsStream.forEach(([key, data]) => myfaces.oam.setHiddenInput(formName, key, data));
92
- //we call the namespaced function, to allow decoration, via a direct call we would
93
- myfaces.oam.setHiddenInput(formName, `${formName}:_idcl`, linkId !== null && linkId !== void 0 ? linkId : '');
94
- mona_dish_1.DQ.byId((_f = (_e = document.forms) === null || _e === void 0 ? void 0 : _e[formName]) !== null && _f !== void 0 ? _f : document.getElementById(formName)).each(form => {
95
- var _a;
96
- const ATTR_TARGET = "target";
97
- const formElement = form.getAsElem(0).value;
98
- const oldTarget = form.getAsElem(0).value.getAttribute("target");
99
- if (target != "null" && target) {
100
- form.getAsElem(0).value.setAttribute("target", target);
101
- }
102
- const result = (_a = formElement === null || formElement === void 0 ? void 0 : formElement.onsubmit) === null || _a === void 0 ? void 0 : _a.call(formElement, null);
103
- try {
104
- if ((!!result) || 'undefined' == typeof result) {
105
- formElement.submit();
106
- }
107
- }
108
- catch (e) {
109
- window === null || window === void 0 ? void 0 : window.console.error(e);
110
- }
111
- finally {
112
- if (oldTarget == null || oldTarget == "null") {
113
- form.getAsElem(0).value.removeAttribute("target");
114
- }
115
- else {
116
- form.getAsElem(0).value.setAttribute("target", oldTarget);
117
- }
118
- // noinspection JSUnusedLocalSymbols
119
- paramsStream.forEach(([key, data]) => {
120
- myfaces.oam.clearHiddenInput(formName, key);
121
- });
122
- myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);
123
- }
124
- });
125
- return false;
126
- };
127
- })(oam || (exports.oam = oam = {}));
128
- //# sourceMappingURL=OamSubmit.js.map