@webiny/app 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.f6dc066313

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 (385) hide show
  1. package/App.d.ts +4 -5
  2. package/App.js +26 -32
  3. package/App.js.map +1 -1
  4. package/README.md +7 -15
  5. package/apollo-client/InMemoryCache.js +2 -2
  6. package/apollo-client/InMemoryCache.js.map +1 -1
  7. package/components/Image.d.ts +1 -2
  8. package/components/Image.js +1 -1
  9. package/components/Image.js.map +1 -1
  10. package/components/index.d.ts +1 -2
  11. package/components/index.js +1 -2
  12. package/components/index.js.map +1 -1
  13. package/config/RouterConfig/Route.d.ts +9 -10
  14. package/config/RouterConfig/Route.js +5 -14
  15. package/config/RouterConfig/Route.js.map +1 -1
  16. package/config/RouterConfig.d.ts +10 -11
  17. package/config/RouterConfig.js +1 -1
  18. package/config/RouterConfig.js.map +1 -1
  19. package/contexts/Ui/index.js.map +1 -1
  20. package/core/Plugin.js +2 -2
  21. package/core/Plugin.js.map +1 -1
  22. package/core/Plugins.d.ts +1 -1
  23. package/core/Plugins.js +5 -4
  24. package/core/Plugins.js.map +1 -1
  25. package/core/Provider.d.ts +1 -1
  26. package/core/Provider.js +1 -1
  27. package/core/Provider.js.map +1 -1
  28. package/core/createProviderPlugin.js +1 -1
  29. package/core/createProviderPlugin.js.map +1 -1
  30. package/errors/AuthenticationErrorEvent.d.ts +9 -0
  31. package/errors/AuthenticationErrorEvent.js +10 -0
  32. package/errors/AuthenticationErrorEvent.js.map +1 -0
  33. package/errors/NetworkErrorEvent.d.ts +15 -0
  34. package/errors/NetworkErrorEvent.js +10 -0
  35. package/errors/NetworkErrorEvent.js.map +1 -0
  36. package/errors/abstractions.d.ts +12 -0
  37. package/errors/abstractions.js +5 -0
  38. package/errors/abstractions.js.map +1 -0
  39. package/errors/index.d.ts +6 -0
  40. package/errors/index.js +6 -0
  41. package/errors/index.js.map +1 -0
  42. package/exports/admin/env-config.d.ts +1 -0
  43. package/exports/admin/env-config.js +3 -0
  44. package/exports/admin/env-config.js.map +1 -0
  45. package/exports/admin/graphql-client.d.ts +1 -0
  46. package/exports/admin/graphql-client.js +3 -0
  47. package/exports/admin/graphql-client.js.map +1 -0
  48. package/exports/admin/local-storage.d.ts +2 -0
  49. package/exports/admin/local-storage.js +4 -0
  50. package/exports/admin/local-storage.js.map +1 -0
  51. package/exports/admin/router.d.ts +5 -0
  52. package/exports/admin/router.js +7 -0
  53. package/exports/admin/router.js.map +1 -0
  54. package/exports/admin/security.d.ts +1 -0
  55. package/exports/admin/security.js +3 -0
  56. package/exports/admin/security.js.map +1 -0
  57. package/exports/admin.d.ts +6 -0
  58. package/exports/admin.js +8 -0
  59. package/exports/admin.js.map +1 -0
  60. package/features/envConfig/EnvConfig.d.ts +6 -0
  61. package/features/envConfig/EnvConfig.js +14 -0
  62. package/features/envConfig/EnvConfig.js.map +1 -0
  63. package/features/envConfig/abstractions.d.ts +27 -0
  64. package/features/envConfig/abstractions.js +4 -0
  65. package/features/envConfig/abstractions.js.map +1 -0
  66. package/features/envConfig/feature.d.ts +17 -0
  67. package/features/envConfig/feature.js +14 -0
  68. package/features/envConfig/feature.js.map +1 -0
  69. package/features/envConfig/index.d.ts +1 -0
  70. package/features/envConfig/index.js +3 -0
  71. package/features/envConfig/index.js.map +1 -0
  72. package/features/eventPublisher/EventPublisher.d.ts +8 -0
  73. package/features/eventPublisher/EventPublisher.js +27 -0
  74. package/features/eventPublisher/EventPublisher.js.map +1 -0
  75. package/features/eventPublisher/abstractions.d.ts +18 -0
  76. package/features/eventPublisher/abstractions.js +14 -0
  77. package/features/eventPublisher/abstractions.js.map +1 -0
  78. package/features/eventPublisher/feature.d.ts +1 -0
  79. package/features/eventPublisher/feature.js +11 -0
  80. package/features/eventPublisher/feature.js.map +1 -0
  81. package/features/eventPublisher/index.d.ts +3 -0
  82. package/features/eventPublisher/index.js +4 -0
  83. package/features/eventPublisher/index.js.map +1 -0
  84. package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
  85. package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
  86. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
  87. package/features/graphqlClient/BatchingGraphQLClient.d.ts +18 -0
  88. package/features/graphqlClient/BatchingGraphQLClient.js +164 -0
  89. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
  90. package/features/graphqlClient/FetchGraphQLClient.d.ts +10 -0
  91. package/features/graphqlClient/FetchGraphQLClient.js +62 -0
  92. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
  93. package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
  94. package/features/graphqlClient/NetworkErrorPublishing.js +55 -0
  95. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
  96. package/features/graphqlClient/RequestValue.d.ts +20 -0
  97. package/features/graphqlClient/RequestValue.js +42 -0
  98. package/features/graphqlClient/RequestValue.js.map +1 -0
  99. package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
  100. package/features/graphqlClient/RetryGraphQLClient.js +54 -0
  101. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
  102. package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
  103. package/features/graphqlClient/__tests__/GraphQLClient.test.js +350 -0
  104. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
  105. package/features/graphqlClient/abstractions.d.ts +17 -0
  106. package/features/graphqlClient/abstractions.js +4 -0
  107. package/features/graphqlClient/abstractions.js.map +1 -0
  108. package/features/graphqlClient/feature.d.ts +6 -0
  109. package/features/graphqlClient/feature.js +31 -0
  110. package/features/graphqlClient/feature.js.map +1 -0
  111. package/features/graphqlClient/index.d.ts +1 -0
  112. package/features/graphqlClient/index.js +3 -0
  113. package/features/graphqlClient/index.js.map +1 -0
  114. package/features/graphqlClient/types.d.ts +5 -0
  115. package/features/graphqlClient/types.js.map +1 -0
  116. package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
  117. package/features/localStorage/BrowserLocalStorageGateway.js +68 -0
  118. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
  119. package/features/localStorage/LocalStorage.d.ts +12 -0
  120. package/features/localStorage/LocalStorage.js +31 -0
  121. package/features/localStorage/LocalStorage.js.map +1 -0
  122. package/features/localStorage/LocalStorageRepository.d.ts +20 -0
  123. package/features/localStorage/LocalStorageRepository.js +95 -0
  124. package/features/localStorage/LocalStorageRepository.js.map +1 -0
  125. package/features/localStorage/abstractions.d.ts +48 -0
  126. package/features/localStorage/abstractions.js +19 -0
  127. package/features/localStorage/abstractions.js.map +1 -0
  128. package/features/localStorage/feature.d.ts +12 -0
  129. package/features/localStorage/feature.js +34 -0
  130. package/features/localStorage/feature.js.map +1 -0
  131. package/features/localStorage/index.d.ts +1 -0
  132. package/features/localStorage/index.js +3 -0
  133. package/features/localStorage/index.js.map +1 -0
  134. package/features/router/HistoryRouterGateway.d.ts +18 -0
  135. package/features/router/HistoryRouterGateway.js +82 -0
  136. package/features/router/HistoryRouterGateway.js.map +1 -0
  137. package/features/router/HistoryRouterGateway.test.d.ts +1 -0
  138. package/features/router/HistoryRouterGateway.test.js +204 -0
  139. package/features/router/HistoryRouterGateway.test.js.map +1 -0
  140. package/features/router/Route.d.ts +19 -0
  141. package/features/router/Route.js +59 -0
  142. package/features/router/Route.js.map +1 -0
  143. package/features/router/RouteUrl.d.ts +85 -0
  144. package/features/router/RouteUrl.js +232 -0
  145. package/features/router/RouteUrl.js.map +1 -0
  146. package/features/router/Router.d.ts +45 -0
  147. package/features/router/Router.js +129 -0
  148. package/features/router/Router.js.map +1 -0
  149. package/features/router/RouterPresenter.d.ts +17 -0
  150. package/features/router/RouterPresenter.js +45 -0
  151. package/features/router/RouterPresenter.js.map +1 -0
  152. package/features/router/RouterRepository.d.ts +21 -0
  153. package/features/router/RouterRepository.js +71 -0
  154. package/features/router/RouterRepository.js.map +1 -0
  155. package/features/router/RouterRepository.test.d.ts +1 -0
  156. package/features/router/RouterRepository.test.js +154 -0
  157. package/features/router/RouterRepository.test.js.map +1 -0
  158. package/features/router/abstractions.d.ts +68 -0
  159. package/features/router/abstractions.js +15 -0
  160. package/features/router/abstractions.js.map +1 -0
  161. package/features/router/feature.d.ts +4 -0
  162. package/features/router/feature.js +18 -0
  163. package/features/router/feature.js.map +1 -0
  164. package/features/router/index.d.ts +1 -0
  165. package/features/router/index.js +3 -0
  166. package/features/router/index.js.map +1 -0
  167. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  168. package/helpers/InterfaceGenerator/date.js +3 -0
  169. package/helpers/InterfaceGenerator/date.js.map +1 -0
  170. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  171. package/helpers/InterfaceGenerator/id.js +3 -0
  172. package/helpers/InterfaceGenerator/id.js.map +1 -0
  173. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  174. package/helpers/InterfaceGenerator/identity.js +3 -0
  175. package/helpers/InterfaceGenerator/identity.js.map +1 -0
  176. package/helpers/InterfaceGenerator/index.d.ts +5 -0
  177. package/helpers/InterfaceGenerator/index.js +3 -0
  178. package/helpers/InterfaceGenerator/index.js.map +1 -0
  179. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  180. package/helpers/InterfaceGenerator/numeric.js +3 -0
  181. package/helpers/InterfaceGenerator/numeric.js.map +1 -0
  182. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  183. package/helpers/InterfaceGenerator/truthful.js +3 -0
  184. package/helpers/InterfaceGenerator/truthful.js.map +1 -0
  185. package/hooks/useAutocomplete/index.d.ts +1 -1
  186. package/hooks/useAutocomplete/index.js +1 -1
  187. package/hooks/useAutocomplete/index.js.map +1 -1
  188. package/hooks/useAutocomplete/useAutocomplete.js +3 -6
  189. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  190. package/hooks/useDataList/functions/getData.js +1 -1
  191. package/hooks/useDataList/functions/getData.js.map +1 -1
  192. package/hooks/useDataList/functions/getError.js +1 -1
  193. package/hooks/useDataList/functions/getError.js.map +1 -1
  194. package/hooks/useDataList/functions/getMeta.js +1 -1
  195. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  196. package/hooks/useDataList/functions/index.d.ts +3 -3
  197. package/hooks/useDataList/functions/index.js +3 -3
  198. package/hooks/useDataList/functions/index.js.map +1 -1
  199. package/hooks/useDataList/index.d.ts +1 -1
  200. package/hooks/useDataList/index.js +1 -1
  201. package/hooks/useDataList/index.js.map +1 -1
  202. package/hooks/useDataList/useDataList.d.ts +0 -1
  203. package/hooks/useDataList/useDataList.js +6 -26
  204. package/hooks/useDataList/useDataList.js.map +1 -1
  205. package/hooks/useDataList/utils/index.d.ts +1 -2
  206. package/hooks/useDataList/utils/index.js +1 -2
  207. package/hooks/useDataList/utils/index.js.map +1 -1
  208. package/hooks/useDataList/utils/prepareLoadListParams.js +1 -1
  209. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  210. package/hooks/useHandlers.js.map +1 -1
  211. package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
  212. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  213. package/hooks/useUi.d.ts +1 -1
  214. package/hooks/useUi.js +1 -1
  215. package/hooks/useUi.js.map +1 -1
  216. package/i18n/index.d.ts +1 -1
  217. package/i18n/index.js +1 -1
  218. package/i18n/index.js.map +1 -1
  219. package/index.d.ts +22 -15
  220. package/index.js +21 -14
  221. package/index.js.map +1 -1
  222. package/package.json +25 -23
  223. package/plugins/AddQuerySelectionPlugin.d.ts +1 -1
  224. package/plugins/AddQuerySelectionPlugin.js +1 -1
  225. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  226. package/plugins/ApolloDynamicLink.d.ts +1 -1
  227. package/plugins/ApolloDynamicLink.js.map +1 -1
  228. package/plugins/ConsoleLinkPlugin.d.ts +1 -1
  229. package/plugins/ConsoleLinkPlugin.js +1 -1
  230. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  231. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
  232. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +15 -26
  233. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  234. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
  235. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +31 -0
  236. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
  237. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
  238. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +31 -0
  239. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
  240. package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -5
  241. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +3 -3
  242. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  243. package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
  244. package/plugins/NetworkErrorLinkPlugin/Typography.js +18 -0
  245. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
  246. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
  247. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +4 -13
  248. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  249. package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
  250. package/plugins/NetworkErrorLinkPlugin.js +47 -7
  251. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  252. package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
  253. package/plugins/OmitTypenameLinkPlugin.js +1 -1
  254. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  255. package/plugins/TenantHeaderLinkPlugin.d.ts +2 -2
  256. package/plugins/TenantHeaderLinkPlugin.js +2 -4
  257. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  258. package/plugins/components/Image.d.ts +6 -0
  259. package/plugins/components/Image.js +19 -0
  260. package/plugins/components/Image.js.map +1 -0
  261. package/plugins/image.d.ts +1 -1
  262. package/plugins/image.js +2 -2
  263. package/plugins/image.js.map +1 -1
  264. package/plugins/index.d.ts +3 -3
  265. package/plugins/index.js +1 -1
  266. package/plugins/index.js.map +1 -1
  267. package/presentation/localStorage/index.d.ts +3 -0
  268. package/presentation/localStorage/index.js +5 -0
  269. package/presentation/localStorage/index.js.map +1 -0
  270. package/presentation/localStorage/useLocalStorage.d.ts +6 -0
  271. package/presentation/localStorage/useLocalStorage.js +21 -0
  272. package/presentation/localStorage/useLocalStorage.js.map +1 -0
  273. package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
  274. package/presentation/localStorage/useLocalStorageValue.js +20 -0
  275. package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
  276. package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
  277. package/presentation/localStorage/useLocalStorageValues.js +39 -0
  278. package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
  279. package/presentation/router/RouteElementRegistry.d.ts +14 -0
  280. package/presentation/router/RouteElementRegistry.js +32 -0
  281. package/presentation/router/RouteElementRegistry.js.map +1 -0
  282. package/presentation/router/abstractions.d.ts +13 -0
  283. package/presentation/router/abstractions.js +4 -0
  284. package/presentation/router/abstractions.js.map +1 -0
  285. package/presentation/router/components/Redirect.d.ts +14 -0
  286. package/presentation/router/components/Redirect.js +15 -0
  287. package/presentation/router/components/Redirect.js.map +1 -0
  288. package/presentation/router/components/RouteContent.d.ts +2 -0
  289. package/presentation/router/components/RouteContent.js +17 -0
  290. package/presentation/router/components/RouteContent.js.map +1 -0
  291. package/presentation/router/components/RouteLink.d.ts +50 -0
  292. package/presentation/router/components/RouteLink.js +22 -0
  293. package/presentation/router/components/RouteLink.js.map +1 -0
  294. package/presentation/router/components/SimpleLink.d.ts +44 -0
  295. package/presentation/router/components/SimpleLink.js +30 -0
  296. package/presentation/router/components/SimpleLink.js.map +1 -0
  297. package/presentation/router/hooks/useRoute.d.ts +6 -0
  298. package/presentation/router/hooks/useRoute.js +30 -0
  299. package/presentation/router/hooks/useRoute.js.map +1 -0
  300. package/presentation/router/hooks/useRouter.d.ts +7 -0
  301. package/presentation/router/hooks/useRouter.js +26 -0
  302. package/presentation/router/hooks/useRouter.js.map +1 -0
  303. package/presentation/router/index.d.ts +4 -0
  304. package/presentation/router/index.js +5 -0
  305. package/presentation/router/index.js.map +1 -0
  306. package/presentation/router/types.d.ts +5 -0
  307. package/presentation/router/types.js +3 -0
  308. package/presentation/router/types.js.map +1 -0
  309. package/react-butterfiles/Files.js +3 -3
  310. package/react-butterfiles/Files.js.map +1 -1
  311. package/react-butterfiles/file.todo +1 -0
  312. package/react-butterfiles/index.d.ts +1 -1
  313. package/react-butterfiles/index.js +1 -1
  314. package/react-butterfiles/index.js.map +1 -1
  315. package/router.d.ts +5 -0
  316. package/router.js +8 -0
  317. package/router.js.map +1 -0
  318. package/shared/di/DiContainerProvider.d.ts +8 -0
  319. package/shared/di/DiContainerProvider.js +17 -0
  320. package/shared/di/DiContainerProvider.js.map +1 -0
  321. package/shared/di/createFeature.d.ts +11 -0
  322. package/shared/di/createFeature.js +11 -0
  323. package/shared/di/createFeature.js.map +1 -0
  324. package/shared/di/useFeature.d.ts +2 -0
  325. package/shared/di/useFeature.js +18 -0
  326. package/shared/di/useFeature.js.map +1 -0
  327. package/types.d.ts +7 -4
  328. package/types.js +1 -12
  329. package/types.js.map +1 -1
  330. package/utils/index.d.ts +2 -10
  331. package/utils/index.js +2 -10
  332. package/utils/index.js.map +1 -1
  333. package/utils/legacyPluginToReactComponent.js +1 -1
  334. package/utils/legacyPluginToReactComponent.js.map +1 -1
  335. package/components/Routes.d.ts +0 -2
  336. package/components/Routes.js +0 -36
  337. package/components/Routes.js.map +0 -1
  338. package/components/View.d.ts +0 -8
  339. package/components/View.js +0 -19
  340. package/components/View.js.map +0 -1
  341. package/core/DebounceRender.d.ts +0 -12
  342. package/core/DebounceRender.js +0 -31
  343. package/core/DebounceRender.js.map +0 -1
  344. package/core/Routes.d.ts +0 -6
  345. package/core/Routes.js +0 -34
  346. package/core/Routes.js.map +0 -1
  347. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
  348. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
  349. package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
  350. package/hooks/useDataList/utils/types.d.ts +0 -40
  351. package/hooks/useDataList/utils/types.js.map +0 -1
  352. package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
  353. package/plugins/LocaleHeaderLinkPlugin.js +0 -32
  354. package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
  355. package/plugins/RoutePlugin.d.ts +0 -12
  356. package/plugins/RoutePlugin.js +0 -16
  357. package/plugins/RoutePlugin.js.map +0 -1
  358. package/plugins/ViewPlugin.d.ts +0 -14
  359. package/plugins/ViewPlugin.js +0 -19
  360. package/plugins/ViewPlugin.js.map +0 -1
  361. package/utils/getApiUrl.d.ts +0 -1
  362. package/utils/getApiUrl.js +0 -5
  363. package/utils/getApiUrl.js.map +0 -1
  364. package/utils/getGqlApiUrl.d.ts +0 -1
  365. package/utils/getGqlApiUrl.js +0 -6
  366. package/utils/getGqlApiUrl.js.map +0 -1
  367. package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
  368. package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
  369. package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
  370. package/utils/getLocaleCode.d.ts +0 -6
  371. package/utils/getLocaleCode.js +0 -33
  372. package/utils/getLocaleCode.js.map +0 -1
  373. package/utils/getPrerenderId.d.ts +0 -6
  374. package/utils/getPrerenderId.js +0 -5
  375. package/utils/getPrerenderId.js.map +0 -1
  376. package/utils/getTenantId.d.ts +0 -6
  377. package/utils/getTenantId.js +0 -45
  378. package/utils/getTenantId.js.map +0 -1
  379. package/utils/isLocalhost.d.ts +0 -1
  380. package/utils/isLocalhost.js +0 -7
  381. package/utils/isLocalhost.js.map +0 -1
  382. package/utils/isPrerendering.d.ts +0 -1
  383. package/utils/isPrerendering.js +0 -5
  384. package/utils/isPrerendering.js.map +0 -1
  385. /package/{hooks/useDataList/utils → features/graphqlClient}/types.js +0 -0
