quidproquo-web-react 0.0.254 → 0.0.255

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 (285) hide show
  1. package/lib/commonjs/api/hooks/index.d.ts +2 -2
  2. package/lib/commonjs/api/hooks/index.js +18 -18
  3. package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
  4. package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.js +14 -14
  5. package/lib/commonjs/api/hooks/useNetworkRequest.d.ts +2 -2
  6. package/lib/commonjs/api/hooks/useNetworkRequest.js +10 -10
  7. package/lib/commonjs/api/index.d.ts +1 -1
  8. package/lib/commonjs/api/index.js +17 -17
  9. package/lib/commonjs/auth/RefreshAuthTokensProvider.d.ts +7 -8
  10. package/lib/commonjs/auth/RefreshAuthTokensProvider.js +12 -12
  11. package/lib/commonjs/auth/authContext.d.ts +2 -3
  12. package/lib/commonjs/auth/authContext.js +8 -8
  13. package/lib/commonjs/auth/hooks/index.d.ts +3 -3
  14. package/lib/commonjs/auth/hooks/index.js +19 -19
  15. package/lib/commonjs/auth/hooks/useAuthAccessToken.d.ts +1 -1
  16. package/lib/commonjs/auth/hooks/useAuthAccessToken.js +12 -12
  17. package/lib/commonjs/auth/hooks/useIsLoggedIn.d.ts +1 -1
  18. package/lib/commonjs/auth/hooks/useIsLoggedIn.js +9 -9
  19. package/lib/commonjs/auth/hooks/useRefreshTokens.d.ts +2 -2
  20. package/lib/commonjs/auth/hooks/useRefreshTokens.js +35 -35
  21. package/lib/commonjs/auth/index.d.ts +4 -4
  22. package/lib/commonjs/auth/index.js +20 -20
  23. package/lib/commonjs/auth/types/AuthState.d.ts +8 -8
  24. package/lib/commonjs/auth/types/AuthState.js +2 -2
  25. package/lib/commonjs/auth/types/index.d.ts +1 -1
  26. package/lib/commonjs/auth/types/index.js +17 -17
  27. package/lib/commonjs/baseUrl/BaseUrlContext.d.ts +2 -3
  28. package/lib/commonjs/baseUrl/BaseUrlContext.js +9 -9
  29. package/lib/commonjs/baseUrl/BaseUrlProvider.d.ts +6 -7
  30. package/lib/commonjs/baseUrl/BaseUrlProvider.js +9 -9
  31. package/lib/commonjs/baseUrl/hooks/index.d.ts +1 -1
  32. package/lib/commonjs/baseUrl/hooks/index.js +17 -17
  33. package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
  34. package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.js +10 -10
  35. package/lib/commonjs/baseUrl/index.d.ts +3 -3
  36. package/lib/commonjs/baseUrl/index.js +19 -19
  37. package/lib/commonjs/baseUrl/types/BaseUrlResolver.d.ts +6 -6
  38. package/lib/commonjs/baseUrl/types/BaseUrlResolver.js +2 -2
  39. package/lib/commonjs/baseUrl/types/index.d.ts +1 -1
  40. package/lib/commonjs/baseUrl/types/index.js +17 -17
  41. package/lib/commonjs/hooks/asmj/QpqContextProvider.d.ts +10 -10
  42. package/lib/commonjs/hooks/asmj/QpqContextProvider.js +20 -20
  43. package/lib/commonjs/hooks/asmj/QpqMappedApi.d.ts +6 -6
  44. package/lib/commonjs/hooks/asmj/QpqMappedApi.js +2 -2
  45. package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
  46. package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.js +35 -35
  47. package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
  48. package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +23 -23
  49. package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
  50. package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +22 -22
  51. package/lib/commonjs/hooks/asmj/actionProcessor/index.d.ts +3 -3
  52. package/lib/commonjs/hooks/asmj/actionProcessor/index.js +18 -18
  53. package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -22
  54. package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.js +52 -53
  55. package/lib/commonjs/hooks/asmj/index.d.ts +6 -6
  56. package/lib/commonjs/hooks/asmj/index.js +22 -22
  57. package/lib/commonjs/hooks/asmj/useQpqRuntime.d.ts +4 -4
  58. package/lib/commonjs/hooks/asmj/useQpqRuntime.js +35 -36
  59. package/lib/commonjs/hooks/index.d.ts +8 -8
  60. package/lib/commonjs/hooks/index.js +24 -24
  61. package/lib/commonjs/hooks/useAsyncEffect.d.ts +2 -2
  62. package/lib/commonjs/hooks/useAsyncEffect.js +36 -36
  63. package/lib/commonjs/hooks/useFastCallback.d.ts +2 -2
  64. package/lib/commonjs/hooks/useFastCallback.js +19 -20
  65. package/lib/commonjs/hooks/useMetadata/index.d.ts +1 -1
  66. package/lib/commonjs/hooks/useMetadata/index.js +17 -17
  67. package/lib/commonjs/hooks/useMetadata/useMetadata.d.ts +5 -5
  68. package/lib/commonjs/hooks/useMetadata/useMetadata.js +14 -15
  69. package/lib/commonjs/hooks/useOnKeyDownEffect.d.ts +1 -1
  70. package/lib/commonjs/hooks/useOnKeyDownEffect.js +22 -23
  71. package/lib/commonjs/hooks/useQpq.d.ts +2 -2
  72. package/lib/commonjs/hooks/useQpq.js +45 -46
  73. package/lib/commonjs/hooks/useRunEvery.d.ts +1 -1
  74. package/lib/commonjs/hooks/useRunEvery.js +21 -22
  75. package/lib/commonjs/hooks/useThrottledMemo.d.ts +1 -1
  76. package/lib/commonjs/hooks/useThrottledMemo.js +31 -32
  77. package/lib/commonjs/index.d.ts +10 -10
  78. package/lib/commonjs/index.js +26 -26
  79. package/lib/commonjs/state/index.d.ts +1 -1
  80. package/lib/commonjs/state/index.js +17 -17
  81. package/lib/commonjs/state/useStateUpdater.d.ts +3 -4
  82. package/lib/commonjs/state/useStateUpdater.js +12 -12
  83. package/lib/commonjs/useFieldBinding/index.d.ts +1 -1
  84. package/lib/commonjs/useFieldBinding/index.js +17 -17
  85. package/lib/commonjs/useFieldBinding/useFieldBinding.d.ts +2 -2
  86. package/lib/commonjs/useFieldBinding/useFieldBinding.js +21 -21
  87. package/lib/commonjs/useSharedQueryParams/index.d.ts +2 -2
  88. package/lib/commonjs/useSharedQueryParams/index.js +18 -18
  89. package/lib/commonjs/useSharedQueryParams/logic/index.d.ts +4 -4
  90. package/lib/commonjs/useSharedQueryParams/logic/index.js +20 -20
  91. package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -2
  92. package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.js +9 -10
  93. package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -2
  94. package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.js +11 -12
  95. package/lib/commonjs/useSharedQueryParams/logic/runtime/index.d.ts +2 -2
  96. package/lib/commonjs/useSharedQueryParams/logic/runtime/index.js +18 -18
  97. package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -4
  98. package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +7 -7
  99. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -2
  100. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +11 -12
  101. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -3
  102. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.js +13 -13
  103. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -10
  104. package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.js +7 -7
  105. package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -3
  106. package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.js +7 -7
  107. package/lib/commonjs/webSocketQueue/hooks/index.d.ts +2 -2
  108. package/lib/commonjs/webSocketQueue/hooks/index.js +18 -18
  109. package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
  110. package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +8 -8
  111. package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
  112. package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +9 -9
  113. package/lib/commonjs/webSocketQueue/index.d.ts +1 -1
  114. package/lib/commonjs/webSocketQueue/index.js +17 -17
  115. package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
  116. package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.js +14 -14
  117. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
  118. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.js +18 -18
  119. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
  120. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +37 -37
  121. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
  122. package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +16 -16
  123. package/lib/commonjs/websocket/WebSocketAuthSync/index.d.ts +1 -1
  124. package/lib/commonjs/websocket/WebSocketAuthSync/index.js +17 -17
  125. package/lib/commonjs/websocket/WebsocketContext.d.ts +2 -3
  126. package/lib/commonjs/websocket/WebsocketContext.js +5 -5
  127. package/lib/commonjs/websocket/WebsocketProvider.d.ts +5 -6
  128. package/lib/commonjs/websocket/WebsocketProvider.js +11 -11
  129. package/lib/commonjs/websocket/hooks/index.d.ts +5 -5
  130. package/lib/commonjs/websocket/hooks/index.js +21 -21
  131. package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
  132. package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.js +17 -17
  133. package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
  134. package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.js +17 -17
  135. package/lib/commonjs/websocket/hooks/useWebsocketApi.d.ts +1 -1
  136. package/lib/commonjs/websocket/hooks/useWebsocketApi.js +10 -10
  137. package/lib/commonjs/websocket/hooks/useWebsocketManagement.d.ts +2 -2
  138. package/lib/commonjs/websocket/hooks/useWebsocketManagement.js +17 -17
  139. package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
  140. package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.js +15 -15
  141. package/lib/commonjs/websocket/index.d.ts +3 -3
  142. package/lib/commonjs/websocket/index.js +19 -19
  143. package/lib/esm/api/hooks/index.d.ts +2 -2
  144. package/lib/esm/api/hooks/index.js +2 -2
  145. package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
  146. package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.js +17 -17
  147. package/lib/esm/api/hooks/useNetworkRequest.d.ts +2 -2
  148. package/lib/esm/api/hooks/useNetworkRequest.js +6 -6
  149. package/lib/esm/api/index.d.ts +1 -1
  150. package/lib/esm/api/index.js +1 -1
  151. package/lib/esm/auth/RefreshAuthTokensProvider.d.ts +7 -8
  152. package/lib/esm/auth/RefreshAuthTokensProvider.js +9 -9
  153. package/lib/esm/auth/authContext.d.ts +2 -3
  154. package/lib/esm/auth/authContext.js +5 -5
  155. package/lib/esm/auth/hooks/index.d.ts +3 -3
  156. package/lib/esm/auth/hooks/index.js +3 -3
  157. package/lib/esm/auth/hooks/useAuthAccessToken.d.ts +1 -1
  158. package/lib/esm/auth/hooks/useAuthAccessToken.js +7 -7
  159. package/lib/esm/auth/hooks/useIsLoggedIn.d.ts +1 -1
  160. package/lib/esm/auth/hooks/useIsLoggedIn.js +5 -5
  161. package/lib/esm/auth/hooks/useRefreshTokens.d.ts +2 -2
  162. package/lib/esm/auth/hooks/useRefreshTokens.js +31 -31
  163. package/lib/esm/auth/index.d.ts +4 -4
  164. package/lib/esm/auth/index.js +4 -4
  165. package/lib/esm/auth/types/AuthState.d.ts +8 -8
  166. package/lib/esm/auth/types/AuthState.js +1 -1
  167. package/lib/esm/auth/types/index.d.ts +1 -1
  168. package/lib/esm/auth/types/index.js +1 -1
  169. package/lib/esm/baseUrl/BaseUrlContext.d.ts +2 -3
  170. package/lib/esm/baseUrl/BaseUrlContext.js +6 -6
  171. package/lib/esm/baseUrl/BaseUrlProvider.d.ts +6 -7
  172. package/lib/esm/baseUrl/BaseUrlProvider.js +5 -5
  173. package/lib/esm/baseUrl/hooks/index.d.ts +1 -1
  174. package/lib/esm/baseUrl/hooks/index.js +1 -1
  175. package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
  176. package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.js +6 -6
  177. package/lib/esm/baseUrl/index.d.ts +3 -3
  178. package/lib/esm/baseUrl/index.js +3 -3
  179. package/lib/esm/baseUrl/types/BaseUrlResolver.d.ts +6 -6
  180. package/lib/esm/baseUrl/types/BaseUrlResolver.js +1 -1
  181. package/lib/esm/baseUrl/types/index.d.ts +1 -1
  182. package/lib/esm/baseUrl/types/index.js +1 -1
  183. package/lib/esm/hooks/asmj/QpqContextProvider.d.ts +10 -10
  184. package/lib/esm/hooks/asmj/QpqContextProvider.js +15 -15
  185. package/lib/esm/hooks/asmj/QpqMappedApi.d.ts +6 -6
  186. package/lib/esm/hooks/asmj/QpqMappedApi.js +1 -1
  187. package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
  188. package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.js +30 -30
  189. package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
  190. package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +8 -8
  191. package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
  192. package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +7 -7
  193. package/lib/esm/hooks/asmj/actionProcessor/index.d.ts +3 -3
  194. package/lib/esm/hooks/asmj/actionProcessor/index.js +6 -6
  195. package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -22
  196. package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.js +46 -46
  197. package/lib/esm/hooks/asmj/index.d.ts +6 -6
  198. package/lib/esm/hooks/asmj/index.js +6 -6
  199. package/lib/esm/hooks/asmj/useQpqRuntime.d.ts +4 -4
  200. package/lib/esm/hooks/asmj/useQpqRuntime.js +32 -32
  201. package/lib/esm/hooks/index.d.ts +8 -8
  202. package/lib/esm/hooks/index.js +8 -8
  203. package/lib/esm/hooks/useAsyncEffect.d.ts +2 -2
  204. package/lib/esm/hooks/useAsyncEffect.js +23 -23
  205. package/lib/esm/hooks/useFastCallback.d.ts +2 -2
  206. package/lib/esm/hooks/useFastCallback.js +16 -16
  207. package/lib/esm/hooks/useMetadata/index.d.ts +1 -1
  208. package/lib/esm/hooks/useMetadata/index.js +1 -1
  209. package/lib/esm/hooks/useMetadata/useMetadata.d.ts +5 -5
  210. package/lib/esm/hooks/useMetadata/useMetadata.js +11 -11
  211. package/lib/esm/hooks/useOnKeyDownEffect.d.ts +1 -1
  212. package/lib/esm/hooks/useOnKeyDownEffect.js +19 -19
  213. package/lib/esm/hooks/useQpq.d.ts +2 -2
  214. package/lib/esm/hooks/useQpq.js +34 -34
  215. package/lib/esm/hooks/useRunEvery.d.ts +1 -1
  216. package/lib/esm/hooks/useRunEvery.js +18 -18
  217. package/lib/esm/hooks/useThrottledMemo.d.ts +1 -1
  218. package/lib/esm/hooks/useThrottledMemo.js +28 -28
  219. package/lib/esm/index.d.ts +10 -10
  220. package/lib/esm/index.js +10 -10
  221. package/lib/esm/state/index.d.ts +1 -1
  222. package/lib/esm/state/index.js +1 -1
  223. package/lib/esm/state/useStateUpdater.d.ts +3 -4
  224. package/lib/esm/state/useStateUpdater.js +11 -11
  225. package/lib/esm/useFieldBinding/index.d.ts +1 -1
  226. package/lib/esm/useFieldBinding/index.js +1 -1
  227. package/lib/esm/useFieldBinding/useFieldBinding.d.ts +2 -2
  228. package/lib/esm/useFieldBinding/useFieldBinding.js +17 -17
  229. package/lib/esm/useSharedQueryParams/index.d.ts +2 -2
  230. package/lib/esm/useSharedQueryParams/index.js +2 -2
  231. package/lib/esm/useSharedQueryParams/logic/index.d.ts +4 -4
  232. package/lib/esm/useSharedQueryParams/logic/index.js +4 -4
  233. package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -2
  234. package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.js +6 -6
  235. package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -2
  236. package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.js +8 -8
  237. package/lib/esm/useSharedQueryParams/logic/runtime/index.d.ts +2 -2
  238. package/lib/esm/useSharedQueryParams/logic/runtime/index.js +2 -2
  239. package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -4
  240. package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +4 -4
  241. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -2
  242. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +8 -8
  243. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -3
  244. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.js +10 -10
  245. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -10
  246. package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.js +4 -4
  247. package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -3
  248. package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.js +4 -4
  249. package/lib/esm/webSocketQueue/hooks/index.d.ts +2 -2
  250. package/lib/esm/webSocketQueue/hooks/index.js +2 -2
  251. package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
  252. package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +4 -4
  253. package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
  254. package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +5 -5
  255. package/lib/esm/webSocketQueue/index.d.ts +1 -1
  256. package/lib/esm/webSocketQueue/index.js +1 -1
  257. package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
  258. package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.js +11 -11
  259. package/lib/esm/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
  260. package/lib/esm/websocket/WebSocketAuthSync/hooks/index.js +2 -2
  261. package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
  262. package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +33 -33
  263. package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
  264. package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +12 -12
  265. package/lib/esm/websocket/WebSocketAuthSync/index.d.ts +1 -1
  266. package/lib/esm/websocket/WebSocketAuthSync/index.js +1 -1
  267. package/lib/esm/websocket/WebsocketContext.d.ts +2 -3
  268. package/lib/esm/websocket/WebsocketContext.js +2 -2
  269. package/lib/esm/websocket/WebsocketProvider.d.ts +5 -6
  270. package/lib/esm/websocket/WebsocketProvider.js +7 -7
  271. package/lib/esm/websocket/hooks/index.d.ts +5 -5
  272. package/lib/esm/websocket/hooks/index.js +5 -5
  273. package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
  274. package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.js +13 -13
  275. package/lib/esm/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
  276. package/lib/esm/websocket/hooks/useSubscribeToWebsocket.js +13 -13
  277. package/lib/esm/websocket/hooks/useWebsocketApi.d.ts +1 -1
  278. package/lib/esm/websocket/hooks/useWebsocketApi.js +6 -6
  279. package/lib/esm/websocket/hooks/useWebsocketManagement.d.ts +2 -2
  280. package/lib/esm/websocket/hooks/useWebsocketManagement.js +13 -13
  281. package/lib/esm/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
  282. package/lib/esm/websocket/hooks/useWebsocketSendEvent.js +11 -11
  283. package/lib/esm/websocket/index.d.ts +3 -3
  284. package/lib/esm/websocket/index.js +3 -3
  285. package/package.json +8 -8
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebsocketProvider = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const hooks_1 = require("./hooks");
6
- const WebsocketContext_1 = require("./WebsocketContext");
7
- const WebsocketProvider = ({ children, wsUrl }) => {
8
- const websocketManagement = (0, hooks_1.useWebsocketManagement)(wsUrl);
9
- return (0, jsx_runtime_1.jsx)(WebsocketContext_1.WebSocketContext.Provider, Object.assign({ value: websocketManagement }, { children: children }));
10
- };
11
- exports.WebsocketProvider = WebsocketProvider;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebsocketProvider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const hooks_1 = require("./hooks");
6
+ const WebsocketContext_1 = require("./WebsocketContext");
7
+ const WebsocketProvider = ({ children, wsUrl }) => {
8
+ const websocketManagement = (0, hooks_1.useWebsocketManagement)(wsUrl);
9
+ return (0, jsx_runtime_1.jsx)(WebsocketContext_1.WebSocketContext.Provider, { value: websocketManagement, children: children });
10
+ };
11
+ exports.WebsocketProvider = WebsocketProvider;
@@ -1,5 +1,5 @@
1
- export * from './useSubscribeToWebsocket';
2
- export * from './useSubscribeToWebSocketEvent';
3
- export * from './useWebsocketApi';
4
- export * from './useWebsocketManagement';
5
- export * from './useWebsocketSendEvent';
1
+ export * from './useSubscribeToWebsocket';
2
+ export * from './useSubscribeToWebSocketEvent';
3
+ export * from './useWebsocketApi';
4
+ export * from './useWebsocketManagement';
5
+ export * from './useWebsocketSendEvent';
@@ -1,21 +1,21 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./useSubscribeToWebsocket"), exports);
18
- __exportStar(require("./useSubscribeToWebSocketEvent"), exports);
19
- __exportStar(require("./useWebsocketApi"), exports);
20
- __exportStar(require("./useWebsocketManagement"), exports);
21
- __exportStar(require("./useWebsocketSendEvent"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useSubscribeToWebsocket"), exports);
18
+ __exportStar(require("./useSubscribeToWebSocketEvent"), exports);
19
+ __exportStar(require("./useWebsocketApi"), exports);
20
+ __exportStar(require("./useWebsocketManagement"), exports);
21
+ __exportStar(require("./useWebsocketSendEvent"), exports);
@@ -1,3 +1,3 @@
1
- import { AnyEventMessage } from 'quidproquo-core';
2
- import { WebSocketServiceEventSubscriptionFunction } from 'quidproquo-web';
3
- export declare const useSubscribeToWebSocketEvent: <E extends AnyEventMessage>(subscriptionType: E["type"], callback: WebSocketServiceEventSubscriptionFunction<E>) => void;
1
+ import { AnyEventMessage } from 'quidproquo-core';
2
+ import { WebSocketServiceEventSubscriptionFunction } from 'quidproquo-web';
3
+ export declare const useSubscribeToWebSocketEvent: <E extends AnyEventMessage>(subscriptionType: E["type"], callback: WebSocketServiceEventSubscriptionFunction<E>) => void;
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSubscribeToWebSocketEvent = void 0;
4
- const react_1 = require("react");
5
- const useWebsocketApi_1 = require("./useWebsocketApi");
6
- const useSubscribeToWebSocketEvent = (subscriptionType, callback) => {
7
- const websocketService = (0, useWebsocketApi_1.useWebsocketApi)();
8
- (0, react_1.useEffect)(() => {
9
- const subscriptionHandle = websocketService === null || websocketService === void 0 ? void 0 : websocketService.subscribeToEvent(subscriptionType, callback);
10
- return () => {
11
- if (subscriptionHandle) {
12
- websocketService === null || websocketService === void 0 ? void 0 : websocketService.unsubscribe(subscriptionHandle);
13
- }
14
- };
15
- }, [websocketService, subscriptionType, callback]);
16
- };
17
- exports.useSubscribeToWebSocketEvent = useSubscribeToWebSocketEvent;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSubscribeToWebSocketEvent = void 0;
4
+ const react_1 = require("react");
5
+ const useWebsocketApi_1 = require("./useWebsocketApi");
6
+ const useSubscribeToWebSocketEvent = (subscriptionType, callback) => {
7
+ const websocketService = (0, useWebsocketApi_1.useWebsocketApi)();
8
+ (0, react_1.useEffect)(() => {
9
+ const subscriptionHandle = websocketService === null || websocketService === void 0 ? void 0 : websocketService.subscribeToEvent(subscriptionType, callback);
10
+ return () => {
11
+ if (subscriptionHandle) {
12
+ websocketService === null || websocketService === void 0 ? void 0 : websocketService.unsubscribe(subscriptionHandle);
13
+ }
14
+ };
15
+ }, [websocketService, subscriptionType, callback]);
16
+ };
17
+ exports.useSubscribeToWebSocketEvent = useSubscribeToWebSocketEvent;
@@ -1,2 +1,2 @@
1
- import { WebsocketServiceEvent, WebSocketServiceSubscriptionFunction } from 'quidproquo-web';
2
- export declare const useSubscribeToWebsocket: (subscriptionType: WebsocketServiceEvent, callback: WebSocketServiceSubscriptionFunction) => void;
1
+ import { WebsocketServiceEvent, WebSocketServiceSubscriptionFunction } from 'quidproquo-web';
2
+ export declare const useSubscribeToWebsocket: (subscriptionType: WebsocketServiceEvent, callback: WebSocketServiceSubscriptionFunction) => void;
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSubscribeToWebsocket = void 0;
4
- const react_1 = require("react");
5
- const useWebsocketApi_1 = require("./useWebsocketApi");
6
- const useSubscribeToWebsocket = (subscriptionType, callback) => {
7
- const websocketService = (0, useWebsocketApi_1.useWebsocketApi)();
8
- (0, react_1.useEffect)(() => {
9
- const handle = websocketService === null || websocketService === void 0 ? void 0 : websocketService.subscribe(subscriptionType, callback);
10
- return () => {
11
- if (handle) {
12
- websocketService === null || websocketService === void 0 ? void 0 : websocketService.unsubscribe(handle);
13
- }
14
- };
15
- }, [websocketService, subscriptionType, callback]);
16
- };
17
- exports.useSubscribeToWebsocket = useSubscribeToWebsocket;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSubscribeToWebsocket = void 0;
4
+ const react_1 = require("react");
5
+ const useWebsocketApi_1 = require("./useWebsocketApi");
6
+ const useSubscribeToWebsocket = (subscriptionType, callback) => {
7
+ const websocketService = (0, useWebsocketApi_1.useWebsocketApi)();
8
+ (0, react_1.useEffect)(() => {
9
+ const handle = websocketService === null || websocketService === void 0 ? void 0 : websocketService.subscribe(subscriptionType, callback);
10
+ return () => {
11
+ if (handle) {
12
+ websocketService === null || websocketService === void 0 ? void 0 : websocketService.unsubscribe(handle);
13
+ }
14
+ };
15
+ }, [websocketService, subscriptionType, callback]);
16
+ };
17
+ exports.useSubscribeToWebsocket = useSubscribeToWebsocket;
@@ -1 +1 @@
1
- export declare const useWebsocketApi: () => import("quidproquo-web").WebsocketService | null;
1
+ export declare const useWebsocketApi: () => import("quidproquo-web").WebsocketService | null;
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWebsocketApi = void 0;
4
- const react_1 = require("react");
5
- const WebsocketContext_1 = require("../WebsocketContext");
6
- const useWebsocketApi = () => {
7
- const websocketService = (0, react_1.useContext)(WebsocketContext_1.WebSocketContext);
8
- return websocketService;
9
- };
10
- exports.useWebsocketApi = useWebsocketApi;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWebsocketApi = void 0;
4
+ const react_1 = require("react");
5
+ const WebsocketContext_1 = require("../WebsocketContext");
6
+ const useWebsocketApi = () => {
7
+ const websocketService = (0, react_1.useContext)(WebsocketContext_1.WebSocketContext);
8
+ return websocketService;
9
+ };
10
+ exports.useWebsocketApi = useWebsocketApi;
@@ -1,2 +1,2 @@
1
- import { WebsocketService } from 'quidproquo-web';
2
- export declare const useWebsocketManagement: (wsUrl: string) => WebsocketService | null;
1
+ import { WebsocketService } from 'quidproquo-web';
2
+ export declare const useWebsocketManagement: (wsUrl: string) => WebsocketService | null;
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWebsocketManagement = void 0;
4
- const quidproquo_web_1 = require("quidproquo-web");
5
- const react_1 = require("react");
6
- const useWebsocketManagement = (wsUrl) => {
7
- const [websocketApi, setWebsocketApi] = (0, react_1.useState)(null);
8
- (0, react_1.useEffect)(() => {
9
- const wsService = new quidproquo_web_1.WebsocketService(wsUrl);
10
- setWebsocketApi(wsService);
11
- return () => {
12
- wsService.destroy();
13
- };
14
- }, [wsUrl]);
15
- return websocketApi;
16
- };
17
- exports.useWebsocketManagement = useWebsocketManagement;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWebsocketManagement = void 0;
4
+ const quidproquo_web_1 = require("quidproquo-web");
5
+ const react_1 = require("react");
6
+ const useWebsocketManagement = (wsUrl) => {
7
+ const [websocketApi, setWebsocketApi] = (0, react_1.useState)(null);
8
+ (0, react_1.useEffect)(() => {
9
+ const wsService = new quidproquo_web_1.WebsocketService(wsUrl);
10
+ setWebsocketApi(wsService);
11
+ return () => {
12
+ wsService.destroy();
13
+ };
14
+ }, [wsUrl]);
15
+ return websocketApi;
16
+ };
17
+ exports.useWebsocketManagement = useWebsocketManagement;
@@ -1,2 +1,2 @@
1
- import { AnyEventMessage } from 'quidproquo-core';
2
- export declare const useWebsocketSendEvent: <E extends AnyEventMessage = AnyEventMessage>() => (event: E) => void;
1
+ import { AnyEventMessage } from 'quidproquo-core';
2
+ export declare const useWebsocketSendEvent: <E extends AnyEventMessage = AnyEventMessage>() => (event: E) => void;
@@ -1,15 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWebsocketSendEvent = void 0;
4
- const hooks_1 = require("../../hooks");
5
- const useWebsocketApi_1 = require("./useWebsocketApi");
6
- const useWebsocketSendEvent = () => {
7
- const websocketApi = (0, useWebsocketApi_1.useWebsocketApi)();
8
- const sendMessage = (0, hooks_1.useFastCallback)((event) => {
9
- if (websocketApi) {
10
- websocketApi.sendEvent(event);
11
- }
12
- });
13
- return sendMessage;
14
- };
15
- exports.useWebsocketSendEvent = useWebsocketSendEvent;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWebsocketSendEvent = void 0;
4
+ const hooks_1 = require("../../hooks");
5
+ const useWebsocketApi_1 = require("./useWebsocketApi");
6
+ const useWebsocketSendEvent = () => {
7
+ const websocketApi = (0, useWebsocketApi_1.useWebsocketApi)();
8
+ const sendMessage = (0, hooks_1.useFastCallback)((event) => {
9
+ if (websocketApi) {
10
+ websocketApi.sendEvent(event);
11
+ }
12
+ });
13
+ return sendMessage;
14
+ };
15
+ exports.useWebsocketSendEvent = useWebsocketSendEvent;
@@ -1,3 +1,3 @@
1
- export * from './hooks';
2
- export * from './WebSocketAuthSync';
3
- export * from './WebsocketProvider';
1
+ export * from './hooks';
2
+ export * from './WebSocketAuthSync';
3
+ export * from './WebsocketProvider';
@@ -1,19 +1,19 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hooks"), exports);
18
- __exportStar(require("./WebSocketAuthSync"), exports);
19
- __exportStar(require("./WebsocketProvider"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./hooks"), exports);
18
+ __exportStar(require("./WebSocketAuthSync"), exports);
19
+ __exportStar(require("./WebsocketProvider"), exports);
@@ -1,2 +1,2 @@
1
- export * from './useAuthenticatedNetworkRequest';
2
- export * from './useNetworkRequest';
1
+ export * from './useAuthenticatedNetworkRequest';
2
+ export * from './useNetworkRequest';
@@ -1,2 +1,2 @@
1
- export * from './useAuthenticatedNetworkRequest';
2
- export * from './useNetworkRequest';
1
+ export * from './useAuthenticatedNetworkRequest';
2
+ export * from './useNetworkRequest';
@@ -1,2 +1,2 @@
1
- import { HTTPNetworkResponse, NetworkRequestActionPayload } from 'quidproquo-core';
2
- export declare const useAuthenticatedNetworkRequest: <R>(payload: NetworkRequestActionPayload<any>) => () => Promise<HTTPNetworkResponse<R>>;
1
+ import { HTTPNetworkResponse, NetworkRequestActionPayload } from 'quidproquo-core';
2
+ export declare const useAuthenticatedNetworkRequest: <R>(payload: NetworkRequestActionPayload<any>) => (() => Promise<HTTPNetworkResponse<R>>);
@@ -1,17 +1,17 @@
1
- import { preformNetworkRequest } from 'quidproquo-web';
2
- import { useAuthAccessToken } from '../../auth';
3
- import { useFastCallback } from '../../hooks';
4
- export const useAuthenticatedNetworkRequest = (payload) => {
5
- const authToken = useAuthAccessToken();
6
- const payloadWithAuthHeaders = authToken
7
- ? {
8
- ...payload,
9
- headers: {
10
- ...(payload.headers || {}),
11
- Authorization: `Bearer ${authToken}`,
12
- },
13
- }
14
- : payload;
15
- const requeser = useFastCallback(() => preformNetworkRequest(payloadWithAuthHeaders));
16
- return requeser;
17
- };
1
+ import { preformNetworkRequest } from 'quidproquo-web';
2
+ import { useAuthAccessToken } from '../../auth';
3
+ import { useFastCallback } from '../../hooks';
4
+ export const useAuthenticatedNetworkRequest = (payload) => {
5
+ const authToken = useAuthAccessToken();
6
+ const payloadWithAuthHeaders = authToken
7
+ ? {
8
+ ...payload,
9
+ headers: {
10
+ ...(payload.headers || {}),
11
+ Authorization: `Bearer ${authToken}`,
12
+ },
13
+ }
14
+ : payload;
15
+ const requeser = useFastCallback(() => preformNetworkRequest(payloadWithAuthHeaders));
16
+ return requeser;
17
+ };
@@ -1,2 +1,2 @@
1
- import { HTTPNetworkResponse, NetworkRequestActionPayload } from 'quidproquo-core';
2
- export declare const useNetworkRequest: <R>(payload: NetworkRequestActionPayload<any>) => () => Promise<HTTPNetworkResponse<R>>;
1
+ import { HTTPNetworkResponse, NetworkRequestActionPayload } from 'quidproquo-core';
2
+ export declare const useNetworkRequest: <R>(payload: NetworkRequestActionPayload<any>) => (() => Promise<HTTPNetworkResponse<R>>);
@@ -1,6 +1,6 @@
1
- import { preformNetworkRequest } from 'quidproquo-web';
2
- import { useFastCallback } from '../../hooks';
3
- export const useNetworkRequest = (payload) => {
4
- const requeser = useFastCallback(() => preformNetworkRequest(payload));
5
- return requeser;
6
- };
1
+ import { preformNetworkRequest } from 'quidproquo-web';
2
+ import { useFastCallback } from '../../hooks';
3
+ export const useNetworkRequest = (payload) => {
4
+ const requeser = useFastCallback(() => preformNetworkRequest(payload));
5
+ return requeser;
6
+ };
@@ -1 +1 @@
1
- export * from './hooks';
1
+ export * from './hooks';
@@ -1 +1 @@
1
- export * from './hooks';
1
+ export * from './hooks';
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import { AuthenticationInfo } from 'quidproquo-core';
3
- export type RefreshAuthTokensProviderProps = {
4
- children: React.ReactNode;
5
- authenticationInfo?: AuthenticationInfo;
6
- refreshTokens: (authenticationInfo: AuthenticationInfo) => Promise<any>;
7
- };
8
- export declare const RefreshAuthTokensProvider: import("react").NamedExoticComponent<RefreshAuthTokensProviderProps>;
1
+ import { AuthenticationInfo } from 'quidproquo-core';
2
+ export type RefreshAuthTokensProviderProps = {
3
+ children: React.ReactNode;
4
+ authenticationInfo?: AuthenticationInfo;
5
+ refreshTokens: (authenticationInfo: AuthenticationInfo) => Promise<any>;
6
+ };
7
+ export declare const RefreshAuthTokensProvider: import("react").NamedExoticComponent<RefreshAuthTokensProviderProps>;
@@ -1,9 +1,9 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from 'react';
3
- import { useRefreshTokens } from './hooks';
4
- const RefreshAuthTokensProviderComponent = ({ children, authenticationInfo, refreshTokens }) => {
5
- useRefreshTokens(authenticationInfo, refreshTokens);
6
- // This fragment is not useless!
7
- return _jsx(_Fragment, { children: children });
8
- };
9
- export const RefreshAuthTokensProvider = memo(RefreshAuthTokensProviderComponent);
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useRefreshTokens } from './hooks';
4
+ const RefreshAuthTokensProviderComponent = ({ children, authenticationInfo, refreshTokens }) => {
5
+ useRefreshTokens(authenticationInfo, refreshTokens);
6
+ // This fragment is not useless!
7
+ return _jsx(_Fragment, { children: children });
8
+ };
9
+ export const RefreshAuthTokensProvider = memo(RefreshAuthTokensProviderComponent);
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- import { AuthState } from './types';
3
- export declare const authContext: import("react").Context<AuthState>;
1
+ import { AuthState } from './types';
2
+ export declare const authContext: import("react").Context<AuthState>;
@@ -1,5 +1,5 @@
1
- import { createContext } from 'react';
2
- export const authContext = createContext({
3
- username: '',
4
- password: '',
5
- });
1
+ import { createContext } from 'react';
2
+ export const authContext = createContext({
3
+ username: '',
4
+ password: '',
5
+ });
@@ -1,3 +1,3 @@
1
- export * from './useAuthAccessToken';
2
- export * from './useIsLoggedIn';
3
- export * from './useRefreshTokens';
1
+ export * from './useAuthAccessToken';
2
+ export * from './useIsLoggedIn';
3
+ export * from './useRefreshTokens';
@@ -1,3 +1,3 @@
1
- export * from './useAuthAccessToken';
2
- export * from './useIsLoggedIn';
3
- export * from './useRefreshTokens';
1
+ export * from './useAuthAccessToken';
2
+ export * from './useIsLoggedIn';
3
+ export * from './useRefreshTokens';
@@ -1 +1 @@
1
- export declare const useAuthAccessToken: () => string | undefined;
1
+ export declare const useAuthAccessToken: () => string | undefined;
@@ -1,7 +1,7 @@
1
- import { useContext } from 'react';
2
- import { authContext } from '../authContext';
3
- export const useAuthAccessToken = () => {
4
- const authState = useContext(authContext);
5
- // TODO: dont return access token if it has expired.
6
- return authState.authenticationInfo?.accessToken;
7
- };
1
+ import { useContext } from 'react';
2
+ import { authContext } from '../authContext';
3
+ export const useAuthAccessToken = () => {
4
+ const authState = useContext(authContext);
5
+ // TODO: dont return access token if it has expired.
6
+ return authState.authenticationInfo?.accessToken;
7
+ };
@@ -1 +1 @@
1
- export declare const useIsLoggedIn: () => boolean;
1
+ export declare const useIsLoggedIn: () => boolean;
@@ -1,5 +1,5 @@
1
- import { useAuthAccessToken } from './useAuthAccessToken';
2
- export const useIsLoggedIn = () => {
3
- const accessToken = useAuthAccessToken();
4
- return !!accessToken;
5
- };
1
+ import { useAuthAccessToken } from './useAuthAccessToken';
2
+ export const useIsLoggedIn = () => {
3
+ const accessToken = useAuthAccessToken();
4
+ return !!accessToken;
5
+ };
@@ -1,2 +1,2 @@
1
- import { AuthenticationInfo } from 'quidproquo-core';
2
- export declare const useRefreshTokens: (authenticationInfo: AuthenticationInfo | undefined, refreshTokens: (authenticationInfo: AuthenticationInfo) => Promise<any>) => void;
1
+ import { AuthenticationInfo } from 'quidproquo-core';
2
+ export declare const useRefreshTokens: (authenticationInfo: AuthenticationInfo | undefined, refreshTokens: (authenticationInfo: AuthenticationInfo) => Promise<any>) => void;
@@ -1,31 +1,31 @@
1
- import { useEffect } from 'react';
2
- export const useRefreshTokens = (authenticationInfo, refreshTokens) => {
3
- const refresh = () => {
4
- if (authenticationInfo && authenticationInfo.refreshToken && authenticationInfo.expiresAt) {
5
- const now = new Date().toISOString();
6
- const timeToExpire = new Date(authenticationInfo.expiresAt).getTime() - new Date(now).getTime();
7
- // Refresh the token 10 minutes before it expires to ensure there's a buffer
8
- const bufferTime = 10 * 60 * 1000;
9
- const refreshTime = timeToExpire - bufferTime;
10
- if (refreshTime > 0) {
11
- return setTimeout(() => {
12
- refreshTokens(authenticationInfo);
13
- }, refreshTime);
14
- }
15
- else {
16
- // If the token is already expired or very close to expiration, refresh immediately
17
- refreshTokens(authenticationInfo);
18
- }
19
- }
20
- return null;
21
- };
22
- useEffect(() => {
23
- const timerId = refresh();
24
- return () => {
25
- // Cleanup on unmount or when authState changes
26
- if (timerId) {
27
- clearTimeout(timerId);
28
- }
29
- };
30
- }, [authenticationInfo, refreshTokens]);
31
- };
1
+ import { useEffect } from 'react';
2
+ export const useRefreshTokens = (authenticationInfo, refreshTokens) => {
3
+ const refresh = () => {
4
+ if (authenticationInfo && authenticationInfo.refreshToken && authenticationInfo.expiresAt) {
5
+ const now = new Date().toISOString();
6
+ const timeToExpire = new Date(authenticationInfo.expiresAt).getTime() - new Date(now).getTime();
7
+ // Refresh the token 10 minutes before it expires to ensure there's a buffer
8
+ const bufferTime = 10 * 60 * 1000;
9
+ const refreshTime = timeToExpire - bufferTime;
10
+ if (refreshTime > 0) {
11
+ return setTimeout(() => {
12
+ refreshTokens(authenticationInfo);
13
+ }, refreshTime);
14
+ }
15
+ else {
16
+ // If the token is already expired or very close to expiration, refresh immediately
17
+ refreshTokens(authenticationInfo);
18
+ }
19
+ }
20
+ return null;
21
+ };
22
+ useEffect(() => {
23
+ const timerId = refresh();
24
+ return () => {
25
+ // Cleanup on unmount or when authState changes
26
+ if (timerId) {
27
+ clearTimeout(timerId);
28
+ }
29
+ };
30
+ }, [authenticationInfo, refreshTokens]);
31
+ };
@@ -1,4 +1,4 @@
1
- export * from './authContext';
2
- export * from './hooks';
3
- export * from './RefreshAuthTokensProvider';
4
- export * from './types';
1
+ export * from './authContext';
2
+ export * from './hooks';
3
+ export * from './RefreshAuthTokensProvider';
4
+ export * from './types';
@@ -1,4 +1,4 @@
1
- export * from './authContext';
2
- export * from './hooks';
3
- export * from './RefreshAuthTokensProvider';
4
- export * from './types';
1
+ export * from './authContext';
2
+ export * from './hooks';
3
+ export * from './RefreshAuthTokensProvider';
4
+ export * from './types';
@@ -1,8 +1,8 @@
1
- import { AuthenticationInfo } from 'quidproquo-core';
2
- export type AuthState = {
3
- challenge?: string;
4
- session?: string;
5
- username: string;
6
- password: string;
7
- authenticationInfo?: AuthenticationInfo;
8
- };
1
+ import { AuthenticationInfo } from 'quidproquo-core';
2
+ export type AuthState = {
3
+ challenge?: string;
4
+ session?: string;
5
+ username: string;
6
+ password: string;
7
+ authenticationInfo?: AuthenticationInfo;
8
+ };