jsf.js_next_gen 4.0.1-beta.5 → 4.0.1-beta.7

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 (188) hide show
  1. package/dist/docs/assets/style.css +4 -5
  2. package/dist/window/faces-development.js +111 -91
  3. package/dist/window/faces-development.js.br +0 -0
  4. package/dist/window/faces-development.js.gz +0 -0
  5. package/dist/window/faces-development.js.map +1 -1
  6. package/dist/window/faces.js +1 -1
  7. package/dist/window/faces.js.br +0 -0
  8. package/dist/window/faces.js.gz +0 -0
  9. package/dist/window/faces.js.map +1 -1
  10. package/dist/window/jsf-development.js +111 -91
  11. package/dist/window/jsf-development.js.br +0 -0
  12. package/dist/window/jsf-development.js.gz +0 -0
  13. package/dist/window/jsf-development.js.map +1 -1
  14. package/dist/window/jsf.js +1 -1
  15. package/dist/window/jsf.js.br +0 -0
  16. package/dist/window/jsf.js.gz +0 -0
  17. package/dist/window/jsf.js.map +1 -1
  18. package/package.json +10 -10
  19. package/src/main/typescript/impl/util/XhrQueueController.ts +3 -17
  20. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +94 -51
  21. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
  22. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +126 -0
  23. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +60 -0
  24. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/bootstrap-icons.css +15 -0
  25. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/css/tobago.css +15 -0
  26. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/js/tobago.js +15 -0
  27. package/src/main/typescript/test/myfaces/{OnLoadSpec.ts → OnLoad.spec.ts} +2 -2
  28. package/src/main/typescript/test/xhrCore/ErrorChainTest.spec.ts +136 -0
  29. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +9 -12
  30. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +1 -1
  31. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +18 -0
  32. package/target/AssocArray.js +281 -0
  33. package/target/AssocArray.js.map +1 -0
  34. package/target/Config.js +235 -0
  35. package/target/Config.js.map +1 -0
  36. package/target/CryptoExtensions.js +112 -0
  37. package/target/CryptoExtensions.js.map +1 -0
  38. package/target/DomQuery.js +1963 -0
  39. package/target/DomQuery.js.map +1 -0
  40. package/target/Es2019Array.js +117 -0
  41. package/target/Es2019Array.js.map +1 -0
  42. package/target/Global.js +38 -0
  43. package/target/Global.js.map +1 -0
  44. package/target/IDomQuery.js +3 -0
  45. package/target/IDomQuery.js.map +1 -0
  46. package/target/Lang.js +183 -0
  47. package/target/Lang.js.map +1 -0
  48. package/target/Messaging.js +645 -0
  49. package/target/Messaging.js.map +1 -0
  50. package/target/Monad.js +330 -0
  51. package/target/Monad.js.map +1 -0
  52. package/target/Promise.js +296 -0
  53. package/target/Promise.js.map +1 -0
  54. package/target/PromiseShim.js +30 -0
  55. package/target/PromiseShim.js.map +1 -0
  56. package/target/SourcesCollectors.js +444 -0
  57. package/target/SourcesCollectors.js.map +1 -0
  58. package/target/Stream.js +562 -0
  59. package/target/Stream.js.map +1 -0
  60. package/target/TagBuilder.js +178 -0
  61. package/target/TagBuilder.js.map +1 -0
  62. package/target/XmlQuery.js +84 -0
  63. package/target/XmlQuery.js.map +1 -0
  64. package/target/impl/util/XhrQueueController.js +3 -18
  65. package/target/impl/util/XhrQueueController.js.map +1 -1
  66. package/target/impl/xhrCore/XhrRequest.js +89 -45
  67. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  68. package/target/index.js +80 -0
  69. package/target/index.js.map +1 -0
  70. package/target/index_core.js +76 -0
  71. package/target/index_core.js.map +1 -0
  72. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
  73. package/target/test/frameworkBase/_ext/shared/StandardInits.js +124 -0
  74. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  75. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +57 -1
  76. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  77. package/target/test/myfaces/OnLoad.spec.js +57 -0
  78. package/target/test/myfaces/OnLoad.spec.js.map +1 -0
  79. package/target/test/myfaces/OnLoadSpec.js +2 -2
  80. package/target/test/myfaces/OnLoadSpec.js.map +1 -1
  81. package/target/test/xhrCore/ErrorChainTest.spec.js +156 -0
  82. package/target/test/xhrCore/ErrorChainTest.spec.js.map +1 -0
  83. package/target/test/xhrCore/NamespacesRequestTest.spec.js +8 -5
  84. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
  85. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  86. package/target/test/xhrCore/ResponseTest23.spec.js +13 -0
  87. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  88. package/target/types/main/typescript/AssocArray.d.ts +86 -0
  89. package/target/types/main/typescript/Config.d.ts +94 -0
  90. package/target/types/main/typescript/CryptoExtensions.d.ts +87 -0
  91. package/target/types/main/typescript/DomQuery.d.ts +587 -0
  92. package/target/types/main/typescript/Es2019Array.d.ts +30 -0
  93. package/target/types/main/typescript/Global.d.ts +23 -0
  94. package/target/types/main/typescript/IDomQuery.d.ts +480 -0
  95. package/target/types/main/typescript/Lang.d.ts +97 -0
  96. package/target/types/main/typescript/Messaging.d.ts +285 -0
  97. package/target/types/main/typescript/Monad.d.ts +161 -0
  98. package/target/types/main/typescript/Promise.d.ts +58 -0
  99. package/target/types/main/typescript/PromiseShim.d.ts +22 -0
  100. package/target/types/main/typescript/SourcesCollectors.d.ts +280 -0
  101. package/target/types/main/typescript/Stream.d.ts +284 -0
  102. package/target/types/main/typescript/TagBuilder.d.ts +50 -0
  103. package/target/types/main/typescript/XmlQuery.d.ts +31 -0
  104. package/target/types/main/typescript/api/_api.d.ts +182 -0
  105. package/target/types/main/typescript/api/faces.d.ts +17 -0
  106. package/target/types/main/typescript/api/jsf.d.ts +17 -0
  107. package/target/types/main/typescript/impl/AjaxImpl.d.ts +164 -0
  108. package/target/types/main/typescript/impl/PushImpl.d.ts +38 -0
  109. package/target/types/main/typescript/impl/core/Const.d.ts +138 -0
  110. package/target/types/main/typescript/impl/core/ImplTypes.d.ts +16 -0
  111. package/target/types/main/typescript/impl/i18n/Messages.d.ts +102 -0
  112. package/target/types/main/typescript/impl/util/Assertions.d.ts +46 -0
  113. package/target/types/main/typescript/impl/util/AsyncRunnable.d.ts +112 -0
  114. package/target/types/main/typescript/impl/util/ExtDomQuery.d.ts +100 -0
  115. package/target/types/main/typescript/impl/util/FileUtils.d.ts +25 -0
  116. package/target/types/main/typescript/impl/util/HiddenInputBuilder.d.ts +37 -0
  117. package/target/types/main/typescript/impl/util/IListener.d.ts +18 -0
  118. package/target/types/main/typescript/impl/util/Lang.d.ts +138 -0
  119. package/target/types/main/typescript/impl/util/XhrQueueController.d.ts +51 -0
  120. package/target/types/main/typescript/impl/xhrCore/ErrorData.d.ts +37 -0
  121. package/target/types/main/typescript/impl/xhrCore/EventData.d.ts +25 -0
  122. package/target/types/main/typescript/impl/xhrCore/IResponseProcessor.d.ts +136 -0
  123. package/target/types/main/typescript/impl/xhrCore/RequestDataResolver.d.ts +84 -0
  124. package/target/types/main/typescript/impl/xhrCore/ResonseDataResolver.d.ts +60 -0
  125. package/target/types/main/typescript/impl/xhrCore/Response.d.ts +29 -0
  126. package/target/types/main/typescript/impl/xhrCore/ResponseProcessor.d.ts +208 -0
  127. package/target/types/main/typescript/impl/xhrCore/XhrFormData.d.ts +83 -0
  128. package/target/types/main/typescript/impl/xhrCore/XhrRequest.d.ts +102 -0
  129. package/target/types/main/typescript/index.d.ts +34 -0
  130. package/target/types/main/typescript/index_core.d.ts +29 -0
  131. package/target/types/main/typescript/myfaces/OamSubmit.d.ts +53 -0
  132. package/target/types/main/typescript/test/frameworkBase/LangTest.spec.d.ts +1 -0
  133. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.d.ts +1 -0
  134. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.d.ts +16 -0
  135. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.d.ts +39 -0
  136. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.d.ts +16 -0
  137. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.d.ts +16 -0
  138. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/XmlQueryTest.spec.d.ts +0 -0
  139. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.d.ts +1 -0
  140. package/target/types/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.d.ts +1 -0
  141. package/target/types/main/typescript/test/frameworkBase/_ext/shared/StandardInits.d.ts +63 -0
  142. package/target/types/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.d.ts +23 -0
  143. package/target/types/main/typescript/test/impl/ImplTest.spec.d.ts +16 -0
  144. package/target/types/main/typescript/test/impl/ImplTest_23.spec.d.ts +16 -0
  145. package/target/types/main/typescript/test/impl/SeparatorCharsTest.spec.d.ts +16 -0
  146. package/target/types/main/typescript/test/myfaces/OamSubmit.spec.d.ts +16 -0
  147. package/target/types/main/typescript/test/myfaces/OnLoad.spec.d.ts +16 -0
  148. package/target/types/main/typescript/test/queue/AsynchronousProbe.d.ts +38 -0
  149. package/target/types/main/typescript/test/queue/AsynchronousQueueTest.spec.d.ts +16 -0
  150. package/target/types/main/typescript/test/xhrCore/ClientWindow.spec.d.ts +1 -0
  151. package/target/types/main/typescript/test/xhrCore/ErrorChainTest.spec.d.ts +16 -0
  152. package/target/types/main/typescript/test/xhrCore/EventTests.spec.d.ts +16 -0
  153. package/target/types/main/typescript/test/xhrCore/FakeWebsocket.d.ts +24 -0
  154. package/target/types/main/typescript/test/xhrCore/FileUploadTest.spec.d.ts +1 -0
  155. package/target/types/main/typescript/test/xhrCore/NamespacesRequestTest.spec.d.ts +16 -0
  156. package/target/types/main/typescript/test/xhrCore/OamSubmitTest.spec.d.ts +16 -0
  157. package/target/types/main/typescript/test/xhrCore/RequestParamsTest.spec.d.ts +1 -0
  158. package/target/types/main/typescript/test/xhrCore/RequestTest.spec.d.ts +16 -0
  159. package/target/types/main/typescript/test/xhrCore/RequestTest_23.spec.d.ts +16 -0
  160. package/target/types/main/typescript/test/xhrCore/ResponseTest.spec.d.ts +16 -0
  161. package/target/types/main/typescript/test/xhrCore/ResponseTest23.spec.d.ts +16 -0
  162. package/target/types/main/typescript/test/xhrCore/ShadowDomTest.spec.d.ts +16 -0
  163. package/target/types/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.d.ts +1 -0
  164. package/target/types/main/typescript/test/xhrCore/WebsocketTest.d.ts +1 -0
  165. package/target/types/main/typescript/test/xhrCore/XhrFormDataTest.spec.d.ts +16 -0
  166. package/target/types/test/typescript/AssocArrayTest.spec.d.ts +1 -0
  167. package/target/types/test/typescript/DomQueryTest.spec.d.ts +1 -0
  168. package/target/types/test/typescript/ExtendedArrayTest.spec.d.ts +1 -0
  169. package/target/types/test/typescript/LangTest.spec.d.ts +1 -0
  170. package/target/types/test/typescript/MappingProbes.d.ts +24 -0
  171. package/target/types/test/typescript/MappingTest.spec.d.ts +1 -0
  172. package/target/types/test/typescript/MessagingTest.spec.d.ts +1 -0
  173. package/target/types/test/typescript/MonadTest.spec.d.ts +16 -0
  174. package/target/types/test/typescript/PromiseTest.spec.d.ts +1 -0
  175. package/target/types/test/typescript/StreamTest.spec.d.ts +1 -0
  176. package/target/types/test/typescript/XmlQueryTest.spec.d.ts +1 -0
  177. package/target/types/test/typescript/markups/tobago-with-header.d.ts +1 -0
  178. package/target/types/test/typescript/markups/tobago-without-header.d.ts +1 -0
  179. package/webpack.config.js +1 -1
  180. package/webpack.config.js.map +1 -1
  181. package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  182. package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  183. package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +0 -1
  184. package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +0 -1
  185. package/.nyc_output/processinfo/index.json +0 -1
  186. package/src/test.html +0 -75
  187. package/src/tmp/test.html +0 -16
  188. package/tmp.xml +0 -36