@@ -0,0 +1,15 @@
1
+ import { BaseEvent } from "../features/eventPublisher/index.js";
2
+ export interface NetworkErrorPayload {
3
+ message: string;
4
+ code?: string;
5
+ operationName?: string;
6
+ query?: string;
7
+ variables?: Record<string, any>;
8
+ errorType: "network" | "timeout" | "fetch" | "unknown";
9
+ statusCode?: number;
10
+ result?: any;
11
+ }
12
+ export declare class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {
13
+ eventType: "network.error";
14
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<NetworkErrorEvent>>;
15
+ }
@@ -0,0 +1,10 @@
1
+ import { NetworkErrorEventHandler } from "./abstractions.js";
2
+ import { BaseEvent } from "../features/eventPublisher/index.js";
3
+ export class NetworkErrorEvent extends BaseEvent {
4
+ eventType = "network.error";
5
+ getHandlerAbstraction() {
6
+ return NetworkErrorEventHandler;
7
+ }
8
+ }
9
+
10
+ //# sourceMappingURL=NetworkErrorEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NetworkErrorEventHandler","BaseEvent","NetworkErrorEvent","eventType","getHandlerAbstraction"],"sources":["NetworkErrorEvent.ts"],"sourcesContent":["import { NetworkErrorEventHandler } from \"./abstractions.js\";\nimport { BaseEvent } from \"~/features/eventPublisher/index.js\";\n\nexport interface NetworkErrorPayload {\n message: string;\n code?: string;\n operationName?: string;\n query?: string;\n variables?: Record<string, any>;\n errorType: \"network\" | \"timeout\" | \"fetch\" | \"unknown\";\n statusCode?: number;\n result?: any;\n}\n\nexport class NetworkErrorEvent extends BaseEvent<NetworkErrorPayload> {\n eventType = \"network.error\" as const;\n\n getHandlerAbstraction() {\n return NetworkErrorEventHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,wBAAwB;AACjC,SAASC,SAAS;AAalB,OAAO,MAAMC,iBAAiB,SAASD,SAAS,CAAsB;EAClEE,SAAS,GAAG,eAAe;EAE3BC,qBAAqBA,CAAA,EAAG;IACpB,OAAOJ,wBAAwB;EACnC;AACJ","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import type { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ import type { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
3
+ import type { IEventHandler } from "../features/eventPublisher/index.js";
4
+ export declare const NetworkErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<NetworkErrorEvent>>;
5
+ export declare namespace NetworkErrorEventHandler {
6
+ type Interface = IEventHandler<NetworkErrorEvent>;
7
+ }
8
+ export declare const AuthenticationErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<AuthenticationErrorEvent>>;
9
+ export declare namespace AuthenticationErrorEventHandler {
10
+ type Interface = IEventHandler<AuthenticationErrorEvent>;
11
+ type Event = AuthenticationErrorEvent;
12
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ export const NetworkErrorEventHandler = createAbstraction("NetworkErrorEventHandler");
3
+ export const AuthenticationErrorEventHandler = createAbstraction("AuthenticationErrorEventHandler");
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","NetworkErrorEventHandler","AuthenticationErrorEventHandler"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { NetworkErrorEvent } from \"./NetworkErrorEvent.js\";\nimport type { AuthenticationErrorEvent } from \"./AuthenticationErrorEvent.js\";\nimport type { IEventHandler } from \"~/features/eventPublisher/index.js\";\n\nexport const NetworkErrorEventHandler = createAbstraction<IEventHandler<NetworkErrorEvent>>(\n \"NetworkErrorEventHandler\"\n);\n\nexport namespace NetworkErrorEventHandler {\n export type Interface = IEventHandler<NetworkErrorEvent>;\n}\n\nexport const AuthenticationErrorEventHandler = createAbstraction<\n IEventHandler<AuthenticationErrorEvent>\n>(\"AuthenticationErrorEventHandler\");\n\nexport namespace AuthenticationErrorEventHandler {\n export type Interface = IEventHandler<AuthenticationErrorEvent>;\n export type Event = AuthenticationErrorEvent;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;AAKzD,OAAO,MAAMC,wBAAwB,GAAGD,iBAAiB,CACrD,0BACJ,CAAC;AAMD,OAAO,MAAME,+BAA+B,GAAGF,iBAAiB,CAE9D,iCAAiC,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ export { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ export type { NetworkErrorPayload } from "./NetworkErrorEvent.js";
3
+ export { NetworkErrorEventHandler } from "./abstractions.js";
4
+ export { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
5
+ export type { AuthenticationErrorPayload } from "./AuthenticationErrorEvent.js";
6
+ export { AuthenticationErrorEventHandler } from "./abstractions.js";
@@ -0,0 +1,6 @@
1
+ export { NetworkErrorEvent } from "./NetworkErrorEvent.js";
2
+ export { NetworkErrorEventHandler } from "./abstractions.js";
3
+ export { AuthenticationErrorEvent } from "./AuthenticationErrorEvent.js";
4
+ export { AuthenticationErrorEventHandler } from "./abstractions.js";
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NetworkErrorEvent","NetworkErrorEventHandler","AuthenticationErrorEvent","AuthenticationErrorEventHandler"],"sources":["index.ts"],"sourcesContent":["export { NetworkErrorEvent } from \"./NetworkErrorEvent.js\";\nexport type { NetworkErrorPayload } from \"./NetworkErrorEvent.js\";\nexport { NetworkErrorEventHandler } from \"./abstractions.js\";\nexport { AuthenticationErrorEvent } from \"./AuthenticationErrorEvent.js\";\nexport type { AuthenticationErrorPayload } from \"./AuthenticationErrorEvent.js\";\nexport { AuthenticationErrorEventHandler } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,SAASC,wBAAwB;AACjC,SAASC,wBAAwB;AAEjC,SAASC,+BAA+B","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { EnvConfig } from "../../features/envConfig/index.js";
@@ -0,0 +1,3 @@
1
+ export { EnvConfig } from "../../features/envConfig/index.js";
2
+
3
+ //# sourceMappingURL=env-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EnvConfig"],"sources":["env-config.ts"],"sourcesContent":["export { EnvConfig } from \"~/features/envConfig/index.js\";\n"],"mappings":"AAAA,SAASA,SAAS","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { GraphQLClient } from "../../features/graphqlClient/abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { GraphQLClient } from "../../features/graphqlClient/abstractions.js";
2
+
3
+ //# sourceMappingURL=graphql-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GraphQLClient"],"sources":["graphql-client.ts"],"sourcesContent":["export { GraphQLClient } from \"~/features/graphqlClient/abstractions.js\";\n"],"mappings":"AAAA,SAASA,aAAa","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { LocalStorage } from "../../features/localStorage/abstractions.js";
2
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "../../presentation/localStorage/index.js";
@@ -0,0 +1,4 @@
1
+ export { LocalStorage } from "../../features/localStorage/abstractions.js";
2
+ export { useLocalStorage, useLocalStorageValue, useLocalStorageValues } from "../../presentation/localStorage/index.js";
3
+
4
+ //# sourceMappingURL=local-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LocalStorage","useLocalStorage","useLocalStorageValue","useLocalStorageValues"],"sources":["local-storage.ts"],"sourcesContent":["export { LocalStorage } from \"~/features/localStorage/abstractions.js\";\nexport {\n useLocalStorage,\n useLocalStorageValue,\n useLocalStorageValues\n} from \"~/presentation/localStorage/index.js\";\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SACIC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export { Route } from "../../features/router/Route.js";
2
+ export { RouteLinkComponent } from "../../presentation/router/components/RouteLink.js";
3
+ export { LinkComponent } from "../../presentation/router/components/SimpleLink.js";
4
+ export { RedirectComponent } from "../../presentation/router/components/Redirect.js";
5
+ export { useRoute, useRouter } from "../../presentation/router/index.js";
@@ -0,0 +1,7 @@
1
+ export { Route } from "../../features/router/Route.js";
2
+ export { RouteLinkComponent } from "../../presentation/router/components/RouteLink.js";
3
+ export { LinkComponent } from "../../presentation/router/components/SimpleLink.js";
4
+ export { RedirectComponent } from "../../presentation/router/components/Redirect.js";
5
+ export { useRoute, useRouter } from "../../presentation/router/index.js";
6
+
7
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Route","RouteLinkComponent","LinkComponent","RedirectComponent","useRoute","useRouter"],"sources":["router.ts"],"sourcesContent":["export { Route } from \"~/features/router/Route.js\";\nexport { RouteLinkComponent } from \"~/presentation/router/components/RouteLink.js\";\nexport { LinkComponent } from \"~/presentation/router/components/SimpleLink.js\";\nexport { RedirectComponent } from \"~/presentation/router/components/Redirect.js\";\nexport { useRoute, useRouter } from \"~/presentation/router/index.js\";\n"],"mappings":"AAAA,SAASA,KAAK;AACd,SAASC,kBAAkB;AAC3B,SAASC,aAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,QAAQ,EAAEC,SAAS","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { AuthenticationErrorEventHandler } from "../../errors/abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { AuthenticationErrorEventHandler } from "../../errors/abstractions.js";
2
+
3
+ //# sourceMappingURL=security.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AuthenticationErrorEventHandler"],"sources":["security.ts"],"sourcesContent":["export { AuthenticationErrorEventHandler } from \"~/errors/abstractions.js\";\n"],"mappings":"AAAA,SAASA,+BAA+B","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ export { useFeature } from "../shared/di/useFeature.js";
2
+ export { NetworkErrorEventHandler } from "../errors/index.js";
3
+ export { createProviderPlugin } from "../core/createProviderPlugin.js";
4
+ export { createProvider } from "../core/createProvider.js";
5
+ export { Provider } from "../core/Provider.js";
6
+ export { Plugin } from "../core/Plugin.js";
@@ -0,0 +1,8 @@
1
+ export { useFeature } from "../shared/di/useFeature.js";
2
+ export { NetworkErrorEventHandler } from "../errors/index.js";
3
+ export { createProviderPlugin } from "../core/createProviderPlugin.js";
4
+ export { createProvider } from "../core/createProvider.js";
5
+ export { Provider } from "../core/Provider.js";
6
+ export { Plugin } from "../core/Plugin.js";
7
+
8
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useFeature","NetworkErrorEventHandler","createProviderPlugin","createProvider","Provider","Plugin"],"sources":["admin.ts"],"sourcesContent":["export { useFeature } from \"~/shared/di/useFeature.js\";\nexport { NetworkErrorEventHandler } from \"~/errors/index.js\";\nexport { createProviderPlugin } from \"~/core/createProviderPlugin.js\";\nexport { createProvider } from \"~/core/createProvider.js\";\nexport { Provider } from \"~/core/Provider.js\";\nexport { Plugin } from \"~/core/Plugin.js\";\n"],"mappings":"AAAA,SAASA,UAAU;AACnB,SAASC,wBAAwB;AACjC,SAASC,oBAAoB;AAC7B,SAASC,cAAc;AACvB,SAASC,QAAQ;AACjB,SAASC,MAAM","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { EnvConfig as Abstraction } from "./abstractions.js";
2
+ export declare class DefaultEnvConfig implements Abstraction.Interface {
3
+ private readonly env;
4
+ constructor(env: Abstraction.Config);
5
+ get<K extends keyof Abstraction.Config>(key: K, defaultValue?: Abstraction.Config[K]): Abstraction.Config[K];
6
+ }
@@ -0,0 +1,14 @@
1
+ export class DefaultEnvConfig {
2
+ constructor(env) {
3
+ this.env = env;
4
+ }
5
+ get(key, defaultValue) {
6
+ const rawValue = this.env[key];
7
+ if ((rawValue === undefined || rawValue === null) && defaultValue !== undefined) {
8
+ return defaultValue;
9
+ }
10
+ return rawValue;
11
+ }
12
+ }
13
+
14
+ //# sourceMappingURL=EnvConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DefaultEnvConfig","constructor","env","get","key","defaultValue","rawValue","undefined"],"sources":["EnvConfig.ts"],"sourcesContent":["import { EnvConfig as Abstraction } from \"./abstractions.js\";\n\nexport class DefaultEnvConfig implements Abstraction.Interface {\n private readonly env: Abstraction.Config;\n\n constructor(env: Abstraction.Config) {\n this.env = env;\n }\n\n public get<K extends keyof Abstraction.Config>(\n key: K,\n defaultValue?: Abstraction.Config[K]\n ): Abstraction.Config[K] {\n const rawValue = this.env[key];\n\n if ((rawValue === undefined || rawValue === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return rawValue;\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,CAAkC;EAG3DC,WAAWA,CAACC,GAAuB,EAAE;IACjC,IAAI,CAACA,GAAG,GAAGA,GAAG;EAClB;EAEOC,GAAGA,CACNC,GAAM,EACNC,YAAoC,EACf;IACrB,MAAMC,QAAQ,GAAG,IAAI,CAACJ,GAAG,CAACE,GAAG,CAAC;IAE9B,IAAI,CAACE,QAAQ,KAAKC,SAAS,IAAID,QAAQ,KAAK,IAAI,KAAKD,YAAY,KAAKE,SAAS,EAAE;MAC7E,OAAOF,YAAY;IACvB;IAEA,OAAOC,QAAQ;EACnB;AACJ","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ import { Abstraction } from "@webiny/di";
2
+ type Env = {
3
+ apiUrl: string;
4
+ debug: boolean;
5
+ deploymentId: string;
6
+ graphqlApiUrl: string;
7
+ telemetryEnabled: boolean;
8
+ telemetryUserId: string | undefined;
9
+ trashBinRetentionPeriodDays: number;
10
+ wcpProjectId: string | undefined;
11
+ websocketUrl: string;
12
+ graphqlClient?: {
13
+ retries: {
14
+ maxRetries: number;
15
+ delayInMillis: number;
16
+ };
17
+ };
18
+ };
19
+ export interface IEnvConfig {
20
+ get<K extends keyof Env>(key: K, defaultValue?: Env[K]): Env[K];
21
+ }
22
+ export declare const EnvConfig: Abstraction<IEnvConfig>;
23
+ export declare namespace EnvConfig {
24
+ type Interface = IEnvConfig;
25
+ type Config = Env;
26
+ }
27
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Abstraction } from "@webiny/di";
2
+ export const EnvConfig = new Abstraction("EnvConfig");
3
+
4
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Abstraction","EnvConfig"],"sources":["abstractions.ts"],"sourcesContent":["import { Abstraction } from \"@webiny/di\";\n\ntype Env = {\n apiUrl: string;\n debug: boolean;\n deploymentId: string;\n graphqlApiUrl: string;\n telemetryEnabled: boolean;\n telemetryUserId: string | undefined;\n trashBinRetentionPeriodDays: number;\n wcpProjectId: string | undefined;\n websocketUrl: string;\n graphqlClient?: {\n retries: {\n maxRetries: number;\n delayInMillis: number;\n };\n };\n};\n\nexport interface IEnvConfig {\n get<K extends keyof Env>(key: K, defaultValue?: Env[K]): Env[K];\n}\n\nexport const EnvConfig = new Abstraction<IEnvConfig>(\"EnvConfig\");\n\nexport namespace EnvConfig {\n export type Interface = IEnvConfig;\n export type Config = Env;\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,YAAY;AAwBxC,OAAO,MAAMC,SAAS,GAAG,IAAID,WAAW,CAAa,WAAW,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ export declare const EnvConfigFeature: import("~/shared/di/createFeature.js").FeatureDefinition<import("./abstractions.js").IEnvConfig, [params: {
2
+ apiUrl: string;
3
+ debug: boolean;
4
+ deploymentId: string;
5
+ graphqlApiUrl: string;
6
+ telemetryEnabled: boolean;
7
+ telemetryUserId: string | undefined;
8
+ trashBinRetentionPeriodDays: number;
9
+ wcpProjectId: string | undefined;
10
+ websocketUrl: string;
11
+ graphqlClient?: {
12
+ retries: {
13
+ maxRetries: number;
14
+ delayInMillis: number;
15
+ };
16
+ };
17
+ }]>;
@@ -0,0 +1,14 @@
1
+ import { EnvConfig } from "./abstractions.js";
2
+ import { DefaultEnvConfig } from "./EnvConfig.js";
3
+ import { createFeature } from "../../shared/di/createFeature.js";
4
+ export const EnvConfigFeature = createFeature({
5
+ name: "EnvConfig",
6
+ register(container, params) {
7
+ container.registerInstance(EnvConfig, new DefaultEnvConfig(params));
8
+ },
9
+ resolve(container) {
10
+ return container.resolve(EnvConfig);
11
+ }
12
+ });
13
+
14
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EnvConfig","DefaultEnvConfig","createFeature","EnvConfigFeature","name","register","container","params","registerInstance","resolve"],"sources":["feature.ts"],"sourcesContent":["import { EnvConfig } from \"./abstractions.js\";\nimport { DefaultEnvConfig } from \"./EnvConfig.js\";\nimport { createFeature } from \"~/shared/di/createFeature.js\";\n\nexport const EnvConfigFeature = createFeature({\n name: \"EnvConfig\",\n register(container, params: EnvConfig.Config) {\n container.registerInstance(EnvConfig, new DefaultEnvConfig(params));\n },\n resolve(container) {\n return container.resolve(EnvConfig);\n }\n});\n"],"mappings":"AAAA,SAASA,SAAS;AAClB,SAASC,gBAAgB;AACzB,SAASC,aAAa;AAEtB,OAAO,MAAMC,gBAAgB,GAAGD,aAAa,CAAC;EAC1CE,IAAI,EAAE,WAAW;EACjBC,QAAQA,CAACC,SAAS,EAAEC,MAAwB,EAAE;IAC1CD,SAAS,CAACE,gBAAgB,CAACR,SAAS,EAAE,IAAIC,gBAAgB,CAACM,MAAM,CAAC,CAAC;EACvE,CAAC;EACDE,OAAOA,CAACH,SAAS,EAAE;IACf,OAAOA,SAAS,CAACG,OAAO,CAACT,SAAS,CAAC;EACvC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { EnvConfig } from "./abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { EnvConfig } from "./abstractions.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EnvConfig"],"sources":["index.ts"],"sourcesContent":["export { EnvConfig } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,SAAS","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import type { Container } from "@webiny/di";
2
+ import { EventPublisher as Abstraction, BaseEvent } from "./abstractions.js";
3
+ export declare class EventPublisher implements Abstraction.Interface {
4
+ private container;
5
+ constructor(container: Container);
6
+ publish<TEvent extends BaseEvent>(event: TEvent): Promise<void>;
7
+ private logEvent;
8
+ }
@@ -0,0 +1,27 @@
1
+ import { EnvConfig } from "../envConfig/index.js";
2
+ export class EventPublisher {
3
+ constructor(container) {
4
+ this.container = container;
5
+ }
6
+ async publish(event) {
7
+ this.logEvent(event);
8
+ // Get handler abstraction from the event itself
9
+ const handlerAbstraction = event.getHandlerAbstraction();
10
+
11
+ // Resolve ALL implementations of that abstraction
12
+ const handlers = this.container.resolveAll(handlerAbstraction);
13
+
14
+ // Execute all handlers
15
+ for (const handler of handlers) {
16
+ await handler.handle(event);
17
+ }
18
+ }
19
+ logEvent(event) {
20
+ const envConfig = this.container.resolve(EnvConfig);
21
+ if (envConfig.get("debug")) {
22
+ console.log(`[EventPublisher] Publishing event "${event.eventType}".`, event.payload);
23
+ }
24
+ }
25
+ }
26
+
27
+ //# sourceMappingURL=EventPublisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EnvConfig","EventPublisher","constructor","container","publish","event","logEvent","handlerAbstraction","getHandlerAbstraction","handlers","resolveAll","handler","handle","envConfig","resolve","get","console","log","eventType","payload"],"sources":["EventPublisher.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { EventPublisher as Abstraction, BaseEvent } from \"./abstractions.js\";\nimport { EnvConfig } from \"~/features/envConfig/index.js\";\n\nexport class EventPublisher implements Abstraction.Interface {\n constructor(private container: Container) {}\n\n async publish<TEvent extends BaseEvent>(event: TEvent): Promise<void> {\n this.logEvent(event);\n // Get handler abstraction from the event itself\n const handlerAbstraction = event.getHandlerAbstraction();\n\n // Resolve ALL implementations of that abstraction\n const handlers = this.container.resolveAll(handlerAbstraction);\n\n // Execute all handlers\n for (const handler of handlers) {\n await handler.handle(event);\n }\n }\n\n private logEvent(event: BaseEvent) {\n const envConfig = this.container.resolve(EnvConfig);\n if (envConfig.get(\"debug\")) {\n console.log(`[EventPublisher] Publishing event \"${event.eventType}\".`, event.payload);\n }\n }\n}\n"],"mappings":"AAEA,SAASA,SAAS;AAElB,OAAO,MAAMC,cAAc,CAAkC;EACzDC,WAAWA,CAASC,SAAoB,EAAE;IAAA,KAAtBA,SAAoB,GAApBA,SAAoB;EAAG;EAE3C,MAAMC,OAAOA,CAA2BC,KAAa,EAAiB;IAClE,IAAI,CAACC,QAAQ,CAACD,KAAK,CAAC;IACpB;IACA,MAAME,kBAAkB,GAAGF,KAAK,CAACG,qBAAqB,CAAC,CAAC;;IAExD;IACA,MAAMC,QAAQ,GAAG,IAAI,CAACN,SAAS,CAACO,UAAU,CAACH,kBAAkB,CAAC;;IAE9D;IACA,KAAK,MAAMI,OAAO,IAAIF,QAAQ,EAAE;MAC5B,MAAME,OAAO,CAACC,MAAM,CAACP,KAAK,CAAC;IAC/B;EACJ;EAEQC,QAAQA,CAACD,KAAgB,EAAE;IAC/B,MAAMQ,SAAS,GAAG,IAAI,CAACV,SAAS,CAACW,OAAO,CAACd,SAAS,CAAC;IACnD,IAAIa,SAAS,CAACE,GAAG,CAAC,OAAO,CAAC,EAAE;MACxBC,OAAO,CAACC,GAAG,CAAC,sCAAsCZ,KAAK,CAACa,SAAS,IAAI,EAAEb,KAAK,CAACc,OAAO,CAAC;IACzF;EACJ;AACJ","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import type { Abstraction } from "@webiny/di";
2
+ export declare abstract class BaseEvent<TPayload = void> {
3
+ abstract readonly eventType: string;
4
+ readonly occurredAt: Date;
5
+ readonly payload: TPayload extends void ? undefined : TPayload;
6
+ constructor(payload: TPayload);
7
+ abstract getHandlerAbstraction(): Abstraction<IEventHandler<any>>;
8
+ }
9
+ export interface IEventHandler<TEvent extends BaseEvent<any> = BaseEvent<any>> {
10
+ handle(event: TEvent): Promise<void>;
11
+ }
12
+ export interface IEventPublisher {
13
+ publish<TEvent extends BaseEvent<any>>(event: TEvent): Promise<void>;
14
+ }
15
+ export declare const EventPublisher: Abstraction<IEventPublisher>;
16
+ export declare namespace EventPublisher {
17
+ type Interface = IEventPublisher;
18
+ }
@@ -0,0 +1,14 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ export class BaseEvent {
3
+ constructor(payload) {
4
+ this.occurredAt = new Date();
5
+ if (payload === undefined) {
6
+ this.payload = undefined;
7
+ } else {
8
+ this.payload = payload;
9
+ }
10
+ }
11
+ }
12
+ export const EventPublisher = createAbstraction("EventPublisher");
13
+
14
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","BaseEvent","constructor","payload","occurredAt","Date","undefined","EventPublisher"],"sources":["abstractions.ts"],"sourcesContent":["import type { Abstraction } from \"@webiny/di\";\nimport { createAbstraction } from \"@webiny/feature/admin\";\n\nexport abstract class BaseEvent<TPayload = void> {\n public abstract readonly eventType: string;\n public readonly occurredAt: Date;\n public readonly payload: TPayload extends void ? undefined : TPayload;\n\n constructor(payload: TPayload);\n constructor(payload?: never) {\n this.occurredAt = new Date();\n\n if (payload === undefined) {\n this.payload = undefined as any;\n } else {\n this.payload = payload;\n }\n }\n\n abstract getHandlerAbstraction(): Abstraction<IEventHandler<any>>;\n}\n\nexport interface IEventHandler<TEvent extends BaseEvent<any> = BaseEvent<any>> {\n handle(event: TEvent): Promise<void>;\n}\n\nexport interface IEventPublisher {\n publish<TEvent extends BaseEvent<any>>(event: TEvent): Promise<void>;\n}\n\nexport const EventPublisher = createAbstraction<IEventPublisher>(\"EventPublisher\");\n\nexport namespace EventPublisher {\n export type Interface = IEventPublisher;\n}\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,uBAAuB;AAEzD,OAAO,MAAeC,SAAS,CAAkB;EAM7CC,WAAWA,CAACC,OAAe,EAAE;IACzB,IAAI,CAACC,UAAU,GAAG,IAAIC,IAAI,CAAC,CAAC;IAE5B,IAAIF,OAAO,KAAKG,SAAS,EAAE;MACvB,IAAI,CAACH,OAAO,GAAGG,SAAgB;IACnC,CAAC,MAAM;MACH,IAAI,CAACH,OAAO,GAAGA,OAAO;IAC1B;EACJ;AAGJ;AAUA,OAAO,MAAMI,cAAc,GAAGP,iBAAiB,CAAkB,gBAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const EventPublisherFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { EventPublisher as EventPublisherAbstraction } from "./abstractions.js";
3
+ import { EventPublisher } from "./EventPublisher.js";
4
+ export const EventPublisherFeature = createFeature({
5
+ name: "EventPublisher",
6
+ register(container) {
7
+ container.registerInstance(EventPublisherAbstraction, new EventPublisher(container));
8
+ }
9
+ });
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","EventPublisher","EventPublisherAbstraction","EventPublisherFeature","name","register","container","registerInstance"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\nimport { EventPublisher as EventPublisherAbstraction } from \"./abstractions.js\";\nimport { EventPublisher } from \"./EventPublisher.js\";\n\nexport const EventPublisherFeature = createFeature({\n name: \"EventPublisher\",\n register(container: Container) {\n container.registerInstance(EventPublisherAbstraction, new EventPublisher(container));\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AAErD,SAASC,cAAc,IAAIC,yBAAyB;AACpD,SAASD,cAAc;AAEvB,OAAO,MAAME,qBAAqB,GAAGH,aAAa,CAAC;EAC/CI,IAAI,EAAE,gBAAgB;EACtBC,QAAQA,CAACC,SAAoB,EAAE;IAC3BA,SAAS,CAACC,gBAAgB,CAACL,yBAAyB,EAAE,IAAID,cAAc,CAACK,SAAS,CAAC,CAAC;EACxF;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export { EventPublisher, BaseEvent } from "./abstractions.js";
2
+ export type { IEventHandler, IEventPublisher } from "./abstractions.js";
3
+ export { EventPublisherFeature } from "./feature.js";
@@ -0,0 +1,4 @@
1
+ export { EventPublisher, BaseEvent } from "./abstractions.js";
2
+ export { EventPublisherFeature } from "./feature.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EventPublisher","BaseEvent","EventPublisherFeature"],"sources":["index.ts"],"sourcesContent":["export { EventPublisher, BaseEvent } from \"./abstractions.js\";\nexport type { IEventHandler, IEventPublisher } from \"./abstractions.js\";\nexport { EventPublisherFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,SAAS;AAElC,SAASC,qBAAqB","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EventPublisher } from "../../features/eventPublisher/index.js";
3
+ declare class AuthenticationErrorPublishingDecorator 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 isAuthenticationError;
9
+ }
10
+ export declare const AuthenticationErrorPublishing: typeof AuthenticationErrorPublishingDecorator & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGraphQLClient>;
12
+ };
13
+ export {};
@@ -0,0 +1,35 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EventPublisher } from "../eventPublisher/index.js";
3
+ import { AuthenticationErrorEvent } from "../../errors/index.js";
4
+ class AuthenticationErrorPublishingDecorator {
5
+ constructor(eventPublisher, decoratee) {
6
+ this.eventPublisher = eventPublisher;
7
+ this.decoratee = decoratee;
8
+ }
9
+ async execute(params) {
10
+ try {
11
+ return await this.decoratee.execute(params);
12
+ } catch (error) {
13
+ // Only publish authentication errors
14
+ if (this.isAuthenticationError(error)) {
15
+ const event = new AuthenticationErrorEvent({
16
+ message: error.message,
17
+ code: error.code
18
+ });
19
+ await this.eventPublisher.publish(event);
20
+ }
21
+
22
+ // Re-throw to preserve existing behavior
23
+ throw error;
24
+ }
25
+ }
26
+ isAuthenticationError(error) {
27
+ return error.code?.startsWith("Authentication/") ?? false;
28
+ }
29
+ }
30
+ export const AuthenticationErrorPublishing = GraphQLClient.createDecorator({
31
+ decorator: AuthenticationErrorPublishingDecorator,
32
+ dependencies: [EventPublisher]
33
+ });
34
+
35
+ //# sourceMappingURL=AuthenticationErrorPublishing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GraphQLClient","EventPublisher","AuthenticationErrorEvent","AuthenticationErrorPublishingDecorator","constructor","eventPublisher","decoratee","execute","params","error","isAuthenticationError","event","message","code","publish","startsWith","AuthenticationErrorPublishing","createDecorator","decorator","dependencies"],"sources":["AuthenticationErrorPublishing.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/admin\";\nimport { GraphQLClient } from \"./abstractions.js\";\nimport { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { AuthenticationErrorEvent } from \"~/errors/index.js\";\n\nclass AuthenticationErrorPublishingDecorator 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 authentication errors\n if (this.isAuthenticationError(error as BaseError)) {\n const event = new AuthenticationErrorEvent({\n message: (error as Error).message,\n code: (error as BaseError).code\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 isAuthenticationError(error: BaseError): boolean {\n return error.code?.startsWith(\"Authentication/\") ?? false;\n }\n}\n\nexport const AuthenticationErrorPublishing = GraphQLClient.createDecorator({\n decorator: AuthenticationErrorPublishingDecorator,\n dependencies: [EventPublisher]\n});\n"],"mappings":"AACA,SAASA,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,wBAAwB;AAEjC,MAAMC,sCAAsC,CAAoC;EAC5EC,WAAWA,CACCC,cAAwC,EACxCC,SAAkC,EAC5C;IAAA,KAFUD,cAAwC,GAAxCA,cAAwC;IAAA,KACxCC,SAAkC,GAAlCA,SAAkC;EAC3C;EAEH,MAAMC,OAAOA,CACTC,MAAyC,EACzB;IAChB,IAAI;MACA,OAAO,MAAM,IAAI,CAACF,SAAS,CAACC,OAAO,CAACC,MAAM,CAAC;IAC/C,CAAC,CAAC,OAAOC,KAAK,EAAE;MACZ;MACA,IAAI,IAAI,CAACC,qBAAqB,CAACD,KAAkB,CAAC,EAAE;QAChD,MAAME,KAAK,GAAG,IAAIT,wBAAwB,CAAC;UACvCU,OAAO,EAAGH,KAAK,CAAWG,OAAO;UACjCC,IAAI,EAAGJ,KAAK,CAAeI;QAC/B,CAAC,CAAC;QAEF,MAAM,IAAI,CAACR,cAAc,CAACS,OAAO,CAACH,KAAK,CAAC;MAC5C;;MAEA;MACA,MAAMF,KAAK;IACf;EACJ;EAEQC,qBAAqBA,CAACD,KAAgB,EAAW;IACrD,OAAOA,KAAK,CAACI,IAAI,EAAEE,UAAU,CAAC,iBAAiB,CAAC,IAAI,KAAK;EAC7D;AACJ;AAEA,OAAO,MAAMC,6BAA6B,GAAGhB,aAAa,CAACiB,eAAe,CAAC;EACvEC,SAAS,EAAEf,sCAAsC;EACjDgB,YAAY,EAAE,CAAClB,cAAc;AACjC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import { GraphQLClient } from "./abstractions.js";
2
+ import { EnvConfig } from "../../features/envConfig/index.js";
3
+ declare class BatchingGraphQLClientImpl implements GraphQLClient.Interface {
4
+ private envConfig;
5
+ private decoratee;
6
+ private queue;
7
+ private batchTimeout;
8
+ private readonly batchWindowMs;
9
+ private readonly maxBatchSize;
10
+ constructor(envConfig: EnvConfig.Interface, decoratee: GraphQLClient.Interface);
11
+ execute<TVariables = any, TResult = any>(params: GraphQLClient.Request<TVariables>): Promise<TResult>;
12
+ private flush;
13
+ private executeBatchGroup;
14
+ private serializeHeaders;
15
+ private executeBatch;
16
+ }
17
+ export declare const BatchingGraphQLClient: typeof BatchingGraphQLClientImpl;
18
+ export {};