@webiny/app 0.0.0-unstable.79032b23a5 → 0.0.0-unstable.7be00a75a9

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 (423) hide show
  1. package/App.d.ts +14 -18
  2. package/App.js +79 -102
  3. package/App.js.map +1 -1
  4. package/AppContainer.d.ts +23 -0
  5. package/AppContainer.js +6 -0
  6. package/AppContainer.js.map +1 -0
  7. package/README.md +7 -15
  8. package/apollo-client/InMemoryCache.d.ts +3 -2
  9. package/apollo-client/InMemoryCache.js +17 -55
  10. package/apollo-client/InMemoryCache.js.map +1 -1
  11. package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
  12. package/apollo-client/IntrospectionFragmentMatcher.js +33 -0
  13. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
  14. package/components/Image.d.ts +2 -3
  15. package/components/Image.js +16 -29
  16. package/components/Image.js.map +1 -1
  17. package/components/index.d.ts +1 -2
  18. package/components/index.js +1 -19
  19. package/config/RouterConfig/Route.d.ts +29 -0
  20. package/config/RouterConfig/Route.js +28 -0
  21. package/config/RouterConfig/Route.js.map +1 -0
  22. package/config/RouterConfig.d.ts +31 -0
  23. package/config/RouterConfig.js +19 -0
  24. package/config/RouterConfig.js.map +1 -0
  25. package/config.d.ts +1 -1
  26. package/config.js +21 -27
  27. package/config.js.map +1 -1
  28. package/contexts/Ui/index.d.ts +4 -4
  29. package/contexts/Ui/index.js +28 -57
  30. package/contexts/Ui/index.js.map +1 -1
  31. package/core/Plugin.d.ts +3 -3
  32. package/core/Plugin.js +11 -20
  33. package/core/Plugin.js.map +1 -1
  34. package/core/Plugins.d.ts +6 -3
  35. package/core/Plugins.js +19 -43
  36. package/core/Plugins.js.map +1 -1
  37. package/core/Provider.d.ts +3 -4
  38. package/core/Provider.js +9 -20
  39. package/core/Provider.js.map +1 -1
  40. package/core/createProvider.d.ts +7 -3
  41. package/core/createProvider.js +5 -12
  42. package/core/createProvider.js.map +1 -1
  43. package/core/createProviderPlugin.d.ts +2 -2
  44. package/core/createProviderPlugin.js +11 -20
  45. package/core/createProviderPlugin.js.map +1 -1
  46. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  47. package/errors/AuthenticationErrorEvent.js +13 -0
  48. package/errors/AuthenticationErrorEvent.js.map +1 -0
  49. package/errors/NetworkErrorEvent.d.ts +15 -0
  50. package/errors/NetworkErrorEvent.js +13 -0
  51. package/errors/NetworkErrorEvent.js.map +1 -0
  52. package/errors/abstractions.d.ts +12 -0
  53. package/errors/abstractions.js +6 -0
  54. package/errors/abstractions.js.map +1 -0
  55. package/errors/index.d.ts +6 -0
  56. package/errors/index.js +3 -0
  57. package/exports/admin/env-config.d.ts +2 -0
  58. package/exports/admin/env-config.js +2 -0
  59. package/exports/admin/graphql-client.d.ts +1 -0
  60. package/exports/admin/graphql-client.js +1 -0
  61. package/exports/admin/local-storage.d.ts +2 -0
  62. package/exports/admin/local-storage.js +2 -0
  63. package/exports/admin/router.d.ts +5 -0
  64. package/exports/admin/router.js +5 -0
  65. package/exports/admin/security.d.ts +1 -0
  66. package/exports/admin/security.js +1 -0
  67. package/exports/admin.d.ts +7 -0
  68. package/exports/admin.js +7 -0
  69. package/features/envConfig/EnvConfig.d.ts +7 -0
  70. package/features/envConfig/EnvConfig.js +16 -0
  71. package/features/envConfig/EnvConfig.js.map +1 -0
  72. package/features/envConfig/abstractions.d.ts +28 -0
  73. package/features/envConfig/abstractions.js +5 -0
  74. package/features/envConfig/abstractions.js.map +1 -0
  75. package/features/envConfig/feature.d.ts +17 -0
  76. package/features/envConfig/feature.js +15 -0
  77. package/features/envConfig/feature.js.map +1 -0
  78. package/features/envConfig/index.d.ts +1 -0
  79. package/features/envConfig/index.js +1 -0
  80. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  81. package/features/eventPublisher/EventPublisher.js +19 -0
  82. package/features/eventPublisher/EventPublisher.js.map +1 -0
  83. package/features/eventPublisher/abstractions.d.ts +18 -0
  84. package/features/eventPublisher/abstractions.js +12 -0
  85. package/features/eventPublisher/abstractions.js.map +1 -0
  86. package/features/eventPublisher/feature.d.ts +3 -0
  87. package/features/eventPublisher/feature.js +17 -0
  88. package/features/eventPublisher/feature.js.map +1 -0
  89. package/features/eventPublisher/index.d.ts +3 -0
  90. package/features/eventPublisher/index.js +2 -0
  91. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  92. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  93. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  94. package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
  95. package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
  96. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  97. package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
  98. package/features/graphqlClient/FetchGraphQLClient.js +51 -0
  99. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  100. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  101. package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
  102. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  103. package/features/graphqlClient/RequestValue.d.ts +21 -0
  104. package/features/graphqlClient/RequestValue.js +46 -0
  105. package/features/graphqlClient/RequestValue.js.map +1 -0
  106. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  107. package/features/graphqlClient/RetryGraphQLClient.js +45 -0
  108. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  109. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  110. package/features/graphqlClient/__tests__/GraphQLClient.test.js +397 -0
  111. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  112. package/features/graphqlClient/abstractions.d.ts +18 -0
  113. package/features/graphqlClient/abstractions.js +5 -0
  114. package/features/graphqlClient/abstractions.js.map +1 -0
  115. package/features/graphqlClient/feature.d.ts +6 -0
  116. package/features/graphqlClient/feature.js +25 -0
  117. package/features/graphqlClient/feature.js.map +1 -0
  118. package/features/graphqlClient/index.d.ts +1 -0
  119. package/features/graphqlClient/index.js +1 -0
  120. package/features/graphqlClient/types.d.ts +5 -0
  121. package/features/graphqlClient/types.js +0 -0
  122. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  123. package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
  124. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  125. package/features/localStorage/LocalStorage.d.ts +12 -0
  126. package/features/localStorage/LocalStorage.js +34 -0
  127. package/features/localStorage/LocalStorage.js.map +1 -0
  128. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  129. package/features/localStorage/LocalStorageRepository.js +82 -0
  130. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  131. package/features/localStorage/abstractions.d.ts +48 -0
  132. package/features/localStorage/abstractions.js +8 -0
  133. package/features/localStorage/abstractions.js.map +1 -0
  134. package/features/localStorage/feature.d.ts +12 -0
  135. package/features/localStorage/feature.js +23 -0
  136. package/features/localStorage/feature.js.map +1 -0
  137. package/features/localStorage/index.d.ts +1 -0
  138. package/features/localStorage/index.js +1 -0
  139. package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
  140. package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
  141. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
  142. package/features/mainGraphQLClient/abstractions.d.ts +17 -0
  143. package/features/mainGraphQLClient/abstractions.js +5 -0
  144. package/features/mainGraphQLClient/abstractions.js.map +1 -0
  145. package/features/mainGraphQLClient/feature.d.ts +3 -0
  146. package/features/mainGraphQLClient/feature.js +17 -0
  147. package/features/mainGraphQLClient/feature.js.map +1 -0
  148. package/features/mainGraphQLClient/index.d.ts +1 -0
  149. package/features/mainGraphQLClient/index.js +1 -0
  150. package/features/router/HistoryRouterGateway.d.ts +22 -0
  151. package/features/router/HistoryRouterGateway.js +88 -0
  152. package/features/router/HistoryRouterGateway.js.map +1 -0
  153. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  154. package/features/router/HistoryRouterGateway.test.js +195 -0
  155. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  156. package/features/router/Route.d.ts +19 -0
  157. package/features/router/Route.js +43 -0
  158. package/features/router/Route.js.map +1 -0
  159. package/features/router/RouteUrl.d.ts +85 -0
  160. package/features/router/RouteUrl.js +99 -0
  161. package/features/router/RouteUrl.js.map +1 -0
  162. package/features/router/Router.d.ts +45 -0
  163. package/features/router/Router.js +72 -0
  164. package/features/router/Router.js.map +1 -0
  165. package/features/router/RouterPresenter.d.ts +21 -0
  166. package/features/router/RouterPresenter.js +52 -0
  167. package/features/router/RouterPresenter.js.map +1 -0
  168. package/features/router/RouterRepository.d.ts +30 -0
  169. package/features/router/RouterRepository.js +117 -0
  170. package/features/router/RouterRepository.js.map +1 -0
  171. package/features/router/RouterRepository.test.d.ts +1 -0
  172. package/features/router/RouterRepository.test.js +138 -0
  173. package/features/router/RouterRepository.test.js.map +1 -0
  174. package/features/router/abstractions.d.ts +81 -0
  175. package/features/router/abstractions.js +7 -0
  176. package/features/router/abstractions.js.map +1 -0
  177. package/features/router/feature.d.ts +4 -0
  178. package/features/router/feature.js +19 -0
  179. package/features/router/feature.js.map +1 -0
  180. package/features/router/index.d.ts +2 -0
  181. package/features/router/index.js +1 -0
  182. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  183. package/helpers/InterfaceGenerator/date.js +0 -0
  184. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  185. package/helpers/InterfaceGenerator/id.js +0 -0
  186. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  187. package/helpers/InterfaceGenerator/identity.js +0 -0
  188. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  189. package/helpers/InterfaceGenerator/index.js +0 -0
  190. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  191. package/helpers/InterfaceGenerator/numeric.js +0 -0
  192. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  193. package/helpers/InterfaceGenerator/truthful.js +0 -0
  194. package/hooks/useAutocomplete/index.d.ts +1 -1
  195. package/hooks/useAutocomplete/index.js +1 -12
  196. package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
  197. package/hooks/useAutocomplete/useAutocomplete.js +16 -28
  198. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  199. package/hooks/useDataList/functions/getData.js +4 -11
  200. package/hooks/useDataList/functions/getData.js.map +1 -1
  201. package/hooks/useDataList/functions/getError.js +4 -11
  202. package/hooks/useDataList/functions/getError.js.map +1 -1
  203. package/hooks/useDataList/functions/getMeta.js +4 -11
  204. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  205. package/hooks/useDataList/functions/index.d.ts +3 -3
  206. package/hooks/useDataList/functions/index.js +3 -27
  207. package/hooks/useDataList/functions/searchDataByKey.js +11 -21
  208. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  209. package/hooks/useDataList/index.d.ts +1 -1
  210. package/hooks/useDataList/index.js +1 -12
  211. package/hooks/useDataList/useDataList.d.ts +2 -3
  212. package/hooks/useDataList/useDataList.js +140 -180
  213. package/hooks/useDataList/useDataList.js.map +1 -1
  214. package/hooks/useDataList/utils/index.d.ts +1 -2
  215. package/hooks/useDataList/utils/index.js +1 -20
  216. package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
  217. package/hooks/useDataList/utils/prepareLoadListParams.js +27 -36
  218. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  219. package/hooks/useHandler.js +14 -17
  220. package/hooks/useHandler.js.map +1 -1
  221. package/hooks/useHandlers.d.ts +3 -3
  222. package/hooks/useHandlers.js +20 -26
  223. package/hooks/useHandlers.js.map +1 -1
  224. package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
  225. package/hooks/useRegisterLegacyPlugin.js +12 -0
  226. package/hooks/useRegisterLegacyPlugin.js.map +1 -0
  227. package/hooks/useUi.d.ts +1 -1
  228. package/hooks/useUi.js +5 -11
  229. package/hooks/useUi.js.map +1 -1
  230. package/i18n/i18n.js +10 -13
  231. package/i18n/i18n.js.map +1 -1
  232. package/i18n/index.d.ts +1 -1
  233. package/i18n/index.js +1 -13
  234. package/index.d.ts +23 -13
  235. package/index.js +23 -147
  236. package/package.json +38 -41
  237. package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
  238. package/plugins/AddQuerySelectionPlugin.js +41 -116
  239. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  240. package/plugins/ApolloCacheObjectIdPlugin.js +16 -37
  241. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  242. package/plugins/ApolloDynamicLink.d.ts +3 -2
  243. package/plugins/ApolloDynamicLink.js +25 -56
  244. package/plugins/ApolloDynamicLink.js.map +1 -1
  245. package/plugins/ApolloLinkPlugin.d.ts +1 -1
  246. package/plugins/ApolloLinkPlugin.js +22 -45
  247. package/plugins/ApolloLinkPlugin.js.map +1 -1
  248. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  249. package/plugins/ConsoleLinkPlugin.js +21 -45
  250. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  251. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  252. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +48 -76
  253. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  254. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  255. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +27 -0
  256. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  257. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  258. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +23 -0
  259. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  260. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -7
  261. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -17
  262. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  263. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  264. package/plugins/NetworkErrorLinkPlugin/Typography.js +13 -0
  265. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  266. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
  267. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
  268. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  269. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +14 -30
  270. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  271. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  272. package/plugins/NetworkErrorLinkPlugin.js +52 -47
  273. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  274. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  275. package/plugins/OmitTypenameLinkPlugin.js +13 -38
  276. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  277. package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
  278. package/plugins/TenantHeaderLinkPlugin.js +27 -59
  279. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  280. package/plugins/components/Image.d.ts +6 -0
  281. package/plugins/components/Image.js +12 -0
  282. package/plugins/components/Image.js.map +1 -0
  283. package/plugins/image.d.ts +1 -1
  284. package/plugins/image.js +97 -142
  285. package/plugins/image.js.map +1 -1
  286. package/plugins/index.d.ts +5 -5
  287. package/plugins/index.js +39 -86
  288. package/plugins/index.js.map +1 -1
  289. package/presentation/envConfig/useEnvConfig.d.ts +6 -0
  290. package/presentation/envConfig/useEnvConfig.js +9 -0
  291. package/presentation/envConfig/useEnvConfig.js.map +1 -0
  292. package/presentation/localStorage/index.d.ts +3 -0
  293. package/presentation/localStorage/index.js +3 -0
  294. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  295. package/presentation/localStorage/useLocalStorage.js +15 -0
  296. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  297. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  298. package/presentation/localStorage/useLocalStorageValue.js +22 -0
  299. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  300. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  301. package/presentation/localStorage/useLocalStorageValues.js +32 -0
  302. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  303. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  304. package/presentation/router/RouteElementRegistry.js +29 -0
  305. package/presentation/router/RouteElementRegistry.js.map +1 -0
  306. package/presentation/router/abstractions.d.ts +13 -0
  307. package/presentation/router/abstractions.js +5 -0
  308. package/presentation/router/abstractions.js.map +1 -0
  309. package/presentation/router/components/Redirect.d.ts +14 -0
  310. package/presentation/router/components/Redirect.js +13 -0
  311. package/presentation/router/components/Redirect.js.map +1 -0
  312. package/presentation/router/components/RouteContent.d.ts +2 -0
  313. package/presentation/router/components/RouteContent.js +20 -0
  314. package/presentation/router/components/RouteContent.js.map +1 -0
  315. package/presentation/router/components/RouteLink.d.ts +50 -0
  316. package/presentation/router/components/RouteLink.js +17 -0
  317. package/presentation/router/components/RouteLink.js.map +1 -0
  318. package/presentation/router/components/SimpleLink.d.ts +44 -0
  319. package/presentation/router/components/SimpleLink.js +24 -0
  320. package/presentation/router/components/SimpleLink.js.map +1 -0
  321. package/presentation/router/hooks/useRoute.d.ts +6 -0
  322. package/presentation/router/hooks/useRoute.js +22 -0
  323. package/presentation/router/hooks/useRoute.js.map +1 -0
  324. package/presentation/router/hooks/useRouter.d.ts +11 -0
  325. package/presentation/router/hooks/useRouter.js +29 -0
  326. package/presentation/router/hooks/useRouter.js.map +1 -0
  327. package/presentation/router/index.d.ts +4 -0
  328. package/presentation/router/index.js +3 -0
  329. package/presentation/router/types.d.ts +5 -0
  330. package/presentation/router/types.js +0 -0
  331. package/renderApp.d.ts +2 -0
  332. package/renderApp.js +10 -0
  333. package/renderApp.js.map +1 -0
  334. package/router.d.ts +5 -0
  335. package/router.js +5 -0
  336. package/rslib-runtime.js +14 -0
  337. package/rslib-runtime.js.map +1 -0
  338. package/shared/di/DiContainerProvider.d.ts +8 -0
  339. package/shared/di/DiContainerProvider.js +13 -0
  340. package/shared/di/DiContainerProvider.js.map +1 -0
  341. package/shared/di/createFeature.d.ts +11 -0
  342. package/shared/di/createFeature.js +10 -0
  343. package/shared/di/createFeature.js.map +1 -0
  344. package/shared/di/useFeature.d.ts +2 -0
  345. package/shared/di/useFeature.js +12 -0
  346. package/shared/di/useFeature.js.map +1 -0
  347. package/static/svg/close_24px.33adaadc.svg +1 -0
  348. package/types.d.ts +16 -28
  349. package/types.js +0 -12
  350. package/utils/createGenericContext.d.ts +13 -0
  351. package/utils/createGenericContext.js +21 -0
  352. package/utils/createGenericContext.js.map +1 -0
  353. package/utils/createHashing.d.ts +2 -0
  354. package/utils/createHashing.js +15 -0
  355. package/utils/createHashing.js.map +1 -0
  356. package/utils/index.d.ts +2 -8
  357. package/utils/index.js +2 -93
  358. package/utils/legacyPluginToReactComponent.d.ts +7 -0
  359. package/utils/legacyPluginToReactComponent.js +15 -0
  360. package/utils/legacyPluginToReactComponent.js.map +1 -0
  361. package/components/Routes.d.ts +0 -2
  362. package/components/Routes.js +0 -45
  363. package/components/Routes.js.map +0 -1
  364. package/components/View.d.ts +0 -8
  365. package/components/View.js +0 -30
  366. package/components/View.js.map +0 -1
  367. package/components/index.js.map +0 -1
  368. package/core/AddRoute.d.ts +0 -3
  369. package/core/AddRoute.js +0 -19
  370. package/core/AddRoute.js.map +0 -1
  371. package/core/DebounceRender.d.ts +0 -11
  372. package/core/DebounceRender.js +0 -41
  373. package/core/DebounceRender.js.map +0 -1
  374. package/core/Routes.d.ts +0 -6
  375. package/core/Routes.js +0 -42
  376. package/core/Routes.js.map +0 -1
  377. package/hooks/useAutocomplete/index.js.map +0 -1
  378. package/hooks/useDataList/functions/index.js.map +0 -1
  379. package/hooks/useDataList/index.js.map +0 -1
  380. package/hooks/useDataList/utils/index.js.map +0 -1
  381. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  382. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -29
  383. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  384. package/hooks/useDataList/utils/types.d.ts +0 -34
  385. package/hooks/useDataList/utils/types.js +0 -5
  386. package/hooks/useDataList/utils/types.js.map +0 -1
  387. package/i18n/index.js.map +0 -1
  388. package/index.js.map +0 -1
  389. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  390. package/plugins/LocaleHeaderLinkPlugin.js +0 -53
  391. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  392. package/plugins/RoutePlugin.d.ts +0 -12
  393. package/plugins/RoutePlugin.js +0 -38
  394. package/plugins/RoutePlugin.js.map +0 -1
  395. package/plugins/ViewPlugin.d.ts +0 -14
  396. package/plugins/ViewPlugin.js +0 -43
  397. package/plugins/ViewPlugin.js.map +0 -1
  398. package/types.js.map +0 -1
  399. package/utils/getApiUrl.d.ts +0 -1
  400. package/utils/getApiUrl.js +0 -11
  401. package/utils/getApiUrl.js.map +0 -1
  402. package/utils/getGqlApiUrl.d.ts +0 -1
  403. package/utils/getGqlApiUrl.js +0 -11
  404. package/utils/getGqlApiUrl.js.map +0 -1
  405. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  406. package/utils/getHeadlessCmsGqlApiUrl.js +0 -17
  407. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  408. package/utils/getLocaleCode.d.ts +0 -6
  409. package/utils/getLocaleCode.js +0 -42
  410. package/utils/getLocaleCode.js.map +0 -1
  411. package/utils/getPrerenderId.d.ts +0 -6
  412. package/utils/getPrerenderId.js +0 -10
  413. package/utils/getPrerenderId.js.map +0 -1
  414. package/utils/getTenantId.d.ts +0 -6
  415. package/utils/getTenantId.js +0 -34
  416. package/utils/getTenantId.js.map +0 -1
  417. package/utils/index.js.map +0 -1
  418. package/utils/isLocalhost.d.ts +0 -1
  419. package/utils/isLocalhost.js +0 -14
  420. package/utils/isLocalhost.js.map +0 -1
  421. package/utils/isPrerendering.d.ts +0 -1
  422. package/utils/isPrerendering.js +0 -10
  423. package/utils/isPrerendering.js.map +0 -1
