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,748 +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.Implementation = void 0;
19
- const Response_1 = require("./xhrCore/Response");
20
- const XhrRequest_1 = require("./xhrCore/XhrRequest");
21
- const mona_dish_1 = require("mona-dish");
22
- const Assertions_1 = require("./util/Assertions");
23
- const ExtDomQuery_1 = require("./util/ExtDomQuery");
24
- const ErrorData_1 = require("./xhrCore/ErrorData");
25
- const Lang_1 = require("./util/Lang");
26
- const Const_1 = require("./core/Const");
27
- const RequestDataResolver_1 = require("./xhrCore/RequestDataResolver");
28
- const FileUtils_1 = require("./util/FileUtils");
29
- const XhrQueueController_1 = require("./util/XhrQueueController");
30
- /*
31
- * allowed project stages
32
- */
33
- var ProjectStages;
34
- (function (ProjectStages) {
35
- ProjectStages["Production"] = "Production";
36
- ProjectStages["Development"] = "Development";
37
- ProjectStages["SystemTest"] = "SystemTest";
38
- ProjectStages["UnitTest"] = "UnitTest";
39
- })(ProjectStages || (ProjectStages = {}));
40
- /*
41
- * Block-filter for the pass-through filtering; the attributes given here
42
- * will not be transmitted from the options into the pass-through
43
- */
44
- var BlockFilter;
45
- (function (BlockFilter) {
46
- BlockFilter["onerror"] = "onerror";
47
- BlockFilter["onevent"] = "onevent";
48
- BlockFilter["render"] = "render";
49
- BlockFilter["execute"] = "execute";
50
- BlockFilter["myfaces"] = "myfaces";
51
- BlockFilter["delay"] = "delay";
52
- BlockFilter["timeout"] = "timeout";
53
- BlockFilter["resetValues"] = "resetValues";
54
- BlockFilter["windowId"] = "windowId";
55
- BlockFilter["params"] = "params";
56
- })(BlockFilter || (BlockFilter = {}));
57
- /**
58
- * Core Implementation
59
- * to distinct between api and impl
60
- *
61
- * The original idea was to make the implementation pluggable
62
- * but this is pointless, you always can overwrite the thin api layer
63
- * however a dedicated api makes sense for readability reasons
64
- */
65
- var Implementation;
66
- (function (Implementation) {
67
- /*
68
- Small internal explanation, this code is optimized for readability
69
- and cuts off a ton of old legacy code.
70
- Aka older browsers are not supported anymore.
71
- We use a self written helper library to keep the number of external
72
- code dependencies down.
73
- The library is called mona-dish and started as a small sideproject of mine
74
- it provides following
75
-
76
- a) Monad like structures for querying because this keeps the code denser and adds abstractions
77
- that always was the strong point of jQuery, and it still is better in this regard than what ecmascript provides
78
-
79
- c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be
80
- transformed into different data representations
81
-
82
- examples:
83
- internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
84
- passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID
85
-
86
- basically an abbreviation for
87
-
88
- internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
89
- internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
90
- internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
91
-
92
-
93
- internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
94
- passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored
95
-
96
- abbreviates:
97
- if(condition) {
98
- internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
99
- internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
100
- internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
101
- }
102
-
103
-
104
- d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish
105
-
106
- Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use
107
-
108
- */
109
- const trim = mona_dish_1.Lang.trim;
110
- const getMessage = Lang_1.ExtLang.getMessage;
111
- const getGlobalConfig = Lang_1.ExtLang.getGlobalConfig;
112
- var assert = Assertions_1.Assertions.assert;
113
- const ofAssoc = Lang_1.ExtLang.ofAssoc;
114
- const collectAssoc = Lang_1.ExtLang.collectAssoc;
115
- let projectStage = null;
116
- let separator = null;
117
- let eventQueue = [];
118
- let errorQueue = [];
119
- Implementation.requestQueue = null;
120
- /*error reporting threshold*/
121
- let threshold = "ERROR";
122
- /**
123
- * fetches the separator char from the given script tags
124
- *
125
- * @return {string} the separator char for the given script tags
126
- */
127
- function getSeparatorChar() {
128
- var _a, _b;
129
- return (_b = (_a = resolveGlobalConfig()) === null || _a === void 0 ? void 0 : _a.separator) !== null && _b !== void 0 ? _b : (separator !== null && separator !== void 0 ? separator : (separator = ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value));
130
- }
131
- Implementation.getSeparatorChar = getSeparatorChar;
132
- /**
133
- * this is for testing purposes only, since AjaxImpl is a module
134
- * we need to reset for every unit test its internal states
135
- */
136
- function reset() {
137
- projectStage = null;
138
- separator = null;
139
- eventQueue = [];
140
- errorQueue = [];
141
- Implementation.requestQueue = null;
142
- }
143
- Implementation.reset = reset;
144
- /**
145
- * @return the project stage also emitted by the server:
146
- * it cannot be cached and must be delivered over the server
147
- * The value for it comes from the requestInternal parameter of the faces.js script called "stage".
148
- */
149
- function getProjectStage() {
150
- var _a, _b;
151
- return (_b = (_a = resolveGlobalConfig()) === null || _a === void 0 ? void 0 : _a.projectStage) !== null && _b !== void 0 ? _b : (projectStage !== null && projectStage !== void 0 ? projectStage : (projectStage = resolveProjectStateFromURL()));
152
- }
153
- Implementation.getProjectStage = getProjectStage;
154
- /**
155
- * resolves the project stage as url parameter
156
- * @return the project stage or null
157
- */
158
- function resolveProjectStateFromURL() {
159
- /* run through all script tags and try to find the one that includes faces.js */
160
- const foundStage = ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value;
161
- return (foundStage in ProjectStages) ? foundStage : ProjectStages.Production; // MYFACES-4572: default is production
162
- }
163
- Implementation.resolveProjectStateFromURL = resolveProjectStateFromURL;
164
- /**
165
- * implementation of the faces.util.chain functionality
166
- *
167
- * @param source
168
- * @param event
169
- * @param funcs
170
- */
171
- function chain(source, event, ...funcs) {
172
- // we can use our lazy stream each functionality to run our chain here.
173
- // by passing a boolean as return value into the onElem call
174
- // we can stop early at the first false, just like the spec requests
175
- let ret = true;
176
- funcs.every(func => {
177
- let returnVal = resolveAndExecute(source, event, func);
178
- if (returnVal === false) {
179
- ret = false;
180
- }
181
- //we short circuit in case of false and break the every loop
182
- return ret;
183
- });
184
- return ret;
185
- }
186
- Implementation.chain = chain;
187
- /**
188
- * this function has to send the ajax requests
189
- *
190
- * following request conditions must be met:
191
- * <ul>
192
- * <li> the request must be sent asynchronously! </li>
193
- * <li> the request must be a POST!!! request </li>
194
- * <li> the request url must be the form action attribute </li>
195
- * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
196
- * </ul>
197
- *
198
- * @param el any dom element no matter being it html or jsf, from which the event is emitted
199
- * @param event any javascript event supported by that object
200
- * @param opts map of options being pushed into the ajax cycle
201
- *
202
- * a) transformArguments out of the function
203
- * b) passThrough handling with a map copy with a filter map block map
204
- */
205
- function request(el, event, opts) {
206
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
207
- const { options, elem, elementId, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
208
- const requestCtx = new ExtDomQuery_1.ExtConfig({});
209
- const internalCtx = new ExtDomQuery_1.ExtConfig({});
210
- Assertions_1.Assertions.assertRequestIntegrity(options, elem);
211
- /**
212
- * fetch the parent form
213
- *
214
- * note we also add an override possibility here
215
- * so that people can use dummy forms and work
216
- * with detached objects
217
- */
218
- const form = (0, RequestDataResolver_1.resolveForm)(elem, event);
219
- const viewId = (0, RequestDataResolver_1.resolveViewId)(form);
220
- const formId = form.id.value;
221
- const delay = (0, RequestDataResolver_1.resolveDelay)(options);
222
- const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
223
- requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
224
- // old non - spec behavior will be removed after it is clear whether the removal breaks any code
225
- requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
226
- // spec conform behavior, all passthrough params must be under "passthrough
227
- const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
228
- //we turn off the remapping for the param merge, because we do not want to have
229
- //any namespacing to be remapped
230
- let ctxPassthrough = requestCtx.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
231
- ctxPassthrough.$nspEnabled = false;
232
- ctxPassthrough.shallowMerge(new mona_dish_1.Config(params), true);
233
- //now we turn it on again
234
- ctxPassthrough.$nspEnabled = true;
235
- requestCtx.assignIf(!!event, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EVT).value = event === null || event === void 0 ? void 0 : event.type;
236
- /**
237
- * ajax pass through context with the source
238
- * onresolved Event and onerror Event
239
- */
240
- requestCtx.assign(Const_1.SOURCE).value = elementId;
241
- requestCtx.assign(Const_1.VIEW_ID).value = viewId;
242
- /**
243
- * on resolvedEvent and onError...
244
- * those values will be traversed later on
245
- * also into the response context
246
- */
247
- requestCtx.assign(Const_1.ON_EVENT).value = (_a = options.value) === null || _a === void 0 ? void 0 : _a.onevent;
248
- requestCtx.assign(Const_1.ON_ERROR).value = (_b = options.value) === null || _b === void 0 ? void 0 : _b.onerror;
249
- /**
250
- * Fetch the myfaces config params
251
- */
252
- requestCtx.assign(Const_1.MYFACES).value = (_c = options.value) === null || _c === void 0 ? void 0 : _c.myfaces;
253
- /**
254
- * binding contract the jakarta.faces.source must be set
255
- */
256
- requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX_SOURCE).value = elementId;
257
- /**
258
- * jakarta.faces.partial.ajax must be set to true
259
- */
260
- requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX).value = true;
261
- /**
262
- * if resetValues is set to true
263
- * then we have to set jakarta.faces.resetValues as well
264
- * as pass through parameter
265
- * the value has to be explicitly true, according to
266
- * the specs jsdoc
267
- */
268
- requestCtx.assignIf(isResetValues, Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_RESET_VALUES).value = true;
269
- // additional meta information to speed things up, note internal non jsf
270
- // pass through options are stored under _mfInternal in the context
271
- internalCtx.assign(Const_1.CTX_PARAM_SRC_FRM_ID).value = formId;
272
- /**
273
- * special myfaces only internal parameter for onProgress until we have an official api
274
- * that way we can track the progress of a xhr request (useful for file uploads)
275
- */
276
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_PREINIT).value = (_f = (_e = (_d = options.value) === null || _d === void 0 ? void 0 : _d.myfaces) === null || _e === void 0 ? void 0 : _e.upload) === null || _f === void 0 ? void 0 : _f.preinit;
277
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOADSTART).value = (_j = (_h = (_g = options.value) === null || _g === void 0 ? void 0 : _g.myfaces) === null || _h === void 0 ? void 0 : _h.upload) === null || _j === void 0 ? void 0 : _j.loadstart;
278
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ON_PROGRESS).value = (_m = (_l = (_k = options.value) === null || _k === void 0 ? void 0 : _k.myfaces) === null || _l === void 0 ? void 0 : _l.upload) === null || _m === void 0 ? void 0 : _m.progress;
279
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOADEND).value = (_q = (_p = (_o = options.value) === null || _o === void 0 ? void 0 : _o.myfaces) === null || _p === void 0 ? void 0 : _p.upload) === null || _q === void 0 ? void 0 : _q.loadend;
280
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_LOAD).value = (_t = (_s = (_r = options.value) === null || _r === void 0 ? void 0 : _r.myfaces) === null || _s === void 0 ? void 0 : _s.upload) === null || _t === void 0 ? void 0 : _t.load;
281
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ERROR).value = (_w = (_v = (_u = options.value) === null || _u === void 0 ? void 0 : _u.myfaces) === null || _v === void 0 ? void 0 : _v.upload) === null || _w === void 0 ? void 0 : _w.error;
282
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_ABORT).value = (_z = (_y = (_x = options.value) === null || _x === void 0 ? void 0 : _x.myfaces) === null || _y === void 0 ? void 0 : _y.upload) === null || _z === void 0 ? void 0 : _z.abort;
283
- internalCtx.assign(Const_1.CTX_PARAM_UPLOAD_TIMEOUT).value = (_2 = (_1 = (_0 = options.value) === null || _0 === void 0 ? void 0 : _0.myfaces) === null || _1 === void 0 ? void 0 : _1.upload) === null || _2 === void 0 ? void 0 : _2.timeout;
284
- // mojarra compatibility, mojarra is sending the form id as well
285
- // this is not documented behavior but can be determined by running
286
- // mojarra under blackbox conditions.
287
- // I assume it does the same as our formId_submit=1 so leaving it out
288
- // won't hurt but for the sake of compatibility we are going to add it
289
- requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
290
- internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
291
- // reintroduction of PPS as per myfaces 2.3 (myfaces.pps = true, only the executes are submitted)
292
- internalCtx.assign(Const_1.CTX_PARAM_PPS).value = (_4 = (_3 = extractMyFacesParams(options.value)) === null || _3 === void 0 ? void 0 : _3[Const_1.MYFACES_OPTION_PPS]) !== null && _4 !== void 0 ? _4 : false;
293
- assignClientWindowId(form, requestCtx);
294
- assignExecute(options, requestCtx, form, elementId);
295
- assignRender(options, requestCtx, form, elementId);
296
- assignNamingContainerData(internalCtx, form);
297
- //now we enqueue the request as asynchronous runnable into our request
298
- //queue and let the queue take over the rest
299
- Implementation.queueHandler.addRequestToQueue(elem, form, requestCtx, internalCtx, delay, timeout);
300
- }
301
- Implementation.request = request;
302
- /**
303
- * Spec. 13.3.3
304
- * Examining the response markup and updating the DOM tree
305
- * @param {XMLHttpRequest} request - the ajax request
306
- * @param {Object} context - the ajax context
307
- */
308
- function response(request, context) {
309
- Response_1.Response.processResponse(request, context);
310
- }
311
- Implementation.response = response;
312
- /**
313
- * adds an error handler to the error queue
314
- *
315
- * @param errorListener the error listener handler
316
- */
317
- function addOnError(errorListener) {
318
- errorQueue.push(errorListener);
319
- }
320
- Implementation.addOnError = addOnError;
321
- /**
322
- * adds an event handler to the event queue
323
- *
324
- * @param eventListener the event listener handler
325
- */
326
- function addOnEvent(eventListener) {
327
- eventQueue.push(eventListener);
328
- }
329
- Implementation.addOnEvent = addOnEvent;
330
- // noinspection JSUnusedLocalSymbols
331
- /**
332
- * sends an event to the event handlers
333
- *
334
- * @param data the event data object hosting the event data according to the spec @see EventData for what is reachable
335
- * @param localHandler an optional event handler, which is processed before the event handler chain
336
- */
337
- function sendEvent(data, localHandler = function (data) {
338
- }) {
339
- /*now we serve the queue as well*/
340
- localHandler(data);
341
- eventQueue.forEach(fn => fn(data));
342
- }
343
- Implementation.sendEvent = sendEvent;
344
- /**
345
- * error handler behavior called internally
346
- * and only into the impl it takes care of the
347
- * internal message transformation to a myfaces internal error
348
- * and then uses the standard send error mechanisms
349
- * also a double error logging prevention is done as well
350
- *
351
- * @param request the request currently being processed
352
- * @param context the context affected by this error
353
- * @param exception the exception being thrown
354
- * @param clearRequestQueue if set to true, clears the request queue of all pending requests
355
- */
356
- function stdErrorHandler(request, context, exception, clearRequestQueue = false) {
357
- //newer browsers do not allow to hold additional values on native objects like exceptions
358
- //we hence capsule it into the request, which is gced automatically
359
- //on ie as well, since the stdErrorHandler usually is called between requests
360
- //this is a valid approach
361
- try {
362
- if (threshold == "ERROR") {
363
- let errorData = ErrorData_1.ErrorData.fromClient(exception);
364
- sendError(errorData);
365
- }
366
- }
367
- finally {
368
- if (clearRequestQueue) {
369
- Implementation.requestQueue.clear();
370
- }
371
- }
372
- }
373
- Implementation.stdErrorHandler = stdErrorHandler;
374
- // noinspection JSUnusedLocalSymbols
375
- /**
376
- * implementation triggering the error chain
377
- *
378
- *
379
- *
380
- * handles the errors, in case of an onError exists within the context the onError is called as local error handler
381
- * the registered error handlers in the queue received an error message to be dealt with
382
- * and if the projectStage is at development an alert box is displayed
383
- *
384
- * note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided
385
- * which changes the default output behavior from alert to something else
386
- *
387
- * @param errorData the error data to be displayed
388
- * @param localHandler an optional local error handler which has to be processed before the error handler queue
389
- */
390
- function sendError(errorData, localHandler = function (data) {
391
- }) {
392
- localHandler(errorData);
393
- errorQueue.forEach((errorCallback) => {
394
- errorCallback(errorData);
395
- });
396
- let displayError = getGlobalConfig("defaultErrorOutput", (console ? console.error : alert));
397
- displayError(errorData);
398
- }
399
- Implementation.sendError = sendError;
400
- /**
401
- * @node optional element or id defining a rootnode where an element with the id "jakarta.faces.windowId" is hosted
402
- * @return the client window id of the current window, if one is given if none is found, null is returned
403
- */
404
- function getClientWindow(node) {
405
- const ALTERED = "___mf_id_altered__";
406
- const INIT = "___init____";
407
- /*
408
- * the search root for the dom element search
409
- */
410
- let searchRoot = ((node) ? mona_dish_1.DQ.byId(node) : (0, mona_dish_1.DQ$)("form"));
411
- let inputs = searchRoot
412
- .filterSelector(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`)
413
- .orElseLazy(() => searchRoot.querySelectorAll(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`));
414
- /*
415
- * lazy helper to fetch the window id from the included faces.js
416
- */
417
- let fetchWindowIdFromJSFJS = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null);
418
- /*
419
- * fetch window id from the url
420
- */
421
- let fetchWindowIdFromURL = function () {
422
- const href = window.location.href, windowId = "jfwid";
423
- const regex = new RegExp("[\\?&]" + windowId + "=([^&#\\;]*)");
424
- const results = regex.exec(href);
425
- //initial trial over the url and a regexp
426
- if (results != null)
427
- return mona_dish_1.Optional.fromNullable(results[1]);
428
- return mona_dish_1.Optional.fromNullable(null);
429
- };
430
- /*
431
- * functional double check based on stream reduction
432
- * the values should be identical or on INIT value which is a premise to
433
- * skip the first check
434
- *
435
- * @param value1
436
- * @param value2
437
- */
438
- let differenceCheck = (value1, value2) => {
439
- if (value1 == INIT) {
440
- return value2;
441
- }
442
- else if (value1 == ALTERED || value1 != value2) {
443
- return ALTERED;
444
- }
445
- return value2;
446
- };
447
- /*
448
- * helper for cleaner code, maps the value from an item
449
- *
450
- * @param item
451
- */
452
- let getValue = (item) => item.val;
453
- /*
454
- * fetch the window id from the forms
455
- * window ids must be present in all forms
456
- * or non-existent. If they exist all of them must be the same
457
- */
458
- let formWindowId = inputs.asArray.map(getValue).reduce(differenceCheck, INIT);
459
- //if the resulting window id is set on altered then we have an unresolvable problem
460
- assert(ALTERED != formWindowId, "Multiple different windowIds found in document");
461
- /*
462
- * return the window id or null
463
- */
464
- return formWindowId != INIT ? formWindowId : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS()).value;
465
- }
466
- Implementation.getClientWindow = getClientWindow;
467
- /**
468
- * collect and encode data for a given form element (must be of type form)
469
- * find the jakarta.faces.ViewState element and encode its value as well!
470
- * @return a concatenated string of the encoded values!
471
- *
472
- * @throws Error in case of the given element not being of type form!
473
- * https://issues.apache.org/jira/browse/MYFACES-2110
474
- */
475
- function getViewState(form) {
476
- /**
477
- * type-check assert!, we opt for strong typing here
478
- * because it makes it easier to detect bugs
479
- */
480
- let element = mona_dish_1.DQ.byId(form, true);
481
- if (!element.isTag(Const_1.HTML_TAG_FORM)) {
482
- throw new Error(getMessage("ERR_VIEWSTATE"));
483
- }
484
- // determine the naming container scenario
485
- const dummyContext = new mona_dish_1.Config({});
486
- assignNamingContainerData(dummyContext, mona_dish_1.DQ.byId(form));
487
- // fetch all non file input form elements
488
- let formElements = element.deepElements.encodeFormElement();
489
- // encode them! (file inputs are handled differently and are not part of the viewstate)
490
- return (0, FileUtils_1.encodeFormData)(new ExtDomQuery_1.ExtConfig(formElements), (0, RequestDataResolver_1.resoveNamingContainerMapper)(dummyContext));
491
- }
492
- Implementation.getViewState = getViewState;
493
- /**
494
- * this at the first sight looks like a weird construct, but we need to do it this way
495
- * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,
496
- * but we need to keep it under unit tests.
497
- */
498
- Implementation.queueHandler = {
499
- /**
500
- * public to make it accessible for tests
501
- *
502
- * adds a new request to our queue for further processing
503
- */
504
- addRequestToQueue: function (elem, form, reqCtx, respPassThr, delay = 0, timeout = 0) {
505
- Implementation.requestQueue = Implementation.requestQueue !== null && Implementation.requestQueue !== void 0 ? Implementation.requestQueue : new XhrQueueController_1.XhrQueueController();
506
- Implementation.requestQueue.enqueue(new XhrRequest_1.XhrRequest(reqCtx, respPassThr, timeout), delay);
507
- }
508
- };
509
- //----------------------------------------------- Methods ---------------------------------------------------------------------
510
- /**
511
- * the idea is to replace some placeholder parameters with their respective values
512
- * placeholder params like @all, @none, @form, @this need to be replaced by
513
- * the values defined by the specification
514
- *
515
- * This function does it for the render parameters
516
- *
517
- * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
518
- * @param targetContext the receiving target context
519
- * @param issuingForm the issuing form
520
- * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
521
- */
522
- function assignRender(requestOptions, targetContext, issuingForm, sourceElementId) {
523
- if (requestOptions.getIf(Const_1.CTX_PARAM_RENDER).isPresent()) {
524
- remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_RENDER, requestOptions.getIf(Const_1.CTX_PARAM_RENDER).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
525
- }
526
- }
527
- /**
528
- * the idea is to replace some placeholder parameters with their respective values
529
- * placeholder params like @all, @none, @form, @this need to be replaced by
530
- * the values defined by the specification
531
- *
532
- * This function does it for the execute parameters
533
- *
534
- * @param requestOptions the source options coming in as options object from faces.ajax.request (options parameter)
535
- * @param targetContext the receiving target context
536
- * @param issuingForm the issuing form
537
- * @param sourceElementId the executing element triggering the faces.ajax.request (id of it)
538
- */
539
- function assignExecute(requestOptions, targetContext, issuingForm, sourceElementId) {
540
- if (requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).isPresent()) {
541
- /*the options must be a blank delimited list of strings*/
542
- /*compliance with Mojarra which automatically adds @this to an execute
543
- * the spec rev 2.0a however states, if none is issued nothing at all should be sent down
544
- */
545
- requestOptions.assign(Const_1.CTX_OPTIONS_EXECUTE).value = [requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, Const_1.IDENT_THIS].join(" ");
546
- remapDefaultConstants(targetContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR).get({}), Const_1.P_EXECUTE, requestOptions.getIf(Const_1.CTX_OPTIONS_EXECUTE).value, issuingForm, sourceElementId, targetContext.getIf(Const_1.VIEW_ID).value);
547
- }
548
- else {
549
- targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).value = sourceElementId;
550
- }
551
- }
552
- /**
553
- * apply the browser tab where the request was originating from
554
- *
555
- * @param form the form hosting the client window id
556
- * @param targetContext the target context receiving the value
557
- */
558
- function assignClientWindowId(form, targetContext) {
559
- let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);
560
- if (clientWindow) {
561
- targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;
562
- }
563
- }
564
- /**
565
- * determines the current naming container
566
- * and assigns it internally
567
- *
568
- * @param internalContext
569
- * @param formElement
570
- * @private
571
- */
572
- function assignNamingContainerData(internalContext, formElement) {
573
- const viewRootId = (0, RequestDataResolver_1.resolveViewRootId)(formElement);
574
- if (!!viewRootId) {
575
- internalContext.assign(Const_1.NAMED_VIEWROOT).value = true;
576
- internalContext.assign(Const_1.NAMING_CONTAINER_ID).value = viewRootId;
577
- }
578
- }
579
- /**
580
- * transforms the user values to the expected values
581
- * handling '@none', '@all', '@form', and '@this' appropriately.
582
- * (Note: Although we could employ a simple string replacement method,
583
- * it could result in duplicate entries under certain conditions.)
584
- *
585
- * Specific standardized constants such as
586
- * '@all', '@none', '@form', and '@this'
587
- * require special treatment.
588
- *
589
- * @param targetConfig the target configuration receiving the final values
590
- * @param targetKey the target key
591
- * @param userValues the passed user values (aka input string which needs to be transformed)
592
- * @param issuingForm the form where the issuing element originates
593
- * @param issuingElementId the issuing element
594
- * @param rootNamingContainerId the naming container id ("" default if none is given)
595
- */
596
- function remapDefaultConstants(targetConfig, targetKey, userValues, issuingForm, issuingElementId, rootNamingContainerId = "") {
597
- //a cleaner implementation of the transform list method
598
- const SEP = (0, Const_1.$faces)().separatorchar;
599
- let iterValues = (userValues) ? trim(userValues).split(/\s+/gi) : [];
600
- let ret = [];
601
- let processed = {};
602
- /**
603
- * remaps the client ids for the portlet case so that the server
604
- * can deal with them either prefixed ir not
605
- * also resolves the absolute id case (it was assumed the server does this, but
606
- * apparently the RI does not, so we have to follow the RI behavior here)
607
- * @param componentIdToTransform the componentId which needs post-processing
608
- */
609
- const remapNamingContainer = componentIdToTransform => {
610
- // pattern :<anything> must be prepended by viewRoot if there is one,
611
- // otherwise we are in a not namespaced then only the id has to match
612
- const rootNamingContainerPrefix = (rootNamingContainerId.length) ? rootNamingContainerId + SEP : Const_1.EMPTY_STR;
613
- let formClientId = issuingForm.id.value;
614
- // nearest parent naming container relative to the form
615
- const nearestNamingContainer = formClientId.substring(0, formClientId.lastIndexOf(SEP));
616
- const nearestNamingContainerPrefix = (nearestNamingContainer.length) ? nearestNamingContainer + SEP : Const_1.EMPTY_STR;
617
- // Absolute search expressions, always start with SEP or the name of the root naming container
618
- const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
619
- const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
620
- && componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
621
- let finalIdentifier;
622
- if (isAbsolutSearchExpr) {
623
- //we cut off the leading sep if there is one
624
- componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
625
- componentIdToTransform = componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0 ? componentIdToTransform.substring(rootNamingContainerPrefix.length) : componentIdToTransform;
626
- //now we prepend either the prefix or "" from the cut-off string to get the final result
627
- finalIdentifier = [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
628
- }
629
- else { //relative search according to the javadoc
630
- //we cut off the root naming container id from the form
631
- if (formClientId.indexOf(rootNamingContainerPrefix) == 0) {
632
- formClientId = formClientId.substring(rootNamingContainerPrefix.length);
633
- }
634
- //If prependId = true, the outer form id must be present in the id if same form
635
- let hasPrependId = componentIdToTransform.indexOf(formClientId) == 0;
636
- finalIdentifier = hasPrependId ?
637
- [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR) :
638
- [nearestNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
639
- }
640
- // We need to double-check because we have scenarios where we have a naming container
641
- // and no prepend (aka tobago testcase "must handle ':' in IDs properly", scenario 3,
642
- // in this case we return the component id, and be happy
643
- // we can roll a dom check here
644
- return mona_dish_1.DQ.byId(finalIdentifier).isPresent() ? finalIdentifier : componentIdToTransform;
645
- };
646
- // in this case we do not use lazy stream because it won´t bring any code reduction
647
- // or speedup
648
- for (let cnt = 0; cnt < iterValues.length; cnt++) {
649
- //avoid doubles
650
- if (iterValues[cnt] in processed) {
651
- continue;
652
- }
653
- switch (iterValues[cnt]) {
654
- //@none no values should be sent
655
- case Const_1.IDENT_NONE:
656
- return targetConfig.delete(targetKey);
657
- //@all is a pass through case according to the spec
658
- case Const_1.IDENT_ALL:
659
- targetConfig.assign(targetKey).value = Const_1.IDENT_ALL;
660
- return targetConfig;
661
- //@form pushes the issuing form id into our list
662
- case Const_1.IDENT_FORM:
663
- ret.push(remapNamingContainer(issuingForm.id.value));
664
- processed[issuingForm.id.value] = true;
665
- break;
666
- //@this is replaced with the current issuing element id
667
- case Const_1.IDENT_THIS:
668
- if (!(issuingElementId in processed)) {
669
- ret.push(remapNamingContainer(issuingElementId));
670
- processed[issuingElementId] = true;
671
- }
672
- break;
673
- default:
674
- ret.push(remapNamingContainer(iterValues[cnt]));
675
- processed[iterValues[cnt]] = true;
676
- }
677
- }
678
- targetConfig.assign(targetKey).value = ret.join(" ");
679
- return targetConfig;
680
- }
681
- /**
682
- * Filters the provided options using a blacklist to ensure
683
- * only pass-through parameters are processed for the Ajax request.
684
- *
685
- * Note that this issue is leftover from a previous implementation.
686
- * The specification-conforming behavior is to use parameters for pass-through values.
687
- * This will be addressed soon, after confirming that removal won't break any legacy code.
688
- *
689
- * @param {Context} mappedOpts - The options to be filtered.
690
- */
691
- function extractLegacyParams(mappedOpts) {
692
- //we now can use the full code reduction given by our stream api
693
- //to filter
694
- return ofAssoc(mappedOpts)
695
- .filter((item => !(item[0] in BlockFilter)))
696
- .reduce(collectAssoc, {});
697
- }
698
- /**
699
- * Extracts the MyFaces configuration parameters
700
- * that augment JSF with additional functionality.
701
- *
702
- * @param mappedOpts
703
- * @private
704
- */
705
- function extractMyFacesParams(mappedOpts) {
706
- var _a;
707
- //we now can use the full code reduction given by our stream api
708
- //to filter
709
- return (_a = ofAssoc(mappedOpts)
710
- .filter((item => (item[0] == "myfaces")))
711
- .reduce(collectAssoc, {})) === null || _a === void 0 ? void 0 : _a[Const_1.MYFACES];
712
- }
713
- function remapArrayToAssocArr(arrayedParams) {
714
- if (Array.isArray(arrayedParams)) {
715
- return arrayedParams.reduce(collectAssoc, {});
716
- }
717
- return arrayedParams;
718
- }
719
- function resolveGlobalConfig() {
720
- var _a, _b;
721
- return (_b = (_a = window === null || window === void 0 ? void 0 : window[Const_1.MYFACES]) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {};
722
- }
723
- /**
724
- * Private helper to execute a function or code fragment
725
- * @param source the source of the caller passed into the function as this
726
- * @param event an event which needs to be passed down into the function
727
- * @param func either a function or code fragment
728
- * @return a boolean value, if the passed function returns false, then the
729
- * caller is basically notified that the execution can now stop (JSF requirement for chain)
730
- * @private
731
- */
732
- function resolveAndExecute(source, event, func) {
733
- if ("string" != typeof func) {
734
- //function is passed down as chain parameter, can be executed as is
735
- return func.call(source, event) !== false;
736
- }
737
- else {
738
- //either a function or a string can be passed in case of a string we have to wrap it into another function
739
- //it is not a plain executable code but a definition
740
- let sourceCode = trim(func);
741
- if (sourceCode.indexOf("function ") == 0) {
742
- sourceCode = `return ${sourceCode} (event)`;
743
- }
744
- return new Function("event", sourceCode).call(source, event) !== false;
745
- }
746
- }
747
- })(Implementation || (exports.Implementation = Implementation = {}));
748
- //# sourceMappingURL=AjaxImpl.js.map