@@ -0,0 +1,182 @@
1
+ import { oam as _oam } from "../myfaces/OamSubmit";
2
+ import { ErrorData } from "../impl/xhrCore/ErrorData";
3
+ import { EventData } from "../impl/xhrCore/EventData";
4
+ export declare module faces {
5
+ /**
6
+ * Version of the implementation for the faces.ts.
7
+ * <p />
8
+ * as specified within the jsf specifications faces.html:
9
+ * <ul>
10
+ * <li>left two digits major release number</li>
11
+ * <li>middle two digits minor spec release number</li>
12
+ * <li>right two digits bug release number</li>
13
+ * </ul>
14
+ * @constant
15
+ */
16
+ var specversion: number;
17
+ /**
18
+ * Implementation version as specified within the jsf specification.
19
+ * <p />
20
+ * A number increased with every implementation version
21
+ * and reset by moving to a new spec release number
22
+ *
23
+ * @constant
24
+ */
25
+ var implversion: number;
26
+ /**
27
+ * SeparatorChar as defined by facesContext.getNamingContainerSeparatorChar()
28
+ */
29
+ var separatorchar: string;
30
+ /**
31
+ * Context Path as defined externalContext.requestContextPath
32
+ */
33
+ var contextpath: string;
34
+ /**
35
+ * This method is responsible for the return of a given project stage as defined
36
+ * by the jsf specification.
37
+ * <p/>
38
+ * Valid return values are:
39
+ * <ul>
40
+ * <li>&quot;Production&quot;</li>
41
+ * <li>&quot;Development&quot;</li>
42
+ * <li>&quot;SystemTest&quot;</li>
43
+ * <li>&quot;UnitTest&quot;</li>
44
+ * </li>
45
+ *
46
+ * @return {String} the current project state emitted by the server side method:
47
+ * <i>jakarta.faces.application.Application.getProjectStage()</i>
48
+ */
49
+ function getProjectStage(): string;
50
+ /**
51
+ * collect and encode data for a given form element (must be of type form)
52
+ * find the jakarta.faces.ViewState element and encode its value as well!
53
+ * return a concatenated string of the encoded values!
54
+ *
55
+ * @throws an exception in case of the given element not being of type form!
56
+ * https://issues.apache.org/jira/browse/MYFACES-2110
57
+ */
58
+ function getViewState(formElement: Element | string): string;
59
+ /**
60
+ * returns the window identifier for the given node / window
61
+ * @return the window identifier or null if none is found
62
+ * @param rootNode
63
+ */
64
+ function getClientWindow(rootNode?: Element | string): string;
65
+ module ajax {
66
+ /**
67
+ * this function has to send the ajax requests
68
+ *
69
+ * following request conditions must be met:
70
+ * <ul>
71
+ * <li> the request must be sent asynchronously! </li>
72
+ * <li> the request must be a POST!!! request </li>
73
+ * <li> the request url must be the form action attribute </li>
74
+ * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
75
+ * </ul>
76
+ *
77
+ * @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
78
+ * @param {EVENT} event: any javascript event supported by that object
79
+ * @param {Map} options : map of options being pushed into the ajax cycle
80
+ */
81
+ function request(element: Element, event?: Event, options?: Options): void;
82
+ /**
83
+ * response handler
84
+ * @param request the request object having triggered this response
85
+ * @param context the request context
86
+ *
87
+ */
88
+ function response(request: XMLHttpRequest, context?: Context): void;
89
+ /**
90
+ * Adds an error handler to our global error queue.
91
+ * the error handler must be of the format <i>function errorListener(&lt;errorData&gt;)</i>
92
+ * with errorData being of following format:
93
+ * <ul>
94
+ * <li> errorData.type : &quot;error&quot;</li>
95
+ * <li> errorData.status : the error status message</li>
96
+ * <li> errorData.serverErrorName : the server error name in case of a server error</li>
97
+ * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
98
+ * <li> errorData.source : the issuing source element which triggered the request </li>
99
+ * <li> eventData.responseCode: the response code (aka http request response code, 401 etc...) </li>
100
+ * <li> eventData.responseText: the request response text </li>
101
+ * <li> eventData.responseXML: the request response xml </li>
102
+ * </ul>
103
+ *
104
+ * @param errorFunc error handler must be of the format <i>function errorListener(&lt;errorData&gt;)</i>
105
+ */
106
+ function addOnError(errorFunc: (data: ErrorData) => void): void;
107
+ /**
108
+ * Adds a global event listener to the ajax event queue. The event listener must be a function
109
+ * of following format: <i>function eventListener(&lt;eventData&gt;)</i>
110
+ *
111
+ * @param eventFunc event must be of the format <i>function eventListener(&lt;eventData&gt;)</i>
112
+ */
113
+ function addOnEvent(eventFunc: (data: EventData) => void): void;
114
+ }
115
+ module util {
116
+ /**
117
+ * varargs function which executes a chain of code (functions or any other code)
118
+ *
119
+ * if any of the code returns false, the execution
120
+ * is terminated prematurely skipping the rest of the code!
121
+ *
122
+ * @param {HTMLElement | String} source, the callee object
123
+ * @param {Event} event, the event object of the callee event triggering this function
124
+ * @param funcs ... arbitrary array of functions or strings
125
+ * @returns true if the chain has succeeded false otherwise
126
+ */
127
+ function chain(source: HTMLElement | string, event: Event | null, ...funcs: Array<Function | string>): boolean;
128
+ }
129
+ module push {
130
+ /**
131
+ * @param socketClientId the sockets client identifier
132
+ * @param url the uri to reach the socket
133
+ * @param channel the channel name/id
134
+ * @param onopen The function to be invoked when the web socket is opened.
135
+ * @param onmessage The function to be invoked when a message is received.
136
+ * @param onerror The function to be invoked when an error occurs.
137
+ * @param onclose The function to be invoked when the web socket is closed.
138
+ * @param behaviors functions which are invoked whenever a message is received
139
+ * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
140
+ */
141
+ function init(socketClientId: string, url: string, channel: string, onopen: Function, onmessage: Function, onerror: Function, onclose: Function, behaviors: any, autoConnect: boolean): void;
142
+ /**
143
+ * Open the web socket on the given channel.
144
+ * @param socketClientId The name of the web socket channel.
145
+ * @throws Error is thrown, if the channel is unknown.
146
+ */
147
+ function open(socketClientId: string): void;
148
+ /**
149
+ * Close the web socket on the given channel.
150
+ * @param socketClientId The id of the web socket client.
151
+ * @throws Error is thrown, if the channel is unknown.
152
+ */
153
+ function close(socketClientId: string): void;
154
+ }
155
+ }
156
+ export declare module myfaces {
157
+ /**
158
+ * AB function similar to mojarra and Primefaces
159
+ * not part of the spec but a convenience accessor method
160
+ * Code provided by Thomas Andraschko
161
+ *
162
+ * @param source the event source
163
+ * @param event the event
164
+ * @param eventName event name for java.jakarta.faces.behavior.evemnt
165
+ * @param execute execute list as passed down in faces.ajax.request
166
+ * @param render the render list as string
167
+ * @param options the options which need to be mered in
168
+ */
169
+ function ab(source: Element, event: Event, eventName: string, execute: string, render: string, options?: Options): void;
170
+ /**
171
+ * Helper function in the myfaces namespace to handle document ready properly for the load case
172
+ * the ajax case, does not need proper treatment, since it is deferred anyway.
173
+ * Used by command script as helper function!
174
+ *
175
+ * @param executionFunc the function to be executed upon ready
176
+ */
177
+ function onDomReady(executionFunc: () => void): void;
178
+ /**
179
+ * legacy oam functions
180
+ */
181
+ const oam: typeof _oam;
182
+ }
@@ -0,0 +1,17 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare var faces: FacesAPI;
17
+ export declare var myfaces: MyFacesAPI;
@@ -0,0 +1,17 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare var jsf: FacesAPI;
17
+ export declare var myfaces: MyFacesAPI;
@@ -0,0 +1,164 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { IListener } from "./util/IListener";
17
+ import { XhrRequest } from "./xhrCore/XhrRequest";
18
+ import { Config, DQ } from "mona-dish";
19
+ import { ExtConfig } from "./util/ExtDomQuery";
20
+ import { ErrorData } from "./xhrCore/ErrorData";
21
+ import { EventData } from "./xhrCore/EventData";
22
+ import { XhrQueueController } from "./util/XhrQueueController";
23
+ /**
24
+ * Core Implementation
25
+ * to distinct between api and impl
26
+ *
27
+ * The original idea was to make the implementation pluggable
28
+ * but this is pointless, you always can overwrite the thin api layer
29
+ * however a dedicated api makes sense for readability reasons
30
+ */
31
+ export declare module Implementation {
32
+ let requestQueue: XhrQueueController<XhrRequest>;
33
+ /**
34
+ * fetches the separator char from the given script tags
35
+ *
36
+ * @return {string} the separator char for the given script tags
37
+ */
38
+ function getSeparatorChar(): string;
39
+ /**
40
+ * this is for testing purposes only, since AjaxImpl is a module
41
+ * we need to reset for every unit test its internal states
42
+ */
43
+ function reset(): void;
44
+ /**
45
+ * @return the project stage also emitted by the server:
46
+ * it cannot be cached and must be delivered over the server
47
+ * The value for it comes from the requestInternal parameter of the faces.js script called "stage".
48
+ */
49
+ function getProjectStage(): string | null;
50
+ /**
51
+ * resolves the project stage as url parameter
52
+ * @return the project stage or null
53
+ */
54
+ function resolveProjectStateFromURL(): string | null;
55
+ /**
56
+ * implementation of the faces.util.chain functionality
57
+ *
58
+ * @param source
59
+ * @param event
60
+ * @param funcs
61
+ */
62
+ function chain(source: any, event: Event, ...funcs: EvalFuncs): boolean;
63
+ /**
64
+ * this function has to send the ajax requests
65
+ *
66
+ * following request conditions must be met:
67
+ * <ul>
68
+ * <li> the request must be sent asynchronously! </li>
69
+ * <li> the request must be a POST!!! request </li>
70
+ * <li> the request url must be the form action attribute </li>
71
+ * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
72
+ * </ul>
73
+ *
74
+ * @param el any dom element no matter being it html or jsf, from which the event is emitted
75
+ * @param event any javascript event supported by that object
76
+ * @param opts map of options being pushed into the ajax cycle
77
+ *
78
+ * a) transformArguments out of the function
79
+ * b) passThrough handling with a map copy with a filter map block map
80
+ */
81
+ function request(el: ElemDef, event?: Event, opts?: Options): void;
82
+ /**
83
+ * Spec. 13.3.3
84
+ * Examining the response markup and updating the DOM tree
85
+ * @param {XMLHttpRequest} request - the ajax request
86
+ * @param {Object} context - the ajax context
87
+ */
88
+ function response(request: XMLHttpRequest, context: Context): void;
89
+ /**
90
+ * adds an error handler to the error queue
91
+ *
92
+ * @param errorListener the error listener handler
93
+ */
94
+ function addOnError(errorListener: IListener<ErrorData>): void;
95
+ /**
96
+ * adds an event handler to the event queue
97
+ *
98
+ * @param eventListener the event listener handler
99
+ */
100
+ function addOnEvent(eventListener: IListener<EventData>): void;
101
+ /**
102
+ * sends an event to the event handlers
103
+ *
104
+ * @param data the event data object hosting the event data according to the spec @see EventData for what is reachable
105
+ * @param localHandler an optional event handler, which is processed before the event handler chain
106
+ */
107
+ function sendEvent(data: EventData, localHandler?: (data: EventData) => void): void;
108
+ /**
109
+ * error handler behavior called internally
110
+ * and only into the impl it takes care of the
111
+ * internal message transformation to a myfaces internal error
112
+ * and then uses the standard send error mechanisms
113
+ * also a double error logging prevention is done as well
114
+ *
115
+ * @param request the request currently being processed
116
+ * @param context the context affected by this error
117
+ * @param exception the exception being thrown
118
+ * @param clearRequestQueue if set to true, clears the request queue of all pending requests
119
+ */
120
+ function stdErrorHandler(request: XMLHttpRequest, context: Config, exception: Error, clearRequestQueue?: boolean): void;
121
+ /**
122
+ * implementation triggering the error chain
123
+ *
124
+ *
125
+ *
126
+ * handles the errors, in case of an onError exists within the context the onError is called as local error handler
127
+ * the registered error handlers in the queue received an error message to be dealt with
128
+ * and if the projectStage is at development an alert box is displayed
129
+ *
130
+ * note: we have additional functionality here, via the global config myfaces.config.defaultErrorOutput a function can be provided
131
+ * which changes the default output behavior from alert to something else
132
+ *
133
+ * @param errorData the error data to be displayed
134
+ * @param localHandler an optional local error handler which has to be processed before the error handler queue
135
+ */
136
+ function sendError(errorData: ErrorData, localHandler?: (data: ErrorData) => void): void;
137
+ /**
138
+ * @node optional element or id defining a rootnode where an element with the id "jakarta.faces.windowId" is hosted
139
+ * @return the client window id of the current window, if one is given if none is found, null is returned
140
+ */
141
+ function getClientWindow(node?: Element | string): string | null;
142
+ /**
143
+ * collect and encode data for a given form element (must be of type form)
144
+ * find the jakarta.faces.ViewState element and encode its value as well!
145
+ * @return a concatenated string of the encoded values!
146
+ *
147
+ * @throws Error in case of the given element not being of type form!
148
+ * https://issues.apache.org/jira/browse/MYFACES-2110
149
+ */
150
+ function getViewState(form: Element | string): string;
151
+ /**
152
+ * this at the first sight looks like a weird construct, but we need to do it this way
153
+ * for testing, we cannot proxy addRequestToQueue from the testing frameworks directly,
154
+ * but we need to keep it under unit tests.
155
+ */
156
+ let queueHandler: {
157
+ /**
158
+ * public to make it accessible for tests
159
+ *
160
+ * adds a new request to our queue for further processing
161
+ */
162
+ addRequestToQueue: (elem: DQ, form: DQ, reqCtx: ExtConfig, respPassThr: Config, delay?: number, timeout?: number) => void;
163
+ };
164
+ }
@@ -0,0 +1,38 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Implementation class for the push functionality
18
+ */
19
+ export declare module PushImpl {
20
+ let sockets: {};
21
+ let components: {};
22
+ let clientIdsByTokens: {};
23
+ function reset(): void;
24
+ /**
25
+ * @param socketClientId the sockets client identifier
26
+ * @param url the uri to reach the socket
27
+ * @param channel the channel name/id
28
+ * @param onopen The function to be invoked when the web socket is opened.
29
+ * @param onmessage The function to be invoked when a message is received.
30
+ * @param onerror The function to be invoked when an error occurs.
31
+ * @param onclose The function to be invoked when the web socket is closed.
32
+ * @param behaviors functions which are invoked whenever a message is received
33
+ * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
34
+ */
35
+ function init(socketClientId: string, url: string, channel: string, onopen: Function, onmessage: Function, onerror: Function, onclose: Function, behaviors: any, autoConnect: boolean): void;
36
+ function open(socketClientId: string): void;
37
+ function close(socketClientId: string): void;
38
+ }
@@ -0,0 +1,138 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
17
+ export declare const NAMED_VIEWROOT = "namedViewRoot";
18
+ export declare const P_AJAX_SOURCE = "jakarta.faces.source";
19
+ export declare const NAMING_CONTAINER_ID = "myfaces.NamingContainerId";
20
+ export declare const VIEW_ID = "myfaces.viewId";
21
+ export declare const P_VIEWSTATE = "jakarta.faces.ViewState";
22
+ export declare const P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
23
+ export declare const P_VIEWROOT = "jakarta.faces.ViewRoot";
24
+ export declare const P_VIEWHEAD = "jakarta.faces.ViewHead";
25
+ export declare const P_VIEWBODY = "jakarta.faces.ViewBody";
26
+ export declare const P_RESOURCE = "jakarta.faces.Resource";
27
+ export declare const EMPTY_FUNC: () => void;
28
+ export declare const EMPTY_STR = "";
29
+ export declare const EMPTY_MAP: Readonly<{}>;
30
+ export declare const HTML_VIEWSTATE: string;
31
+ export declare const HTML_CLIENT_WINDOW: string;
32
+ export declare const IDENT_ALL = "@all";
33
+ export declare const IDENT_NONE = "@none";
34
+ export declare const IDENT_THIS = "@this";
35
+ export declare const IDENT_FORM = "@form";
36
+ export declare const P_AJAX = "jakarta.faces.partial.ajax";
37
+ export declare const P_EXECUTE = "jakarta.faces.partial.execute";
38
+ export declare const P_RENDER = "jakarta.faces.partial.render";
39
+ export declare const P_RENDER_OVERRIDE = "_myfaces.rendeOverride";
40
+ export declare const P_EVT = "jakarta.faces.partial.event";
41
+ export declare const P_RESET_VALUES = "jakarta.faces.partial.resetValues";
42
+ export declare const P_WINDOW_ID = "jakarta.faces.windowId";
43
+ export declare const P_BEHAVIOR_EVENT = "jakarta.faces.behavior.event";
44
+ export declare const CTX_PARAM_RENDER = "render";
45
+ export declare const WINDOW_ID = "windowId";
46
+ export declare const ERROR = "error";
47
+ export declare const EVENT = "event";
48
+ export declare const ON_ERROR = "onerror";
49
+ export declare const ON_EVENT = "onevent";
50
+ export declare const BEGIN = "begin";
51
+ export declare const COMPLETE = "complete";
52
+ export declare const SUCCESS = "success";
53
+ export declare const SOURCE = "source";
54
+ export declare const STATUS = "status";
55
+ export declare const ERROR_NAME = "error-name";
56
+ export declare const ERROR_MESSAGE = "error-message";
57
+ export declare const RESPONSE_TEXT = "responseText";
58
+ export declare const RESPONSE_XML = "responseXML";
59
+ export declare const HTTPERROR = "httpError";
60
+ export declare const EMPTY_RESPONSE = "emptyResponse";
61
+ export declare const MALFORMEDXML = "malformedXML";
62
+ export declare const SERVER_ERROR = "serverError";
63
+ export declare const CLIENT_ERROR = "clientError";
64
+ export declare const TIMEOUT_EVENT = "timeout";
65
+ export declare const CTX_OPTIONS_PARAMS = "params";
66
+ export declare const CTX_OPTIONS_DELAY = "delay";
67
+ export declare const DELAY_NONE = "none";
68
+ export declare const CTX_OPTIONS_TIMEOUT = "timeout";
69
+ export declare const CTX_OPTIONS_RESET = "resetValues";
70
+ export declare const CTX_OPTIONS_EXECUTE = "execute";
71
+ export declare const CTX_PARAM_MF_INTERNAL = "myfaces.internal";
72
+ export declare const CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
73
+ export declare const CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
74
+ export declare const CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
75
+ export declare const CTX_PARAM_PPS = "myfaces.request.pps";
76
+ export declare const CONTENT_TYPE = "Content-Type";
77
+ export declare const HEAD_FACES_REQ = "Faces-Request";
78
+ export declare const REQ_ACCEPT = "Accept";
79
+ export declare const VAL_AJAX = "partial/ajax";
80
+ export declare const ENCODED_URL = "jakarta.faces.encodedURL";
81
+ export declare const REQ_TYPE_GET = "GET";
82
+ export declare const REQ_TYPE_POST = "POST";
83
+ export declare const STATE_EVT_BEGIN = "begin";
84
+ export declare const STATE_EVT_TIMEOUT = "TIMEOUT_EVENT";
85
+ export declare const STATE_EVT_COMPLETE = "complete";
86
+ export declare const URL_ENCODED = "application/x-www-form-urlencoded";
87
+ export declare const MULTIPART = "multipart/form-data";
88
+ export declare const NO_TIMEOUT = 0;
89
+ export declare const STD_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
90
+ export declare const HTML_TAG_HEAD = "HEAD";
91
+ export declare const HTML_TAG_FORM = "FORM";
92
+ export declare const HTML_TAG_BODY = "BODY";
93
+ export declare const HTML_TAG_LINK = "LINK";
94
+ export declare const HTML_TAG_SCRIPT = "SCRIPT";
95
+ export declare const HTML_TAG_STYLE = "STYLE";
96
+ export declare const SEL_VIEWSTATE_ELEM: string;
97
+ export declare const SEL_CLIENT_WINDOW_ELEM: string;
98
+ export declare const SEL_RESPONSE_XML = "responseXML";
99
+ export declare const PHASE_PROCESS_RESPONSE = "processResponse";
100
+ export declare const ERR_NO_PARTIAL_RESPONSE = "Partial response not set";
101
+ export declare const MYFACES_OPTION_PPS = "pps";
102
+ export declare const ATTR_URL = "url";
103
+ export declare const ATTR_NAME = "name";
104
+ export declare const ATTR_VALUE = "value";
105
+ export declare const ATTR_ID = "id";
106
+ export declare const XML_TAG_PARTIAL_RESP = "partial-response";
107
+ export declare const XML_TAG_CHANGES = "changes";
108
+ export declare const XML_TAG_UPDATE = "update";
109
+ export declare const XML_TAG_DELETE = "delete";
110
+ export declare const XML_TAG_INSERT = "insert";
111
+ export declare const XML_TAG_EVAL = "eval";
112
+ export declare const XML_TAG_ERROR = "error";
113
+ export declare const XML_TAG_ATTRIBUTES = "attributes";
114
+ export declare const XML_TAG_EXTENSION = "extension";
115
+ export declare const XML_TAG_REDIRECT = "redirect";
116
+ export declare const XML_TAG_BEFORE = "before";
117
+ export declare const XML_TAG_AFTER = "after";
118
+ export declare const XML_TAG_ATTR = "attribute";
119
+ export declare const UPDATE_FORMS = "myfaces.updateForms";
120
+ export declare const UPDATE_ELEMS = "myfaces.updateElems";
121
+ export declare const DEFERRED_HEAD_INSERTS = "myfaces.headElems";
122
+ export declare const MYFACES = "myfaces";
123
+ export declare const MF_NONE = "__mf_none__";
124
+ export declare const REASON_EXPIRED = "Expired";
125
+ export declare const APPLIED_VST = "myfaces.appliedViewState";
126
+ export declare const APPLIED_CLIENT_WINDOW = "myfaces.appliedClientWindow";
127
+ export declare const RECONNECT_INTERVAL = 500;
128
+ export declare const MAX_RECONNECT_ATTEMPTS = 25;
129
+ export declare const UNKNOWN = "UNKNOWN";
130
+ /**
131
+ * helper to remap the namespaces variables for 2.3
132
+ * from 2.3 to 4.0 every javax namespace has been changed
133
+ * to faces
134
+ * To take the compatibility layer out this method just has to be
135
+ * changed to a simple value passthrough
136
+ */
137
+ export declare function $faces(): FacesAPI;
138
+ export declare function $nsp(inputNamespace?: any): any;
@@ -0,0 +1,16 @@
1
+ export interface IdValueHolder {
2
+ readonly id: string;
3
+ readonly value: string;
4
+ }
5
+ /**
6
+ * a helper class to isolate the
7
+ * view state and client window and other
8
+ * future states which follow a similar pattern
9
+ */
10
+ export declare class StateHolder implements IdValueHolder {
11
+ id: string;
12
+ value: string;
13
+ nameSpace: string;
14
+ constructor(id: string, value: string);
15
+ get hasNameSpace(): boolean;
16
+ }