@@ -0,0 +1,118 @@
1
+ import { createDecorator } from "@webiny/di";
2
+ import { GraphQLClient } from "./abstractions.js";
3
+ import { RequestValue } from "./RequestValue.js";
4
+ class BatchingGraphQLClientImpl {
5
+ constructor(decoratee){
6
+ this.decoratee = decoratee;
7
+ this.queue = [];
8
+ this.batchTimeout = null;
9
+ this.batchWindowMs = 10;
10
+ this.maxBatchSize = 10;
11
+ }
12
+ async execute(params) {
13
+ return new Promise((resolve, reject)=>{
14
+ this.queue.push({
15
+ request: RequestValue.from(params),
16
+ resolve,
17
+ reject
18
+ });
19
+ if (this.queue.length >= this.maxBatchSize) return void this.flush();
20
+ if (!this.batchTimeout) this.batchTimeout = setTimeout(()=>{
21
+ this.flush();
22
+ }, this.batchWindowMs);
23
+ });
24
+ }
25
+ async flush() {
26
+ if (this.batchTimeout) {
27
+ clearTimeout(this.batchTimeout);
28
+ this.batchTimeout = null;
29
+ }
30
+ if (0 === this.queue.length) return;
31
+ const batch = this.queue.splice(0, this.queue.length);
32
+ if (1 === batch.length) {
33
+ const { request, resolve, reject } = batch[0];
34
+ try {
35
+ const result = await this.decoratee.execute(request.request);
36
+ resolve(result);
37
+ } catch (error) {
38
+ reject(error);
39
+ }
40
+ return;
41
+ }
42
+ const grouped = new Map();
43
+ for (const item of batch){
44
+ const groupKey = item.request.endpoint + "|" + this.serializeHeaders(item.request.headers);
45
+ if (!grouped.has(groupKey)) grouped.set(groupKey, []);
46
+ grouped.get(groupKey).push(item);
47
+ }
48
+ const batchPromises = Array.from(grouped.entries()).map((requests)=>{
49
+ const group = requests[1];
50
+ if (1 === group.length) {
51
+ const { request, resolve, reject } = group[0];
52
+ return this.decoratee.execute(request.request).then(resolve).catch(reject);
53
+ }
54
+ return this.executeBatchGroup(group);
55
+ });
56
+ await Promise.all(batchPromises);
57
+ }
58
+ async executeBatchGroup(group) {
59
+ const batchedOperations = group.map(({ request })=>({
60
+ query: request.queryAsString,
61
+ operationName: request.operationName,
62
+ variables: request.variables
63
+ }));
64
+ const endpoint = group[0].request.endpoint;
65
+ const headers = group[0].request.headers;
66
+ try {
67
+ const results = await this.executeBatch(endpoint, batchedOperations, headers);
68
+ group.forEach(({ resolve }, index)=>{
69
+ resolve(results[index]);
70
+ });
71
+ } catch (error) {
72
+ group.forEach(({ reject })=>{
73
+ reject(error);
74
+ });
75
+ }
76
+ }
77
+ serializeHeaders(headers) {
78
+ if (!headers) return "{}";
79
+ const sortedKeys = Object.keys(headers).sort();
80
+ const sortedHeaders = {};
81
+ for (const key of sortedKeys)sortedHeaders[key] = String(headers[key]);
82
+ return JSON.stringify(sortedHeaders);
83
+ }
84
+ async executeBatch(endpoint, operations, headers) {
85
+ let response;
86
+ try {
87
+ response = await fetch(endpoint, {
88
+ method: "POST",
89
+ headers: {
90
+ "Content-Type": "application/json",
91
+ ...headers || {}
92
+ },
93
+ body: JSON.stringify(operations)
94
+ });
95
+ } catch (err) {
96
+ throw new Error(`Network error: ${err.message}`);
97
+ }
98
+ let json;
99
+ try {
100
+ json = await response.json();
101
+ } catch {
102
+ throw new Error("Failed to parse GraphQL batch response as JSON.");
103
+ }
104
+ if (!Array.isArray(json)) throw new Error("Expected batch response to be an array");
105
+ return json.map((result, index)=>{
106
+ if (result.errors && result.errors.length > 0) throw new Error(`GraphQL errors in operation ${index}: ${JSON.stringify(result.errors)}`);
107
+ return result.data;
108
+ });
109
+ }
110
+ }
111
+ const BatchingGraphQLClient = createDecorator({
112
+ abstraction: GraphQLClient,
113
+ decorator: BatchingGraphQLClientImpl,
114
+ dependencies: []
115
+ });
116
+ export { BatchingGraphQLClient };
117
+
118
+ //# sourceMappingURL=BatchingGraphQLClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlClient/BatchingGraphQLClient.js","sources":["../../../src/features/graphqlClient/BatchingGraphQLClient.ts"],"sourcesContent":["import { createDecorator } from \"@webiny/di\";\nimport { GraphQLClient } from \"./abstractions.js\";\nimport { RequestValue } from \"~/features/graphqlClient/RequestValue.js\";\n\ninterface BatchedRequest {\n request: RequestValue;\n resolve: (value: any) => void;\n reject: (error: any) => void;\n}\n\ninterface BatchOperation {\n operationName: string | undefined;\n query: string;\n variables?: any;\n}\n\nclass BatchingGraphQLClientImpl implements GraphQLClient.Interface {\n private queue: BatchedRequest[] = [];\n private batchTimeout: NodeJS.Timeout | null = null;\n private readonly batchWindowMs: number;\n private readonly maxBatchSize: number;\n\n constructor(private decoratee: GraphQLClient.Interface) {\n // Default: 10ms window, max 10 operations per batch\n this.batchWindowMs = 10;\n this.maxBatchSize = 10;\n }\n\n async execute<TVariables = any, TResult = any>(\n params: GraphQLClient.Request<TVariables>\n ): Promise<TResult> {\n return new Promise((resolve, reject) => {\n this.queue.push({ request: RequestValue.from(params), resolve, reject });\n\n if (this.queue.length >= this.maxBatchSize) {\n this.flush();\n return;\n }\n\n if (!this.batchTimeout) {\n this.batchTimeout = setTimeout(() => {\n this.flush();\n }, this.batchWindowMs);\n }\n });\n }\n\n private async flush(): Promise<void> {\n if (this.batchTimeout) {\n clearTimeout(this.batchTimeout);\n this.batchTimeout = null;\n }\n\n if (this.queue.length === 0) {\n return;\n }\n\n const batch = this.queue.splice(0, this.queue.length);\n\n // Single request - use decoratee directly (no batching needed)\n if (batch.length === 1) {\n const { request, resolve, reject } = batch[0];\n try {\n const result = await this.decoratee.execute(request.request);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n return;\n }\n\n // Group requests by endpoint + headers (only batch requests with identical target)\n const grouped = new Map<string, BatchedRequest[]>();\n for (const item of batch) {\n const groupKey =\n item.request.endpoint + \"|\" + this.serializeHeaders(item.request.headers);\n if (!grouped.has(groupKey)) {\n grouped.set(groupKey, []);\n }\n grouped.get(groupKey)!.push(item);\n }\n\n // Process each group separately\n const batchPromises = Array.from(grouped.entries()).map(requests => {\n const group = requests[1];\n\n if (group.length === 1) {\n // Single request in this group - use decoratee directly\n const { request, resolve, reject } = group[0];\n return this.decoratee.execute(request.request).then(resolve).catch(reject);\n }\n\n // Multiple requests with same headers - batch them\n return this.executeBatchGroup(group);\n });\n\n await Promise.all(batchPromises);\n }\n\n private async executeBatchGroup(group: BatchedRequest[]): Promise<void> {\n const batchedOperations = group.map(({ request }): BatchOperation => {\n return {\n query: request.queryAsString,\n operationName: request.operationName,\n variables: request.variables\n };\n });\n\n const endpoint = group[0].request.endpoint;\n const headers = group[0].request.headers;\n\n try {\n const results = await this.executeBatch(endpoint, batchedOperations, headers);\n group.forEach(({ resolve }, index) => {\n resolve(results[index]);\n });\n } catch (error) {\n group.forEach(({ reject }) => {\n reject(error);\n });\n }\n }\n\n private serializeHeaders(headers?: GraphQLClient.Headers): string {\n if (!headers) {\n return \"{}\";\n }\n // Sort keys for consistent serialization\n const sortedKeys = Object.keys(headers).sort();\n const sortedHeaders: Record<string, string> = {};\n for (const key of sortedKeys) {\n sortedHeaders[key] = String(headers[key]);\n }\n return JSON.stringify(sortedHeaders);\n }\n\n private async executeBatch(\n endpoint: string,\n operations: BatchOperation[],\n headers?: GraphQLClient.Headers\n ): Promise<any[]> {\n let response: Response;\n\n try {\n response = await fetch(endpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...(headers || {})\n },\n body: JSON.stringify(operations)\n });\n } catch (err) {\n throw new Error(`Network error: ${(err as Error).message}`);\n }\n\n let json: any;\n try {\n json = await response.json();\n } catch {\n throw new Error(\"Failed to parse GraphQL batch response as JSON.\");\n }\n\n if (!Array.isArray(json)) {\n throw new Error(\"Expected batch response to be an array\");\n }\n\n // Map each result, handling individual errors\n return json.map((result: any, index: number) => {\n if (result.errors && result.errors.length > 0) {\n throw new Error(\n `GraphQL errors in operation ${index}: ${JSON.stringify(result.errors)}`\n );\n }\n return result.data;\n });\n }\n}\n\nexport const BatchingGraphQLClient = createDecorator({\n abstraction: GraphQLClient,\n decorator: BatchingGraphQLClientImpl,\n dependencies: []\n});\n"],"names":["BatchingGraphQLClientImpl","decoratee","params","Promise","resolve","reject","RequestValue","setTimeout","clearTimeout","batch","request","result","error","grouped","Map","item","groupKey","batchPromises","Array","requests","group","batchedOperations","endpoint","headers","results","index","sortedKeys","Object","sortedHeaders","key","String","JSON","operations","response","fetch","err","Error","json","BatchingGraphQLClient","createDecorator","GraphQLClient"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ declare class GraphQLClientImpl implements GraphQLClient.Interface {
3
+ execute<TResult = any, TVariables = any>(params: GraphQLClient.Request<TVariables>): Promise<TResult>;
4
+ private fetch;
5
+ }
6
+ export declare const FetchGraphQLClient: import("@webiny/di").Implementation<typeof GraphQLClientImpl>;
7
+ export {};
@@ -0,0 +1,51 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GraphQLClient } from "./abstractions.js";
3
+ import { RequestValue } from "./RequestValue.js";
4
+ class GraphQLClientImpl {
5
+ async execute(params) {
6
+ const request = RequestValue.from(params);
7
+ const body = JSON.stringify({
8
+ query: request.queryAsString,
9
+ variables: request.variables,
10
+ operationName: request.operationName
11
+ });
12
+ return this.fetch(request.endpoint, body, request.headers);
13
+ }
14
+ async fetch(endpoint, body, headers = {}) {
15
+ let response;
16
+ try {
17
+ response = await fetch(endpoint, {
18
+ method: "POST",
19
+ headers: {
20
+ "Content-Type": "application/json",
21
+ ...headers || {}
22
+ },
23
+ body
24
+ });
25
+ } catch (err) {
26
+ throw new Error(`Network error: ${err.message}`);
27
+ }
28
+ let json;
29
+ try {
30
+ json = await response.json();
31
+ } catch {
32
+ throw new Error("Failed to parse GraphQL response as JSON.");
33
+ }
34
+ if (200 !== response.status) throw {
35
+ message: json.message,
36
+ code: json.code
37
+ };
38
+ if (json.errors && json.errors.length > 0) throw new Error("GraphQL errors", {
39
+ cause: json.errors
40
+ });
41
+ return json.data;
42
+ }
43
+ }
44
+ const FetchGraphQLClient = createImplementation({
45
+ abstraction: GraphQLClient,
46
+ implementation: GraphQLClientImpl,
47
+ dependencies: []
48
+ });
49
+ export { FetchGraphQLClient };
50
+
51
+ //# sourceMappingURL=FetchGraphQLClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlClient/FetchGraphQLClient.js","sources":["../../../src/features/graphqlClient/FetchGraphQLClient.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GraphQLClient } from \"./abstractions.js\";\nimport { RequestValue } from \"~/features/graphqlClient/RequestValue.js\";\n\nclass GraphQLClientImpl implements GraphQLClient.Interface {\n async execute<TResult = any, TVariables = any>(\n params: GraphQLClient.Request<TVariables>\n ): Promise<TResult> {\n const request = RequestValue.from(params);\n\n const body = JSON.stringify({\n query: request.queryAsString,\n variables: request.variables,\n operationName: request.operationName\n });\n\n return this.fetch<TResult>(request.endpoint, body, request.headers);\n }\n\n private async fetch<TResult = any>(\n endpoint: string,\n body: string,\n headers: GraphQLClient.Headers = {}\n ): Promise<TResult> {\n let response: Response;\n try {\n response = await fetch(endpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...(headers || {})\n },\n body\n });\n } catch (err) {\n throw new Error(`Network error: ${(err as Error).message}`);\n }\n let json: any;\n try {\n json = await response.json();\n } catch {\n throw new Error(\"Failed to parse GraphQL response as JSON.\");\n }\n\n // Check for generic API errors\n if (response.status !== 200) {\n throw { message: json.message, code: json.code };\n }\n\n // Check for GraphQL errors\n if (json.errors && json.errors.length > 0) {\n throw new Error(`GraphQL errors`, { cause: json.errors });\n }\n return json.data as TResult;\n }\n}\n\nexport const FetchGraphQLClient = createImplementation({\n abstraction: GraphQLClient,\n implementation: GraphQLClientImpl,\n dependencies: []\n});\n"],"names":["GraphQLClientImpl","params","request","RequestValue","body","JSON","endpoint","headers","response","fetch","err","Error","json","FetchGraphQLClient","createImplementation","GraphQLClient"],"mappings":";;;AAIA,MAAMA;IACF,MAAM,QACFC,MAAyC,EACzB;QAChB,MAAMC,UAAUC,aAAa,IAAI,CAACF;QAElC,MAAMG,OAAOC,KAAK,SAAS,CAAC;YACxB,OAAOH,QAAQ,aAAa;YAC5B,WAAWA,QAAQ,SAAS;YAC5B,eAAeA,QAAQ,aAAa;QACxC;QAEA,OAAO,IAAI,CAAC,KAAK,CAAUA,QAAQ,QAAQ,EAAEE,MAAMF,QAAQ,OAAO;IACtE;IAEA,MAAc,MACVI,QAAgB,EAChBF,IAAY,EACZG,UAAiC,CAAC,CAAC,EACnB;QAChB,IAAIC;QACJ,IAAI;YACAA,WAAW,MAAMC,MAAMH,UAAU;gBAC7B,QAAQ;gBACR,SAAS;oBACL,gBAAgB;oBAChB,GAAIC,WAAW,CAAC,CAAC;gBACrB;gBACAH;YACJ;QACJ,EAAE,OAAOM,KAAK;YACV,MAAM,IAAIC,MAAM,CAAC,eAAe,EAAGD,IAAc,OAAO,EAAE;QAC9D;QACA,IAAIE;QACJ,IAAI;YACAA,OAAO,MAAMJ,SAAS,IAAI;QAC9B,EAAE,OAAM;YACJ,MAAM,IAAIG,MAAM;QACpB;QAGA,IAAIH,AAAoB,QAApBA,SAAS,MAAM,EACf,MAAM;YAAE,SAASI,KAAK,OAAO;YAAE,MAAMA,KAAK,IAAI;QAAC;QAInD,IAAIA,KAAK,MAAM,IAAIA,KAAK,MAAM,CAAC,MAAM,GAAG,GACpC,MAAM,IAAID,MAAM,kBAAkB;YAAE,OAAOC,KAAK,MAAM;QAAC;QAE3D,OAAOA,KAAK,IAAI;IACpB;AACJ;AAEO,MAAMC,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBf;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,14 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EventPublisher } from "../../features/eventPublisher/index.js";
3
+ declare class NetworkErrorPublishingDecorator implements GraphQLClient.Interface {
4
+ private eventPublisher;
5
+ private decoratee;
6
+ constructor(eventPublisher: EventPublisher.Interface, decoratee: GraphQLClient.Interface);
7
+ execute<TResult = any, TVariables = any>(params: GraphQLClient.Request<TVariables>): Promise<TResult>;
8
+ private isNetworkError;
9
+ private determineErrorType;
10
+ }
11
+ export declare const NetworkErrorPublishing: typeof NetworkErrorPublishingDecorator & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGraphQLClient>;
13
+ };
14
+ export {};
@@ -0,0 +1,48 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EventPublisher } from "../eventPublisher/index.js";
3
+ import { NetworkErrorEvent } from "../../errors/index.js";
4
+ import { RequestValue } from "./RequestValue.js";
5
+ class NetworkErrorPublishingDecorator {
6
+ constructor(eventPublisher, decoratee){
7
+ this.eventPublisher = eventPublisher;
8
+ this.decoratee = decoratee;
9
+ }
10
+ async execute(params) {
11
+ try {
12
+ return await this.decoratee.execute(params);
13
+ } catch (error) {
14
+ if (this.isNetworkError(error)) {
15
+ const request = RequestValue.from(params);
16
+ const event = new NetworkErrorEvent({
17
+ message: error.message,
18
+ code: error.code ?? void 0,
19
+ operationName: request.operationName,
20
+ query: request.queryAsString,
21
+ variables: request.variables,
22
+ errorType: this.determineErrorType(error)
23
+ });
24
+ await this.eventPublisher.publish(event);
25
+ }
26
+ throw error;
27
+ }
28
+ }
29
+ isNetworkError(error) {
30
+ return error.message.includes("Tenant is disabled") || error.message.includes("Network error") || error.message.includes("Failed to fetch") || error.message.includes("network failure") || error.message.includes("Local AWS Lambda");
31
+ }
32
+ determineErrorType(error) {
33
+ const message = error.message.toLowerCase();
34
+ if (message.includes("timeout")) return "timeout";
35
+ if (message.includes("fetch") || message.includes("failed to fetch")) return "fetch";
36
+ if (message.includes("network")) return "network";
37
+ return "unknown";
38
+ }
39
+ }
40
+ const NetworkErrorPublishing = GraphQLClient.createDecorator({
41
+ decorator: NetworkErrorPublishingDecorator,
42
+ dependencies: [
43
+ EventPublisher
44
+ ]
45
+ });
46
+ export { NetworkErrorPublishing };
47
+
48
+ //# sourceMappingURL=NetworkErrorPublishing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlClient/NetworkErrorPublishing.js","sources":["../../../src/features/graphqlClient/NetworkErrorPublishing.ts"],"sourcesContent":["import { GraphQLClient } from \"./abstractions.js\";\nimport { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { NetworkErrorEvent } from \"~/errors/index.js\";\nimport { RequestValue } from \"./RequestValue.js\";\n\nclass NetworkErrorPublishingDecorator implements GraphQLClient.Interface {\n constructor(\n private eventPublisher: EventPublisher.Interface,\n private decoratee: GraphQLClient.Interface\n ) {}\n\n async execute<TResult = any, TVariables = any>(\n params: GraphQLClient.Request<TVariables>\n ): Promise<TResult> {\n try {\n return await this.decoratee.execute(params);\n } catch (error) {\n // Only publish network errors, not GraphQL errors\n if (this.isNetworkError(error as Error)) {\n const request = RequestValue.from(params);\n\n const event = new NetworkErrorEvent({\n message: (error as Error).message,\n code: error.code ?? undefined,\n operationName: request.operationName,\n query: request.queryAsString,\n variables: request.variables,\n errorType: this.determineErrorType(error as Error)\n });\n\n await this.eventPublisher.publish(event);\n }\n\n // Re-throw to preserve existing behavior\n throw error;\n }\n }\n\n private isNetworkError(error: Error): boolean {\n // Network errors typically have these patterns in the message\n return (\n error.message.includes(\"Tenant is disabled\") ||\n error.message.includes(\"Network error\") ||\n error.message.includes(\"Failed to fetch\") ||\n error.message.includes(\"network failure\") ||\n error.message.includes(\"Local AWS Lambda\")\n );\n }\n\n private determineErrorType(error: Error): \"network\" | \"timeout\" | \"fetch\" | \"unknown\" {\n const message = error.message.toLowerCase();\n\n if (message.includes(\"timeout\")) {\n return \"timeout\";\n }\n\n if (message.includes(\"fetch\") || message.includes(\"failed to fetch\")) {\n return \"fetch\";\n }\n\n if (message.includes(\"network\")) {\n return \"network\";\n }\n\n return \"unknown\";\n }\n}\n\nexport const NetworkErrorPublishing = GraphQLClient.createDecorator({\n decorator: NetworkErrorPublishingDecorator,\n dependencies: [EventPublisher]\n});\n"],"names":["NetworkErrorPublishingDecorator","eventPublisher","decoratee","params","error","request","RequestValue","event","NetworkErrorEvent","undefined","message","NetworkErrorPublishing","GraphQLClient","EventPublisher"],"mappings":";;;;AAKA,MAAMA;IACF,YACYC,cAAwC,EACxCC,SAAkC,CAC5C;aAFUD,cAAc,GAAdA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QACFC,MAAyC,EACzB;QAChB,IAAI;YACA,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACA;QACxC,EAAE,OAAOC,OAAO;YAEZ,IAAI,IAAI,CAAC,cAAc,CAACA,QAAiB;gBACrC,MAAMC,UAAUC,aAAa,IAAI,CAACH;gBAElC,MAAMI,QAAQ,IAAIC,kBAAkB;oBAChC,SAAUJ,MAAgB,OAAO;oBACjC,MAAMA,MAAM,IAAI,IAAIK;oBACpB,eAAeJ,QAAQ,aAAa;oBACpC,OAAOA,QAAQ,aAAa;oBAC5B,WAAWA,QAAQ,SAAS;oBAC5B,WAAW,IAAI,CAAC,kBAAkB,CAACD;gBACvC;gBAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAACG;YACtC;YAGA,MAAMH;QACV;IACJ;IAEQ,eAAeA,KAAY,EAAW;QAE1C,OACIA,MAAM,OAAO,CAAC,QAAQ,CAAC,yBACvBA,MAAM,OAAO,CAAC,QAAQ,CAAC,oBACvBA,MAAM,OAAO,CAAC,QAAQ,CAAC,sBACvBA,MAAM,OAAO,CAAC,QAAQ,CAAC,sBACvBA,MAAM,OAAO,CAAC,QAAQ,CAAC;IAE/B;IAEQ,mBAAmBA,KAAY,EAA+C;QAClF,MAAMM,UAAUN,MAAM,OAAO,CAAC,WAAW;QAEzC,IAAIM,QAAQ,QAAQ,CAAC,YACjB,OAAO;QAGX,IAAIA,QAAQ,QAAQ,CAAC,YAAYA,QAAQ,QAAQ,CAAC,oBAC9C,OAAO;QAGX,IAAIA,QAAQ,QAAQ,CAAC,YACjB,OAAO;QAGX,OAAO;IACX;AACJ;AAEO,MAAMC,yBAAyBC,cAAc,eAAe,CAAC;IAChE,WAAWZ;IACX,cAAc;QAACa;KAAe;AAClC"}
@@ -0,0 +1,21 @@
1
+ import { type DocumentNode } from "graphql";
2
+ import { GraphQLClient } from "./abstractions.js";
3
+ export declare class RequestValue {
4
+ readonly value: GraphQLClient.Request;
5
+ private readonly _operationName;
6
+ private readonly _queryAsString;
7
+ private readonly _queryAsDocumentNode;
8
+ private readonly _request;
9
+ static from(value: GraphQLClient.Request): RequestValue;
10
+ private constructor();
11
+ get request(): GraphQLClient.Request<any>;
12
+ get variables(): any;
13
+ get queryAsString(): string;
14
+ get queryAsDocumentNode(): DocumentNode;
15
+ get headers(): {
16
+ [x: string]: string | number | undefined;
17
+ } | undefined;
18
+ get endpoint(): string;
19
+ get operationName(): string | undefined;
20
+ private getOperationName;
21
+ }
@@ -0,0 +1,46 @@
1
+ import { getOperationAST, parse, print } from "graphql";
2
+ class RequestValue {
3
+ static from(value) {
4
+ return new RequestValue(value);
5
+ }
6
+ constructor(value){
7
+ this.value = value;
8
+ this._request = value;
9
+ if ("string" == typeof value.query) {
10
+ this._queryAsString = value.query;
11
+ this._queryAsDocumentNode = parse(value.query);
12
+ } else {
13
+ this._queryAsString = print(value.query);
14
+ this._queryAsDocumentNode = value.query;
15
+ }
16
+ this._operationName = this.getOperationName(this._queryAsDocumentNode);
17
+ }
18
+ get request() {
19
+ return this._request;
20
+ }
21
+ get variables() {
22
+ return this._request.variables;
23
+ }
24
+ get queryAsString() {
25
+ return this._queryAsString;
26
+ }
27
+ get queryAsDocumentNode() {
28
+ return this._queryAsDocumentNode;
29
+ }
30
+ get headers() {
31
+ return this._request.headers;
32
+ }
33
+ get endpoint() {
34
+ return this._request.endpoint;
35
+ }
36
+ get operationName() {
37
+ return this._operationName;
38
+ }
39
+ getOperationName(query) {
40
+ const operationAST = getOperationAST(query, void 0);
41
+ return operationAST?.name?.value;
42
+ }
43
+ }
44
+ export { RequestValue };
45
+
46
+ //# sourceMappingURL=RequestValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlClient/RequestValue.js","sources":["../../../src/features/graphqlClient/RequestValue.ts"],"sourcesContent":["import { getOperationAST, parse, print, type DocumentNode } from \"graphql\";\nimport { GraphQLClient } from \"./abstractions.js\";\n\nexport class RequestValue {\n private readonly _operationName: string | undefined;\n private readonly _queryAsString: string;\n private readonly _queryAsDocumentNode: DocumentNode;\n private readonly _request: GraphQLClient.Request;\n\n static from(value: GraphQLClient.Request) {\n return new RequestValue(value);\n }\n\n private constructor(readonly value: GraphQLClient.Request) {\n this._request = value;\n if (typeof value.query === \"string\") {\n this._queryAsString = value.query;\n this._queryAsDocumentNode = parse(value.query);\n } else {\n this._queryAsString = print(value.query);\n this._queryAsDocumentNode = value.query;\n }\n\n this._operationName = this.getOperationName(this._queryAsDocumentNode);\n }\n\n get request() {\n return this._request;\n }\n\n get variables() {\n return this._request.variables;\n }\n\n get queryAsString() {\n return this._queryAsString;\n }\n\n get queryAsDocumentNode() {\n return this._queryAsDocumentNode;\n }\n\n get headers() {\n return this._request.headers;\n }\n\n get endpoint() {\n return this._request.endpoint;\n }\n\n get operationName() {\n return this._operationName;\n }\n\n private getOperationName(query: DocumentNode): string | undefined {\n const operationAST = getOperationAST(query, undefined);\n return operationAST?.name?.value;\n }\n}\n"],"names":["RequestValue","value","parse","print","query","operationAST","getOperationAST","undefined"],"mappings":";AAGO,MAAMA;IAMT,OAAO,KAAKC,KAA4B,EAAE;QACtC,OAAO,IAAID,aAAaC;IAC5B;IAEA,YAA6BA,KAA4B,CAAE;aAA9BA,KAAK,GAALA;QACzB,IAAI,CAAC,QAAQ,GAAGA;QAChB,IAAI,AAAuB,YAAvB,OAAOA,MAAM,KAAK,EAAe;YACjC,IAAI,CAAC,cAAc,GAAGA,MAAM,KAAK;YACjC,IAAI,CAAC,oBAAoB,GAAGC,MAAMD,MAAM,KAAK;QACjD,OAAO;YACH,IAAI,CAAC,cAAc,GAAGE,MAAMF,MAAM,KAAK;YACvC,IAAI,CAAC,oBAAoB,GAAGA,MAAM,KAAK;QAC3C;QAEA,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAoB;IACzE;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS;IAClC;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,cAAc;IAC9B;IAEA,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,oBAAoB;IACpC;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;IAChC;IAEA,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ;IACjC;IAEA,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,cAAc;IAC9B;IAEQ,iBAAiBG,KAAmB,EAAsB;QAC9D,MAAMC,eAAeC,gBAAgBF,OAAOG;QAC5C,OAAOF,cAAc,MAAM;IAC/B;AACJ"}
@@ -0,0 +1,18 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EnvConfig } from "../../features/envConfig/index.js";
3
+ declare class RetryGraphQLClientImpl implements GraphQLClient.Interface {
4
+ private decoratee;
5
+ private readonly maxRetries;
6
+ private readonly baseDelayMs;
7
+ constructor(envConfig: EnvConfig.Interface, decoratee: GraphQLClient.Interface);
8
+ execute<TResult = any, TVariables = any>(params: GraphQLClient.Request<TVariables>): Promise<TResult>;
9
+ private isGraphQLError;
10
+ private isAuthenticationError;
11
+ private isMaintenanceError;
12
+ private calculateBackoff;
13
+ private delay;
14
+ }
15
+ export declare const RetryGraphQLClient: typeof RetryGraphQLClientImpl & {
16
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGraphQLClient>;
17
+ };
18
+ export {};
@@ -0,0 +1,45 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EnvConfig } from "../envConfig/index.js";
3
+ class RetryGraphQLClientImpl {
4
+ constructor(envConfig, decoratee){
5
+ this.decoratee = decoratee;
6
+ const gqlClientConfig = envConfig.get("graphqlClient");
7
+ this.maxRetries = gqlClientConfig?.retries.maxRetries ?? 3;
8
+ this.baseDelayMs = gqlClientConfig?.retries.delayInMillis ?? 100;
9
+ }
10
+ async execute(params) {
11
+ let lastError;
12
+ for(let attempt = 0; attempt <= this.maxRetries; attempt++)try {
13
+ return await this.decoratee.execute(params);
14
+ } catch (error) {
15
+ lastError = error;
16
+ if (this.isGraphQLError(error) || this.isAuthenticationError(error) || this.isMaintenanceError(error)) throw error;
17
+ if (attempt < this.maxRetries) await this.delay(this.calculateBackoff(attempt));
18
+ }
19
+ throw lastError;
20
+ }
21
+ isGraphQLError(error) {
22
+ return error.message.includes("GraphQL");
23
+ }
24
+ isAuthenticationError(error) {
25
+ return error.code?.includes("Authentication/");
26
+ }
27
+ isMaintenanceError(error) {
28
+ return error.code?.includes("Tenancy/");
29
+ }
30
+ calculateBackoff(attempt) {
31
+ return Math.pow(2, attempt) * this.baseDelayMs;
32
+ }
33
+ delay(ms) {
34
+ return new Promise((resolve)=>setTimeout(resolve, ms));
35
+ }
36
+ }
37
+ const RetryGraphQLClient = GraphQLClient.createDecorator({
38
+ decorator: RetryGraphQLClientImpl,
39
+ dependencies: [
40
+ EnvConfig
41
+ ]
42
+ });
43
+ export { RetryGraphQLClient };
44
+
45
+ //# sourceMappingURL=RetryGraphQLClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlClient/RetryGraphQLClient.js","sources":["../../../src/features/graphqlClient/RetryGraphQLClient.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/admin\";\nimport { GraphQLClient } from \"./abstractions.js\";\nimport { EnvConfig } from \"~/features/envConfig/index.js\";\n\nclass RetryGraphQLClientImpl implements GraphQLClient.Interface {\n private readonly maxRetries: number;\n private readonly baseDelayMs: number;\n\n constructor(\n envConfig: EnvConfig.Interface,\n private decoratee: GraphQLClient.Interface\n ) {\n const gqlClientConfig = envConfig.get(\"graphqlClient\");\n\n this.maxRetries = gqlClientConfig?.retries.maxRetries ?? 3;\n this.baseDelayMs = gqlClientConfig?.retries.delayInMillis ?? 100;\n }\n\n async execute<TResult = any, TVariables = any>(\n params: GraphQLClient.Request<TVariables>\n ): Promise<TResult> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.maxRetries; attempt++) {\n try {\n return await this.decoratee.execute(params);\n } catch (error) {\n lastError = error as Error;\n\n // Don't retry GraphQL errors (business logic errors)\n // Only retry network/infrastructure errors\n if (\n this.isGraphQLError(error as Error) ||\n this.isAuthenticationError(error as BaseError) ||\n this.isMaintenanceError(error as BaseError)\n ) {\n throw error;\n }\n\n // Don't delay after the last attempt\n if (attempt < this.maxRetries) {\n await this.delay(this.calculateBackoff(attempt));\n }\n }\n }\n\n throw lastError!;\n }\n\n private isGraphQLError(error: Error): boolean {\n return error.message.includes(\"GraphQL\");\n }\n\n private isAuthenticationError(error: BaseError): boolean {\n return error.code?.includes(\"Authentication/\");\n }\n\n private isMaintenanceError(error: BaseError): boolean {\n return error.code?.includes(\"Tenancy/\");\n }\n\n private calculateBackoff(attempt: number): number {\n // Exponential backoff: 100ms, 200ms, 400ms, etc.\n return Math.pow(2, attempt) * this.baseDelayMs;\n }\n\n private delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n}\n\nexport const RetryGraphQLClient = GraphQLClient.createDecorator({\n decorator: RetryGraphQLClientImpl,\n dependencies: [EnvConfig]\n});\n"],"names":["RetryGraphQLClientImpl","envConfig","decoratee","gqlClientConfig","params","lastError","attempt","error","Math","ms","Promise","resolve","setTimeout","RetryGraphQLClient","GraphQLClient","EnvConfig"],"mappings":";;AAIA,MAAMA;IAIF,YACIC,SAA8B,EACtBC,SAAkC,CAC5C;aADUA,SAAS,GAATA;QAER,MAAMC,kBAAkBF,UAAU,GAAG,CAAC;QAEtC,IAAI,CAAC,UAAU,GAAGE,iBAAiB,QAAQ,cAAc;QACzD,IAAI,CAAC,WAAW,GAAGA,iBAAiB,QAAQ,iBAAiB;IACjE;IAEA,MAAM,QACFC,MAAyC,EACzB;QAChB,IAAIC;QAEJ,IAAK,IAAIC,UAAU,GAAGA,WAAW,IAAI,CAAC,UAAU,EAAEA,UAC9C,IAAI;YACA,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACF;QACxC,EAAE,OAAOG,OAAO;YACZF,YAAYE;YAIZ,IACI,IAAI,CAAC,cAAc,CAACA,UACpB,IAAI,CAAC,qBAAqB,CAACA,UAC3B,IAAI,CAAC,kBAAkB,CAACA,QAExB,MAAMA;YAIV,IAAID,UAAU,IAAI,CAAC,UAAU,EACzB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAACA;QAE/C;QAGJ,MAAMD;IACV;IAEQ,eAAeE,KAAY,EAAW;QAC1C,OAAOA,MAAM,OAAO,CAAC,QAAQ,CAAC;IAClC;IAEQ,sBAAsBA,KAAgB,EAAW;QACrD,OAAOA,MAAM,IAAI,EAAE,SAAS;IAChC;IAEQ,mBAAmBA,KAAgB,EAAW;QAClD,OAAOA,MAAM,IAAI,EAAE,SAAS;IAChC;IAEQ,iBAAiBD,OAAe,EAAU;QAE9C,OAAOE,KAAK,GAAG,CAAC,GAAGF,WAAW,IAAI,CAAC,WAAW;IAClD;IAEQ,MAAMG,EAAU,EAAiB;QACrC,OAAO,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAASF;IACtD;AACJ;AAEO,MAAMI,qBAAqBC,cAAc,eAAe,CAAC;IAC5D,WAAWd;IACX,cAAc;QAACe;KAAU;AAC7B"}