@webiny/app 6.3.0 → 6.4.0-beta.1

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 (281) hide show
  1. package/App.js +70 -77
  2. package/App.js.map +1 -1
  3. package/AppContainer.js +3 -6
  4. package/AppContainer.js.map +1 -1
  5. package/apollo-client/InMemoryCache.js +11 -13
  6. package/apollo-client/InMemoryCache.js.map +1 -1
  7. package/apollo-client/IntrospectionFragmentMatcher.js +26 -38
  8. package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
  9. package/components/Image.js +11 -17
  10. package/components/Image.js.map +1 -1
  11. package/components/index.js +0 -2
  12. package/config/RouterConfig/Route.js +23 -28
  13. package/config/RouterConfig/Route.js.map +1 -1
  14. package/config/RouterConfig.js +11 -10
  15. package/config/RouterConfig.js.map +1 -1
  16. package/config.js +19 -20
  17. package/config.js.map +1 -1
  18. package/contexts/Ui/index.js +26 -28
  19. package/contexts/Ui/index.js.map +1 -1
  20. package/core/Plugin.js +7 -9
  21. package/core/Plugin.js.map +1 -1
  22. package/core/Plugins.js +15 -34
  23. package/core/Plugins.js.map +1 -1
  24. package/core/Provider.js +5 -13
  25. package/core/Provider.js.map +1 -1
  26. package/core/createProvider.js +3 -6
  27. package/core/createProvider.js.map +1 -1
  28. package/core/createProviderPlugin.js +8 -13
  29. package/core/createProviderPlugin.js.map +1 -1
  30. package/errors/AuthenticationErrorEvent.js +8 -5
  31. package/errors/AuthenticationErrorEvent.js.map +1 -1
  32. package/errors/NetworkErrorEvent.js +8 -5
  33. package/errors/NetworkErrorEvent.js.map +1 -1
  34. package/errors/abstractions.js +3 -2
  35. package/errors/abstractions.js.map +1 -1
  36. package/errors/index.js +1 -4
  37. package/exports/admin/env-config.js +0 -2
  38. package/exports/admin/graphql-client.js +0 -2
  39. package/exports/admin/local-storage.js +0 -2
  40. package/exports/admin/router.js +0 -2
  41. package/exports/admin/security.js +0 -2
  42. package/exports/admin.js +0 -2
  43. package/features/envConfig/EnvConfig.js +12 -13
  44. package/features/envConfig/EnvConfig.js.map +1 -1
  45. package/features/envConfig/abstractions.js +2 -1
  46. package/features/envConfig/abstractions.js.map +1 -1
  47. package/features/envConfig/feature.js +9 -8
  48. package/features/envConfig/feature.js.map +1 -1
  49. package/features/envConfig/index.js +0 -2
  50. package/features/eventPublisher/EventPublisher.js +13 -21
  51. package/features/eventPublisher/EventPublisher.js.map +1 -1
  52. package/features/eventPublisher/abstractions.js +7 -9
  53. package/features/eventPublisher/abstractions.js.map +1 -1
  54. package/features/eventPublisher/feature.js +13 -12
  55. package/features/eventPublisher/feature.js.map +1 -1
  56. package/features/eventPublisher/index.js +1 -3
  57. package/features/graphqlClient/AuthenticationErrorPublishing.js +26 -26
  58. package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -1
  59. package/features/graphqlClient/BatchingGraphQLClient.js +104 -149
  60. package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -1
  61. package/features/graphqlClient/FetchGraphQLClient.js +41 -48
  62. package/features/graphqlClient/FetchGraphQLClient.js.map +1 -1
  63. package/features/graphqlClient/NetworkErrorPublishing.js +35 -42
  64. package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -1
  65. package/features/graphqlClient/RequestValue.js +42 -41
  66. package/features/graphqlClient/RequestValue.js.map +1 -1
  67. package/features/graphqlClient/RetryGraphQLClient.js +36 -45
  68. package/features/graphqlClient/RetryGraphQLClient.js.map +1 -1
  69. package/features/graphqlClient/__tests__/GraphQLClient.test.js +383 -356
  70. package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -1
  71. package/features/graphqlClient/abstractions.js +2 -1
  72. package/features/graphqlClient/abstractions.js.map +1 -1
  73. package/features/graphqlClient/feature.js +14 -20
  74. package/features/graphqlClient/feature.js.map +1 -1
  75. package/features/graphqlClient/index.js +0 -2
  76. package/features/graphqlClient/types.js +0 -3
  77. package/features/localStorage/BrowserLocalStorageGateway.js +56 -63
  78. package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -1
  79. package/features/localStorage/LocalStorage.js +27 -24
  80. package/features/localStorage/LocalStorage.js.map +1 -1
  81. package/features/localStorage/LocalStorageRepository.js +75 -88
  82. package/features/localStorage/LocalStorageRepository.js.map +1 -1
  83. package/features/localStorage/abstractions.js +5 -16
  84. package/features/localStorage/abstractions.js.map +1 -1
  85. package/features/localStorage/feature.js +17 -28
  86. package/features/localStorage/feature.js.map +1 -1
  87. package/features/localStorage/index.js +1 -3
  88. package/features/mainGraphQLClient/MainGraphQLClient.js +18 -14
  89. package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -1
  90. package/features/mainGraphQLClient/abstractions.js +2 -1
  91. package/features/mainGraphQLClient/abstractions.js.map +1 -1
  92. package/features/mainGraphQLClient/feature.js +11 -10
  93. package/features/mainGraphQLClient/feature.js.map +1 -1
  94. package/features/mainGraphQLClient/index.js +0 -2
  95. package/features/router/HistoryRouterGateway.js +75 -105
  96. package/features/router/HistoryRouterGateway.js.map +1 -1
  97. package/features/router/HistoryRouterGateway.test.js +184 -193
  98. package/features/router/HistoryRouterGateway.test.js.map +1 -1
  99. package/features/router/Route.js +38 -54
  100. package/features/router/Route.js.map +1 -1
  101. package/features/router/RouteUrl.js +84 -217
  102. package/features/router/RouteUrl.js.map +1 -1
  103. package/features/router/Router.js +67 -124
  104. package/features/router/Router.js.map +1 -1
  105. package/features/router/RouterPresenter.js +44 -49
  106. package/features/router/RouterPresenter.js.map +1 -1
  107. package/features/router/RouterRepository.js +103 -111
  108. package/features/router/RouterRepository.js.map +1 -1
  109. package/features/router/RouterRepository.test.js +119 -150
  110. package/features/router/RouterRepository.test.js.map +1 -1
  111. package/features/router/abstractions.js +4 -14
  112. package/features/router/abstractions.js.map +1 -1
  113. package/features/router/feature.js +13 -12
  114. package/features/router/feature.js.map +1 -1
  115. package/features/router/index.js +1 -3
  116. package/helpers/InterfaceGenerator/date.js +0 -3
  117. package/helpers/InterfaceGenerator/id.js +0 -3
  118. package/helpers/InterfaceGenerator/identity.js +0 -3
  119. package/helpers/InterfaceGenerator/index.js +0 -3
  120. package/helpers/InterfaceGenerator/numeric.js +0 -3
  121. package/helpers/InterfaceGenerator/truthful.js +0 -3
  122. package/hooks/useAutocomplete/index.js +0 -2
  123. package/hooks/useAutocomplete/useAutocomplete.js +12 -15
  124. package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
  125. package/hooks/useDataList/functions/getData.js +2 -1
  126. package/hooks/useDataList/functions/getData.js.map +1 -1
  127. package/hooks/useDataList/functions/getError.js +2 -1
  128. package/hooks/useDataList/functions/getError.js.map +1 -1
  129. package/hooks/useDataList/functions/getMeta.js +2 -1
  130. package/hooks/useDataList/functions/getMeta.js.map +1 -1
  131. package/hooks/useDataList/functions/index.js +0 -2
  132. package/hooks/useDataList/functions/searchDataByKey.js +9 -14
  133. package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
  134. package/hooks/useDataList/index.js +0 -2
  135. package/hooks/useDataList/useDataList.js +131 -152
  136. package/hooks/useDataList/useDataList.js.map +1 -1
  137. package/hooks/useDataList/utils/index.js +0 -2
  138. package/hooks/useDataList/utils/prepareLoadListParams.js +25 -34
  139. package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
  140. package/hooks/useHandler.js +12 -16
  141. package/hooks/useHandler.js.map +1 -1
  142. package/hooks/useHandlers.js +18 -20
  143. package/hooks/useHandlers.js.map +1 -1
  144. package/hooks/useRegisterLegacyPlugin.js +7 -6
  145. package/hooks/useRegisterLegacyPlugin.js.map +1 -1
  146. package/hooks/useUi.js +2 -3
  147. package/hooks/useUi.js.map +1 -1
  148. package/i18n/i18n.js +8 -4
  149. package/i18n/i18n.js.map +1 -1
  150. package/i18n/index.js +0 -2
  151. package/index.js +6 -11
  152. package/package.json +14 -16
  153. package/plugins/AddQuerySelectionPlugin.js +36 -61
  154. package/plugins/AddQuerySelectionPlugin.js.map +1 -1
  155. package/plugins/ApolloCacheObjectIdPlugin.js +12 -11
  156. package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
  157. package/plugins/ApolloDynamicLink.js +20 -22
  158. package/plugins/ApolloDynamicLink.js.map +1 -1
  159. package/plugins/ApolloLinkPlugin.js +16 -15
  160. package/plugins/ApolloLinkPlugin.js.map +1 -1
  161. package/plugins/ConsoleLinkPlugin.js +19 -21
  162. package/plugins/ConsoleLinkPlugin.js.map +1 -1
  163. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +39 -45
  164. package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
  165. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +18 -22
  166. package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -1
  167. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +21 -29
  168. package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -1
  169. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +6 -15
  170. package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
  171. package/plugins/NetworkErrorLinkPlugin/Typography.js +9 -14
  172. package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -1
  173. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
  174. package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
  175. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +11 -18
  176. package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
  177. package/plugins/NetworkErrorLinkPlugin.js +41 -58
  178. package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
  179. package/plugins/OmitTypenameLinkPlugin.js +9 -14
  180. package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
  181. package/plugins/TenantHeaderLinkPlugin.js +23 -32
  182. package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
  183. package/plugins/components/Image.js +8 -15
  184. package/plugins/components/Image.js.map +1 -1
  185. package/plugins/image.js +94 -133
  186. package/plugins/image.js.map +1 -1
  187. package/plugins/index.js +35 -59
  188. package/plugins/index.js.map +1 -1
  189. package/presentation/envConfig/useEnvConfig.js +4 -8
  190. package/presentation/envConfig/useEnvConfig.js.map +1 -1
  191. package/presentation/localStorage/index.js +0 -2
  192. package/presentation/localStorage/useLocalStorage.js +10 -16
  193. package/presentation/localStorage/useLocalStorage.js.map +1 -1
  194. package/presentation/localStorage/useLocalStorageValue.js +15 -13
  195. package/presentation/localStorage/useLocalStorageValue.js.map +1 -1
  196. package/presentation/localStorage/useLocalStorageValues.js +23 -30
  197. package/presentation/localStorage/useLocalStorageValues.js.map +1 -1
  198. package/presentation/router/RouteElementRegistry.js +22 -25
  199. package/presentation/router/RouteElementRegistry.js.map +1 -1
  200. package/presentation/router/abstractions.js +2 -1
  201. package/presentation/router/abstractions.js.map +1 -1
  202. package/presentation/router/components/Redirect.js +8 -10
  203. package/presentation/router/components/Redirect.js.map +1 -1
  204. package/presentation/router/components/RouteContent.js +14 -17
  205. package/presentation/router/components/RouteContent.js.map +1 -1
  206. package/presentation/router/components/RouteLink.js +11 -16
  207. package/presentation/router/components/RouteLink.js.map +1 -1
  208. package/presentation/router/components/SimpleLink.js +18 -24
  209. package/presentation/router/components/SimpleLink.js.map +1 -1
  210. package/presentation/router/hooks/useRoute.js +15 -23
  211. package/presentation/router/hooks/useRoute.js.map +1 -1
  212. package/presentation/router/hooks/useRouter.js +22 -23
  213. package/presentation/router/hooks/useRouter.js.map +1 -1
  214. package/presentation/router/index.js +0 -2
  215. package/presentation/router/types.js +0 -3
  216. package/renderApp.js +7 -6
  217. package/renderApp.js.map +1 -1
  218. package/router.js +0 -3
  219. package/rslib-runtime.js +14 -0
  220. package/rslib-runtime.js.map +1 -0
  221. package/shared/di/DiContainerProvider.js +8 -12
  222. package/shared/di/DiContainerProvider.js.map +1 -1
  223. package/shared/di/createFeature.js +7 -8
  224. package/shared/di/createFeature.js.map +1 -1
  225. package/shared/di/useFeature.js +7 -3
  226. package/shared/di/useFeature.js.map +1 -1
  227. package/static/svg/close_24px.33adaadc.svg +1 -0
  228. package/types.js +0 -3
  229. package/utils/createGenericContext.js +17 -21
  230. package/utils/createGenericContext.js.map +1 -1
  231. package/utils/createHashing.js +13 -16
  232. package/utils/createHashing.js.map +1 -1
  233. package/utils/index.js +0 -2
  234. package/utils/legacyPluginToReactComponent.js +11 -10
  235. package/utils/legacyPluginToReactComponent.js.map +1 -1
  236. package/components/index.js.map +0 -1
  237. package/errors/index.js.map +0 -1
  238. package/exports/admin/env-config.js.map +0 -1
  239. package/exports/admin/graphql-client.js.map +0 -1
  240. package/exports/admin/local-storage.js.map +0 -1
  241. package/exports/admin/router.js.map +0 -1
  242. package/exports/admin/security.js.map +0 -1
  243. package/exports/admin.js.map +0 -1
  244. package/features/envConfig/index.js.map +0 -1
  245. package/features/eventPublisher/index.js.map +0 -1
  246. package/features/graphqlClient/index.js.map +0 -1
  247. package/features/graphqlClient/types.js.map +0 -1
  248. package/features/localStorage/index.js.map +0 -1
  249. package/features/mainGraphQLClient/index.js.map +0 -1
  250. package/features/router/index.js.map +0 -1
  251. package/helpers/InterfaceGenerator/date.js.map +0 -1
  252. package/helpers/InterfaceGenerator/id.js.map +0 -1
  253. package/helpers/InterfaceGenerator/identity.js.map +0 -1
  254. package/helpers/InterfaceGenerator/index.js.map +0 -1
  255. package/helpers/InterfaceGenerator/numeric.js.map +0 -1
  256. package/helpers/InterfaceGenerator/truthful.js.map +0 -1
  257. package/hooks/useAutocomplete/index.js.map +0 -1
  258. package/hooks/useDataList/functions/index.js.map +0 -1
  259. package/hooks/useDataList/index.js.map +0 -1
  260. package/hooks/useDataList/utils/index.js.map +0 -1
  261. package/i18n/index.js.map +0 -1
  262. package/index.js.map +0 -1
  263. package/presentation/localStorage/index.js.map +0 -1
  264. package/presentation/router/index.js.map +0 -1
  265. package/presentation/router/types.js.map +0 -1
  266. package/react-butterfiles/Files.d.ts +0 -69
  267. package/react-butterfiles/Files.js +0 -227
  268. package/react-butterfiles/Files.js.map +0 -1
  269. package/react-butterfiles/file.todo +0 -1
  270. package/react-butterfiles/index.d.ts +0 -2
  271. package/react-butterfiles/index.js +0 -4
  272. package/react-butterfiles/index.js.map +0 -1
  273. package/react-butterfiles/utils/generateId.d.ts +0 -1
  274. package/react-butterfiles/utils/generateId.js +0 -5
  275. package/react-butterfiles/utils/generateId.js.map +0 -1
  276. package/react-butterfiles/utils/readFileContent.d.ts +0 -1
  277. package/react-butterfiles/utils/readFileContent.js +0 -15
  278. package/react-butterfiles/utils/readFileContent.js.map +0 -1
  279. package/router.js.map +0 -1
  280. package/types.js.map +0 -1
  281. package/utils/index.js.map +0 -1
@@ -1,31 +1,27 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import get from "lodash/get.js";
3
3
  import { Typography } from "./Typography.js";
4
4
  import { i18n } from "../../i18n/index.js";
5
5
  import { Pre } from "./StyledComponents.js";
6
6
  import { ErrorOverlay } from "./ErrorOverlay.js";
7
7
  const t = i18n.ns("app/graphql/error-overlay");
8
- export const GqlErrorOverlay = props => {
9
- const {
10
- query,
11
- networkError
12
- } = props;
13
- const stackTrace = get(networkError, "result.error.stack");
14
- const title = networkError.message;
15
- const message = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
16
- use: "subtitle"
17
- }, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query)));
18
- let description = null;
19
- if (stackTrace) {
20
- description = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
21
- use: "subtitle"
22
- }, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)));
23
- }
24
- return /*#__PURE__*/React.createElement(ErrorOverlay, {
25
- title: title,
26
- message: message,
27
- description: description
28
- });
8
+ const GqlErrorOverlay = (props)=>{
9
+ const { query, networkError } = props;
10
+ const stackTrace = get(networkError, "result.error.stack");
11
+ const title = networkError.message;
12
+ const message = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
13
+ use: "subtitle"
14
+ }, t`Error occurred while executing operation:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, query)));
15
+ let description = null;
16
+ if (stackTrace) description = /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Typography, {
17
+ use: "subtitle"
18
+ }, t`Complete stack trace:`), /*#__PURE__*/ react.createElement(Pre, null, /*#__PURE__*/ react.createElement("code", null, stackTrace)));
19
+ return /*#__PURE__*/ react.createElement(ErrorOverlay, {
20
+ title: title,
21
+ message: message,
22
+ description: description
23
+ });
29
24
  };
25
+ export { GqlErrorOverlay };
30
26
 
31
27
  //# sourceMappingURL=GqlErrorOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","get","Typography","i18n","Pre","ErrorOverlay","t","ns","GqlErrorOverlay","props","query","networkError","stackTrace","title","message","createElement","Fragment","use","description"],"sources":["GqlErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { Pre } from \"./StyledComponents.js\";\nimport { ErrorOverlay } from \"./ErrorOverlay.js\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\n\nexport const GqlErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const stackTrace = get(networkError, \"result.error.stack\");\n\n const title = networkError.message;\n\n const message = (\n <>\n <Typography use={\"subtitle\"}>{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </>\n );\n\n let description: React.ReactNode = null;\n if (stackTrace) {\n description = (\n <>\n <Typography use={\"subtitle\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </>\n );\n }\n\n return <ErrorOverlay title={title} message={message} description={description} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAASC,UAAU;AACnB,SAASC,IAAI;AACb,SAASC,GAAG;AACZ,SAASC,YAAY;AAErB,MAAMC,CAAC,GAAGH,IAAI,CAACI,EAAE,CAAC,2BAA2B,CAAC;AAc9C,OAAO,MAAMC,eAAe,GAAIC,KAAwB,IAAK;EACzD,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,KAAK;EACrC,MAAMG,UAAU,GAAGX,GAAG,CAACU,YAAY,EAAE,oBAAoB,CAAC;EAE1D,MAAME,KAAK,GAAGF,YAAY,CAACG,OAAO;EAElC,MAAMA,OAAO,gBACTd,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACIhB,KAAA,CAAAe,aAAA,CAACb,UAAU;IAACe,GAAG,EAAE;EAAW,GAAEX,CAAC,2CAAwD,CAAC,eACxFN,KAAA,CAAAe,aAAA,CAACX,GAAG,qBACAJ,KAAA,CAAAe,aAAA,eAAOL,KAAY,CAClB,CACP,CACL;EAED,IAAIQ,WAA4B,GAAG,IAAI;EACvC,IAAIN,UAAU,EAAE;IACZM,WAAW,gBACPlB,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAgB,QAAA,qBACIhB,KAAA,CAAAe,aAAA,CAACb,UAAU;MAACe,GAAG,EAAE;IAAW,GAAEX,CAAC,uBAAoC,CAAC,eACpEN,KAAA,CAAAe,aAAA,CAACX,GAAG,qBACAJ,KAAA,CAAAe,aAAA,eAAOH,UAAiB,CACvB,CACP,CACL;EACL;EAEA,oBAAOZ,KAAA,CAAAe,aAAA,CAACV,YAAY;IAACQ,KAAK,EAAEA,KAAM;IAACC,OAAO,EAAEA,OAAQ;IAACI,WAAW,EAAEA;EAAY,CAAE,CAAC;AACrF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { Typography } from \"./Typography.js\";\nimport { i18n } from \"../../i18n/index.js\";\nimport { Pre } from \"./StyledComponents.js\";\nimport { ErrorOverlay } from \"./ErrorOverlay.js\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\n\nexport const GqlErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const stackTrace = get(networkError, \"result.error.stack\");\n\n const title = networkError.message;\n\n const message = (\n <>\n <Typography use={\"subtitle\"}>{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </>\n );\n\n let description: React.ReactNode = null;\n if (stackTrace) {\n description = (\n <>\n <Typography use={\"subtitle\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </>\n );\n }\n\n return <ErrorOverlay title={title} message={message} description={description} />;\n};\n"],"names":["t","i18n","GqlErrorOverlay","props","query","networkError","stackTrace","get","title","message","Typography","Pre","description","ErrorOverlay"],"mappings":";;;;;;AAOA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAcX,MAAMC,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAE,GAAGF;IAChC,MAAMG,aAAaC,IAAIF,cAAc;IAErC,MAAMG,QAAQH,aAAa,OAAO;IAElC,MAAMI,UAAU,WAAVA,GACF,wDACI,oBAACC,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,yCAAyC,CAAC,iBAC1E,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAMP;IAKnB,IAAIQ,cAA+B;IACnC,IAAIN,YACAM,cAAc,WAAdA,GACI,wDACI,oBAACF,YAAUA;QAAC,KAAK;OAAaV,CAAC,CAAC,qBAAqB,CAAC,iBACtD,oBAACW,KAAGA,MAAAA,WAAAA,GACA,oBAAC,cAAML;IAMvB,OAAO,WAAP,GAAO,oBAACO,cAAYA;QAAC,OAAOL;QAAO,SAASC;QAAS,aAAaG;;AACtE"}
@@ -1,31 +1,23 @@
1
- import _styled from "@emotion/styled/base";
2
- function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
3
- import React from "react";
4
- const Code = /*#__PURE__*/_styled("code", process.env.NODE_ENV === "production" ? {
5
- target: "e1nq64i10"
6
- } : {
7
- target: "e1nq64i10",
8
- label: "Code"
9
- })(process.env.NODE_ENV === "production" ? {
10
- name: "rye9wa",
11
- styles: "font-family:monospace;font-size:0.85rem;line-height:1rem"
12
- } : {
13
- name: "rye9wa",
14
- styles: "font-family:monospace;font-size:0.85rem;line-height:1rem/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxvY2FsQXdzTGFtYmRhVGltZW91dE1lc3NhZ2UudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUd3QiIsImZpbGUiOiJMb2NhbEF3c0xhbWJkYVRpbWVvdXRNZXNzYWdlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5jb25zdCBDb2RlID0gc3R5bGVkLmNvZGVgXG4gICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICBmb250LXNpemU6IDAuODVyZW07XG4gICAgbGluZS1oZWlnaHQ6IDFyZW07XG5gO1xuXG5leHBvcnQgY29uc3QgTG9jYWxBd3NMYW1iZGFUaW1lb3V0TWVzc2FnZSA9ICgpID0+IChcbiAgICA8PlxuICAgICAgICBMb2NhbCBBV1MgTGFtYmRhIGZ1bmN0aW9uIGV4ZWN1dGlvbiB0aW1lZCBvdXQuXG4gICAgICAgIDxiciAvPlxuICAgICAgICA8YnIgLz5cbiAgICAgICAgRGlkIHlvdSBzdG9wIHRoZSZuYnNwO1xuICAgICAgICA8YVxuICAgICAgICAgICAgaHJlZj17XCJodHRwczovL3d3dy53ZWJpbnkuY29tL2RvY3MvY29yZS1kZXZlbG9wbWVudC1jb25jZXB0cy9iYXNpY3Mvd2F0Y2gtY29tbWFuZFwifVxuICAgICAgICAgICAgcmVsPXtcIm5vcmVmZXJyZXIgbm9vcGVuZXJcIn1cbiAgICAgICAgICAgIHRhcmdldD17XCJfYmxhbmtcIn1cbiAgICAgICAgPlxuICAgICAgICAgICAgPENvZGU+d2ViaW55IHdhdGNoPC9Db2RlPlxuICAgICAgICA8L2E+XG4gICAgICAgICZuYnNwO2NvbW1hbmQ/IElmIHNvLCBwbGVhc2UgcmVzdGFydCB0aGUgY29tbWFuZCBvciBkZXBsb3kgeW91ciBjaGFuZ2VzIHZpYSB0aGUmbmJzcDtcbiAgICAgICAgPGFcbiAgICAgICAgICAgIGhyZWY9e1wiaHR0cHM6Ly93d3cud2ViaW55LmNvbS9kb2NzL2NvcmUtZGV2ZWxvcG1lbnQtY29uY2VwdHMvYmFzaWNzL3Byb2plY3QtZGVwbG95bWVudFwifVxuICAgICAgICAgICAgcmVsPXtcIm5vcmVmZXJyZXIgbm9vcGVuZXJcIn1cbiAgICAgICAgICAgIHRhcmdldD17XCJfYmxhbmtcIn1cbiAgICAgICAgPlxuICAgICAgICAgICAgPENvZGU+d2ViaW55IGRlcGxveTwvQ29kZT5cbiAgICAgICAgPC9hPlxuICAgICAgICAmbmJzcDtjb21tYW5kLiBGb3IgZXhhbXBsZTogPENvZGU+eWFybiB3ZWJpbnkgZGVwbG95IGFwaSAtLWVudiBkZXY8L0NvZGU+LlxuICAgICAgICA8YnIgLz5cbiAgICAgICAgPGJyIC8+XG4gICAgICAgIExlYXJuIG1vcmU6Jm5ic3A7XG4gICAgICAgIDxhXG4gICAgICAgICAgICBocmVmPXtcImh0dHBzOi8vd2ViaW55LmxpbmsvbG9jYWwtYXdzLWxhbWJkYS1kZXZlbG9wbWVudFwifVxuICAgICAgICAgICAgcmVsPXtcIm5vcmVmZXJyZXIgbm9vcGVuZXJcIn1cbiAgICAgICAgICAgIHRhcmdldD17XCJfYmxhbmtcIn1cbiAgICAgICAgPlxuICAgICAgICAgICAgaHR0cHM6Ly93ZWJpbnkubGluay9sb2NhbC1hd3MtbGFtYmRhLWRldmVsb3BtZW50XG4gICAgICAgIDwvYT5cbiAgICA8Lz5cbik7XG4iXX0= */",
15
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
16
- });
17
- export const LocalAwsLambdaTimeoutMessage = () => /*#__PURE__*/React.createElement(React.Fragment, null, "Local AWS Lambda function execution timed out.", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Did you stop the\xA0", /*#__PURE__*/React.createElement("a", {
18
- href: "https://www.webiny.com/docs/core-development-concepts/basics/watch-command",
19
- rel: "noreferrer noopener",
20
- target: "_blank"
21
- }, /*#__PURE__*/React.createElement(Code, null, "webiny watch")), "\xA0command? If so, please restart the command or deploy your changes via the\xA0", /*#__PURE__*/React.createElement("a", {
22
- href: "https://www.webiny.com/docs/core-development-concepts/basics/project-deployment",
23
- rel: "noreferrer noopener",
24
- target: "_blank"
25
- }, /*#__PURE__*/React.createElement(Code, null, "webiny deploy")), "\xA0command. For example: ", /*#__PURE__*/React.createElement(Code, null, "yarn webiny deploy api --env dev"), ".", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Learn more:\xA0", /*#__PURE__*/React.createElement("a", {
26
- href: "https://webiny.link/local-aws-lambda-development",
27
- rel: "noreferrer noopener",
28
- target: "_blank"
29
- }, "https://webiny.link/local-aws-lambda-development"));
1
+ import react from "react";
2
+ import styled from "@emotion/styled";
3
+ const Code = styled.code`
4
+ font-family: monospace;
5
+ font-size: 0.85rem;
6
+ line-height: 1rem;
7
+ `;
8
+ const LocalAwsLambdaTimeoutMessage = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, "Local AWS Lambda function execution timed out.", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("br", null), "Did you stop the\xa0", /*#__PURE__*/ react.createElement("a", {
9
+ href: "https://www.webiny.com/docs/core-development-concepts/basics/watch-command",
10
+ rel: "noreferrer noopener",
11
+ target: "_blank"
12
+ }, /*#__PURE__*/ react.createElement(Code, null, "webiny watch")), "\xa0command? If so, please restart the command or deploy your changes via the\xa0", /*#__PURE__*/ react.createElement("a", {
13
+ href: "https://www.webiny.com/docs/core-development-concepts/basics/project-deployment",
14
+ rel: "noreferrer noopener",
15
+ target: "_blank"
16
+ }, /*#__PURE__*/ react.createElement(Code, null, "webiny deploy")), "\xa0command. For example: ", /*#__PURE__*/ react.createElement(Code, null, "yarn webiny deploy api --env dev"), ".", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("br", null), "Learn more:\xa0", /*#__PURE__*/ react.createElement("a", {
17
+ href: "https://webiny.link/local-aws-lambda-development",
18
+ rel: "noreferrer noopener",
19
+ target: "_blank"
20
+ }, "https://webiny.link/local-aws-lambda-development"));
21
+ export { LocalAwsLambdaTimeoutMessage };
30
22
 
31
23
  //# sourceMappingURL=LocalAwsLambdaTimeoutMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Code","_styled","process","env","NODE_ENV","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","LocalAwsLambdaTimeoutMessage","createElement","Fragment","href","rel"],"sources":["LocalAwsLambdaTimeoutMessage.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\n\nconst Code = styled.code`\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n`;\n\nexport const LocalAwsLambdaTimeoutMessage = () => (\n <>\n Local AWS Lambda function execution timed out.\n <br />\n <br />\n Did you stop the&nbsp;\n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/watch-command\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny watch</Code>\n </a>\n &nbsp;command? If so, please restart the command or deploy your changes via the&nbsp;\n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/project-deployment\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny deploy</Code>\n </a>\n &nbsp;command. For example: <Code>yarn webiny deploy api --env dev</Code>.\n <br />\n <br />\n Learn more:&nbsp;\n <a\n href={\"https://webiny.link/local-aws-lambda-development\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n https://webiny.link/local-aws-lambda-development\n </a>\n </>\n);\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,MAAMC,IAAI,gBAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,QAAA,EAAAC;AAAA,EAIT;AAED,OAAO,MAAMC,4BAA4B,GAAGA,CAAA,kBACxCZ,KAAA,CAAAa,aAAA,CAAAb,KAAA,CAAAc,QAAA,QAAE,gDAEE,eAAAd,KAAA,CAAAa,aAAA,WAAK,CAAC,eACNb,KAAA,CAAAa,aAAA,WAAK,CAAC,wBAEN,eAAAb,KAAA,CAAAa,aAAA;EACIE,IAAI,EAAE,4EAA6E;EACnFC,GAAG,EAAE,qBAAsB;EAC3BV,MAAM,EAAE;AAAS,gBAEjBN,KAAA,CAAAa,aAAA,CAACZ,IAAI,QAAC,cAAkB,CACzB,CAAC,qFAEJ,eAAAD,KAAA,CAAAa,aAAA;EACIE,IAAI,EAAE,iFAAkF;EACxFC,GAAG,EAAE,qBAAsB;EAC3BV,MAAM,EAAE;AAAS,gBAEjBN,KAAA,CAAAa,aAAA,CAACZ,IAAI,QAAC,eAAmB,CAC1B,CAAC,8BACwB,eAAAD,KAAA,CAAAa,aAAA,CAACZ,IAAI,QAAC,kCAAsC,CAAC,KACzE,eAAAD,KAAA,CAAAa,aAAA,WAAK,CAAC,eACNb,KAAA,CAAAa,aAAA,WAAK,CAAC,mBAEN,eAAAb,KAAA,CAAAa,aAAA;EACIE,IAAI,EAAE,kDAAmD;EACzDC,GAAG,EAAE,qBAAsB;EAC3BV,MAAM,EAAE;AAAS,GACpB,kDAEE,CACL,CACL","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\n\nconst Code = styled.code`\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n`;\n\nexport const LocalAwsLambdaTimeoutMessage = () => (\n <>\n Local AWS Lambda function execution timed out.\n <br />\n <br />\n Did you stop the&nbsp;\n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/watch-command\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny watch</Code>\n </a>\n &nbsp;command? If so, please restart the command or deploy your changes via the&nbsp;\n <a\n href={\"https://www.webiny.com/docs/core-development-concepts/basics/project-deployment\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n <Code>webiny deploy</Code>\n </a>\n &nbsp;command. For example: <Code>yarn webiny deploy api --env dev</Code>.\n <br />\n <br />\n Learn more:&nbsp;\n <a\n href={\"https://webiny.link/local-aws-lambda-development\"}\n rel={\"noreferrer noopener\"}\n target={\"_blank\"}\n >\n https://webiny.link/local-aws-lambda-development\n </a>\n </>\n);\n"],"names":["Code","styled","LocalAwsLambdaTimeoutMessage"],"mappings":";;AAGA,MAAMA,OAAOC,OAAO,IAAI,CAAC;;;;AAIzB,CAAC;AAEM,MAAMC,+BAA+B,kBACxC,0CAAE,gEAEE,oBAAC,2BACD,oBAAC,aAAK,sCAEN,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;qBAER,oBAACF,MAAIA,MAAC,kBACN,mGAEJ,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;qBAER,oBAACA,MAAIA,MAAC,mBACN,4CACwB,oBAACA,MAAIA,MAAC,qCAAuC,mBACzE,oBAAC,2BACD,oBAAC,aAAK,iCAEN,oBAAC;QACG,MAAM;QACN,KAAK;QACL,QAAQ;OACX"}
@@ -1,10 +1,5 @@
1
- import _styled from "@emotion/styled/base";
2
- export const OverlayWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
3
- target: "e1rvk94r1"
4
- } : {
5
- target: "e1rvk94r1",
6
- label: "OverlayWrapper"
7
- })(`
1
+ import styled from "@emotion/styled";
2
+ const OverlayWrapper = styled("div")(`
8
3
  width: 100vw;
9
4
  height: 100vh;
10
5
  position: fixed;
@@ -50,13 +45,8 @@ export const OverlayWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV =
50
45
  font-family: monospace;
51
46
  }
52
47
  }
53
- `, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJTdHlsZWRDb21wb25lbnRzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5leHBvcnQgY29uc3QgT3ZlcmxheVdyYXBwZXIgPSBzdHlsZWQoXCJkaXZcIikoYFxuICAgIHdpZHRoOiAxMDB2dztcbiAgICBoZWlnaHQ6IDEwMHZoO1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICB0b3A6IDA7XG4gICAgbGVmdDogMDtcbiAgICB6LWluZGV4OiAxMDU7IC8vIFRoZSBoaWdoZXN0IHotaW5kZXggdmFsdWUgaXMgMTAwIGZvciBEaWFsb2dzXG4gICAgXG4gICAgLmlubmVyIHtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgb3ZlcmZsb3c6IGF1dG87XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHdoaXRlO1xuICAgICAgICBwYWRkaW5nOiAxcmVtO1xuICAgIH1cbiAgICBcbiAgICAuaGVhZGVyIHtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICBtYXJnaW4tYm90dG9tOiAxcmVtO1xuICAgICAgICAuaGVhZGVyX190aXRsZSB7XG4gICAgICAgICAgICBjb2xvcjogdmFyKC0tbWRjLXRoZW1lLWVycm9yKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICAuYm9keSB7XG4gICAgICAgIGdyb3c6IDE7XG4gICAgICAgIC5ib2R5X19zdW1tYXJ5IHtcbiAgICAgICAgICAgIG1hcmdpbi1ib3R0b206IDFyZW07XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmZvb3RlciB7XG4gICAgICAgIGNvbG9yOiB2YXIoLS1tZGMtdGhlbWUtdGV4dC1zZWNvbmRhcnktb24tYmFja2dyb3VuZCk7XG4gICAgICAgIFxuICAgICAgICAuaGlnaGxpZ2h0IHtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjUxLCAyNDUsIDE4MCwgMC41KTtcbiAgICAgICAgICAgIHBhZGRpbmc6IDAgNHB4O1xuICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4O1xuICAgICAgICAgICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICAgICAgfVxuICAgIH1cbmApO1xuXG5leHBvcnQgY29uc3QgUHJlID0gc3R5bGVkKFwicHJlXCIpKGBcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgcGFkZGluZzogMC41ZW07XG4gICAgbWFyZ2luLXRvcDogMC41ZW07XG4gICAgbWFyZ2luLWJvdHRvbTogMC41ZW07XG4gICAgb3ZlcmZsb3cteDogYXV0bztcbiAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7XG4gICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1MSwgMjQ1LCAxODAsIDAuMyk7XG4gICAgY29sb3I6IGluaGVyaXQ7XG4gICAgXG4gICAgY29kZSB7XG4gICAgICAgIGZvbnQtZmFtaWx5OiBtb25vc3BhY2U7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NXJlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDFyZW07XG4gICAgfVxuYCk7XG4iXX0= */");
54
- export const Pre = /*#__PURE__*/_styled("pre", process.env.NODE_ENV === "production" ? {
55
- target: "e1rvk94r0"
56
- } : {
57
- target: "e1rvk94r0",
58
- label: "Pre"
59
- })(`
48
+ `);
49
+ const Pre = styled("pre")(`
60
50
  position: relative;
61
51
  display: block;
62
52
  padding: 0.5em;
@@ -73,6 +63,7 @@ export const Pre = /*#__PURE__*/_styled("pre", process.env.NODE_ENV === "product
73
63
  font-size: 0.85rem;
74
64
  line-height: 1rem;
75
65
  }
76
- `, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtEbUIiLCJmaWxlIjoiU3R5bGVkQ29tcG9uZW50cy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuZXhwb3J0IGNvbnN0IE92ZXJsYXlXcmFwcGVyID0gc3R5bGVkKFwiZGl2XCIpKGBcbiAgICB3aWR0aDogMTAwdnc7XG4gICAgaGVpZ2h0OiAxMDB2aDtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgdG9wOiAwO1xuICAgIGxlZnQ6IDA7XG4gICAgei1pbmRleDogMTA1OyAvLyBUaGUgaGlnaGVzdCB6LWluZGV4IHZhbHVlIGlzIDEwMCBmb3IgRGlhbG9nc1xuICAgIFxuICAgIC5pbm5lciB7XG4gICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgIG92ZXJmbG93OiBhdXRvO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB3aGl0ZTtcbiAgICAgICAgcGFkZGluZzogMXJlbTtcbiAgICB9XG4gICAgXG4gICAgLmhlYWRlciB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgICAgICAgLmhlYWRlcl9fdGl0bGUge1xuICAgICAgICAgICAgY29sb3I6IHZhcigtLW1kYy10aGVtZS1lcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmJvZHkge1xuICAgICAgICBncm93OiAxO1xuICAgICAgICAuYm9keV9fc3VtbWFyeSB7XG4gICAgICAgICAgICBtYXJnaW4tYm90dG9tOiAxcmVtO1xuICAgICAgICB9XG4gICAgfVxuICAgIFxuICAgIC5mb290ZXIge1xuICAgICAgICBjb2xvcjogdmFyKC0tbWRjLXRoZW1lLXRleHQtc2Vjb25kYXJ5LW9uLWJhY2tncm91bmQpO1xuICAgICAgICBcbiAgICAgICAgLmhpZ2hsaWdodCB7XG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1MSwgMjQ1LCAxODAsIDAuNSk7XG4gICAgICAgICAgICBwYWRkaW5nOiAwIDRweDtcbiAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDZweDtcbiAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBtb25vc3BhY2U7XG4gICAgICAgIH1cbiAgICB9XG5gKTtcblxuZXhwb3J0IGNvbnN0IFByZSA9IHN0eWxlZChcInByZVwiKShgXG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIHBhZGRpbmc6IDAuNWVtO1xuICAgIG1hcmdpbi10b3A6IDAuNWVtO1xuICAgIG1hcmdpbi1ib3R0b206IDAuNWVtO1xuICAgIG92ZXJmbG93LXg6IGF1dG87XG4gICAgd2hpdGUtc3BhY2U6IHByZS13cmFwO1xuICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTEsIDI0NSwgMTgwLCAwLjMpO1xuICAgIGNvbG9yOiBpbmhlcml0O1xuICAgIFxuICAgIGNvZGUge1xuICAgICAgICBmb250LWZhbWlseTogbW9ub3NwYWNlO1xuICAgICAgICBmb250LXNpemU6IDAuODVyZW07XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAxcmVtO1xuICAgIH1cbmApO1xuIl19 */");
66
+ `);
67
+ export { OverlayWrapper, Pre };
77
68
 
78
69
  //# sourceMappingURL=StyledComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["OverlayWrapper","_styled","process","env","NODE_ENV","target","label","Pre"],"sources":["StyledComponents.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const OverlayWrapper = styled(\"div\")(`\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n`);\n\nexport const Pre = styled(\"pre\")(`\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n`);\n"],"mappings":";AAEA,OAAO,MAAMA,cAAc,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,mzEAAC;AAEF,OAAO,MAAMG,GAAG,gBAAGN,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,mzEAAC","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/StyledComponents.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/StyledComponents.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const OverlayWrapper = styled(\"div\")(`\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 105; // The highest z-index value is 100 for Dialogs\n \n .inner {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: white;\n padding: 1rem;\n }\n \n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n .header__title {\n color: var(--mdc-theme-error);\n }\n }\n \n .body {\n grow: 1;\n .body__summary {\n margin-bottom: 1rem;\n }\n }\n \n .footer {\n color: var(--mdc-theme-text-secondary-on-background);\n \n .highlight {\n background-color: rgba(251, 245, 180, 0.5);\n padding: 0 4px;\n border-radius: 6px;\n font-family: monospace;\n }\n }\n`);\n\nexport const Pre = styled(\"pre\")(`\n position: relative;\n display: block;\n padding: 0.5em;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n overflow-x: auto;\n white-space: pre-wrap;\n border-radius: 0.25rem;\n background-color: rgba(251, 245, 180, 0.3);\n color: inherit;\n \n code {\n font-family: monospace;\n font-size: 0.85rem;\n line-height: 1rem;\n }\n`);\n"],"names":["OverlayWrapper","styled","Pre"],"mappings":";AAEO,MAAMA,iBAAiBC,OAAO,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8C7C,CAAC;AAEM,MAAMC,MAAMD,OAAO,OAAO,CAAC;;;;;;;;;;;;;;;;;AAiBlC,CAAC"}
@@ -1,18 +1,13 @@
1
- import React from "react";
2
- export const Typography = props => {
3
- const {
4
- children,
5
- use,
6
- className
7
- } = props;
8
- if (use === "headline") {
9
- return /*#__PURE__*/React.createElement("h4", {
10
- className: className
1
+ import react from "react";
2
+ const Typography = (props)=>{
3
+ const { children, use, className } = props;
4
+ if ("headline" === use) return /*#__PURE__*/ react.createElement("h4", {
5
+ className: className
6
+ }, children);
7
+ return /*#__PURE__*/ react.createElement("p", {
8
+ className: className
11
9
  }, children);
12
- }
13
- return /*#__PURE__*/React.createElement("p", {
14
- className: className
15
- }, children);
16
10
  };
11
+ export { Typography };
17
12
 
18
13
  //# sourceMappingURL=Typography.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Typography","props","children","use","className","createElement"],"sources":["Typography.tsx"],"sourcesContent":["import React from \"react\";\n\nexport declare type TypographyT = \"headline\" | \"body\" | \"subtitle\";\n\nexport interface TypographyProps {\n use: TypographyT;\n children?: React.ReactNode;\n className?: string;\n}\n\nexport const Typography = (props: TypographyProps) => {\n const { children, use, className } = props;\n\n if (use === \"headline\") {\n return <h4 className={className}>{children}</h4>;\n }\n\n return <p className={className}>{children}</p>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAUzB,OAAO,MAAMC,UAAU,GAAIC,KAAsB,IAAK;EAClD,MAAM;IAAEC,QAAQ;IAAEC,GAAG;IAAEC;EAAU,CAAC,GAAGH,KAAK;EAE1C,IAAIE,GAAG,KAAK,UAAU,EAAE;IACpB,oBAAOJ,KAAA,CAAAM,aAAA;MAAID,SAAS,EAAEA;IAAU,GAAEF,QAAa,CAAC;EACpD;EAEA,oBAAOH,KAAA,CAAAM,aAAA;IAAGD,SAAS,EAAEA;EAAU,GAAEF,QAAY,CAAC;AAClD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/Typography.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/Typography.tsx"],"sourcesContent":["import React from \"react\";\n\nexport declare type TypographyT = \"headline\" | \"body\" | \"subtitle\";\n\nexport interface TypographyProps {\n use: TypographyT;\n children?: React.ReactNode;\n className?: string;\n}\n\nexport const Typography = (props: TypographyProps) => {\n const { children, use, className } = props;\n\n if (use === \"headline\") {\n return <h4 className={className}>{children}</h4>;\n }\n\n return <p className={className}>{children}</p>;\n};\n"],"names":["Typography","props","children","use","className"],"mappings":";AAUO,MAAMA,aAAa,CAACC;IACvB,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,SAAS,EAAE,GAAGH;IAErC,IAAIE,AAAQ,eAARA,KACA,OAAO,WAAP,GAAO,oBAAC;QAAG,WAAWC;OAAYF;IAGtC,OAAO,WAAP,GAAO,oBAAC;QAAE,WAAWE;OAAYF;AACrC"}
@@ -0,0 +1,19 @@
1
+ import __rslib_svgr_url__0__ from "../../../static/svg/close_24px.33adaadc.svg";
2
+ import * as __rspack_external_react from "react";
3
+ const SvgClose24Px = (props)=>/*#__PURE__*/ __rspack_external_react.createElement("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: 24,
6
+ height: 24,
7
+ viewBox: "0 0 24 24",
8
+ ...props
9
+ }, /*#__PURE__*/ __rspack_external_react.createElement("path", {
10
+ fill: "none",
11
+ d: "M0 0h24v24H0z"
12
+ }), /*#__PURE__*/ __rspack_external_react.createElement("path", {
13
+ d: "M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7A.996.996 0 1 0 5.7 7.11L10.59 12 5.7 16.89a.996.996 0 1 0 1.41 1.41L12 13.41l4.89 4.89a.996.996 0 1 0 1.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"
14
+ }));
15
+ const close_24px = __rslib_svgr_url__0__;
16
+ export default close_24px;
17
+ export { SvgClose24Px as ReactComponent };
18
+
19
+ //# sourceMappingURL=close_24px.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/assets/close_24px.js","sources":["../../../../src/plugins/NetworkErrorLinkPlugin/assets/close_24px.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgClose24Px = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><path fill=\"none\" d=\"M0 0h24v24H0z\" /><path d=\"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7A.996.996 0 1 0 5.7 7.11L10.59 12 5.7 16.89a.996.996 0 1 0 1.41 1.41L12 13.41l4.89 4.89a.996.996 0 1 0 1.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4\" /></svg>;\nexport { SvgClose24Px as ReactComponent };\nexport default \"__RSLIB_SVGR_AUTO_PUBLIC_PATH__static/svg/close_24px.33adaadc.svg\";"],"names":["SvgClose24Px","props"],"mappings":";;AACA,MAAMA,eAAeC,CAAAA,QAAAA,WAAAA,GAAS,sCAAC;QAAI,OAAM;QAA6B,OAAO;QAAI,QAAQ;QAAI,SAAQ;QAAa,GAAGA,KAAK;qBAAE,sCAAC;QAAK,MAAK;QAAO,GAAE;sBAAkB,sCAAC;QAAK,GAAE;;AAE1K"}
@@ -1,22 +1,15 @@
1
1
  import { createRoot } from "react-dom/client";
2
- const createErrorOverlay = params => {
3
- const {
4
- element
5
- } = params;
6
- // If the element already present in DOM, return immediately.
7
- if (document.getElementById("overlay-root")) {
8
- return;
9
- }
10
- // Create root element to hold React tree.
11
- const container = document.createElement("div");
12
- container.id = "overlay-root";
13
- // Insert root element into body.
14
- const body = document.getElementsByTagName("body")[0];
15
- body.appendChild(container);
16
- // Mount the ErrorOverlay component into root element.
17
- const root = createRoot(container);
18
- root.render(element);
2
+ const createErrorOverlay = (params)=>{
3
+ const { element } = params;
4
+ if (document.getElementById("overlay-root")) return;
5
+ const container = document.createElement("div");
6
+ container.id = "overlay-root";
7
+ const body = document.getElementsByTagName("body")[0];
8
+ body.appendChild(container);
9
+ const root = createRoot(container);
10
+ root.render(element);
19
11
  };
20
- export default createErrorOverlay;
12
+ const NetworkErrorLinkPlugin_createErrorOverlay = createErrorOverlay;
13
+ export default NetworkErrorLinkPlugin_createErrorOverlay;
21
14
 
22
15
  //# sourceMappingURL=createErrorOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createRoot","createErrorOverlay","params","element","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild","root","render"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\ninterface CreateErrorOverlayParams {\n element: React.ReactElement;\n closeable?: boolean;\n}\n\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { element } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n const root = createRoot(container);\n root.render(element);\n};\n\nexport default createErrorOverlay;\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,kBAAkB;AAO7C,MAAMC,kBAAkB,GAAIC,MAAgC,IAAW;EACnE,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B;EACA,IAAIE,QAAQ,CAACC,cAAc,CAAC,cAAc,CAAC,EAAE;IACzC;EACJ;EACA;EACA,MAAMC,SAAyB,GAAGF,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;EAC/DD,SAAS,CAACE,EAAE,GAAG,cAAc;EAC7B;EACA,MAAMC,IAAqB,GAAGL,QAAQ,CAACM,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;EACtED,IAAI,CAACE,WAAW,CAACL,SAAS,CAAC;EAC3B;EACA,MAAMM,IAAI,GAAGZ,UAAU,CAACM,SAAS,CAAC;EAClCM,IAAI,CAACC,MAAM,CAACV,OAAO,CAAC;AACxB,CAAC;AAED,eAAeF,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin/createErrorOverlay.js","sources":["../../../src/plugins/NetworkErrorLinkPlugin/createErrorOverlay.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\ninterface CreateErrorOverlayParams {\n element: React.ReactElement;\n closeable?: boolean;\n}\n\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { element } = params;\n // If the element already present in DOM, return immediately.\n if (document.getElementById(\"overlay-root\")) {\n return;\n }\n // Create root element to hold React tree.\n const container: HTMLDivElement = document.createElement(\"div\");\n container.id = \"overlay-root\";\n // Insert root element into body.\n const body: HTMLBodyElement = document.getElementsByTagName(\"body\")[0];\n body.appendChild(container);\n // Mount the ErrorOverlay component into root element.\n const root = createRoot(container);\n root.render(element);\n};\n\nexport default createErrorOverlay;\n"],"names":["createErrorOverlay","params","element","document","container","body","root","createRoot"],"mappings":";AAQA,MAAMA,qBAAqB,CAACC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAIE,SAAS,cAAc,CAAC,iBACxB;IAGJ,MAAMC,YAA4BD,SAAS,aAAa,CAAC;IACzDC,UAAU,EAAE,GAAG;IAEf,MAAMC,OAAwBF,SAAS,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACtEE,KAAK,WAAW,CAACD;IAEjB,MAAME,OAAOC,WAAWH;IACxBE,KAAK,MAAM,CAACJ;AAChB;AAEA,kDAAeF"}
@@ -1,70 +1,53 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { onError } from "apollo-link-error";
3
3
  import { print } from "graphql/language/index.js";
4
- import { boolean } from "boolean";
4
+ import { boolean as external_boolean_boolean } from "boolean";
5
5
  import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
6
6
  import createErrorOverlay from "./NetworkErrorLinkPlugin/createErrorOverlay.js";
7
7
  import { LocalAwsLambdaTimeoutMessage } from "./NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js";
8
- import { config as appConfig } from "../config.js";
8
+ import { config } from "../config.js";
9
9
  import { ErrorOverlay } from "./NetworkErrorLinkPlugin/ErrorOverlay.js";
10
10
  import { GqlErrorOverlay } from "./NetworkErrorLinkPlugin/GqlErrorOverlay.js";
11
11
  import { NetworkErrorEvent } from "../errors/index.js";
12
- const isLocalAwsLambdaFnInvocationTimeoutError = error => {
13
- return error.result && error.result.code === "LOCAL_AWS_LAMBDA_TIMEOUT";
14
- };
15
-
16
- /**
17
- * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
18
- */
19
- export class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
20
- constructor(getEventPublisher) {
21
- super();
22
- this.getEventPublisher = getEventPublisher;
23
- }
24
- createLink() {
25
- return onError(({
26
- networkError,
27
- operation
28
- }) => {
29
- const debug = appConfig.getKey("DEBUG", boolean(process.env.REACT_APP_DEBUG));
30
- if (networkError) {
31
- // Publish network error event
32
- const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError) ? "timeout" : "network";
33
- const event = new NetworkErrorEvent({
34
- message: networkError.message,
35
- operationName: operation.operationName,
36
- query: print(operation.query),
37
- variables: operation.variables,
38
- errorType,
39
- statusCode: networkError.statusCode,
40
- result: networkError.result
12
+ const isLocalAwsLambdaFnInvocationTimeoutError = (error)=>error.result && "LOCAL_AWS_LAMBDA_TIMEOUT" === error.result.code;
13
+ class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
14
+ constructor(getEventPublisher){
15
+ super(), this.getEventPublisher = getEventPublisher;
16
+ }
17
+ createLink() {
18
+ return onError(({ networkError, operation })=>{
19
+ const debug = config.getKey("DEBUG", external_boolean_boolean(process.env.REACT_APP_DEBUG));
20
+ if (networkError) {
21
+ const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError) ? "timeout" : "network";
22
+ const event = new NetworkErrorEvent({
23
+ message: networkError.message,
24
+ operationName: operation.operationName,
25
+ query: print(operation.query),
26
+ variables: operation.variables,
27
+ errorType,
28
+ statusCode: networkError.statusCode,
29
+ result: networkError.result
30
+ });
31
+ this.getEventPublisher().publish(event);
32
+ if (debug) {
33
+ if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) return void createErrorOverlay({
34
+ element: /*#__PURE__*/ react.createElement(ErrorOverlay, {
35
+ message: /*#__PURE__*/ react.createElement(LocalAwsLambdaTimeoutMessage, null),
36
+ closeable: false
37
+ }),
38
+ closeable: false
39
+ });
40
+ createErrorOverlay({
41
+ element: /*#__PURE__*/ react.createElement(GqlErrorOverlay, {
42
+ query: print(operation.query),
43
+ networkError: networkError
44
+ })
45
+ });
46
+ }
47
+ }
41
48
  });
42
- this.getEventPublisher().publish(event);
43
-
44
- // Keep existing overlay logic for now
45
- if (debug) {
46
- if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) {
47
- createErrorOverlay({
48
- element: /*#__PURE__*/React.createElement(ErrorOverlay, {
49
- message: /*#__PURE__*/React.createElement(LocalAwsLambdaTimeoutMessage, null),
50
- closeable: false
51
- }),
52
- closeable: false
53
- });
54
- return;
55
- }
56
- createErrorOverlay({
57
- element: /*#__PURE__*/React.createElement(GqlErrorOverlay, {
58
- query: print(operation.query),
59
- networkError: networkError
60
- })
61
- });
62
- }
63
- }
64
-
65
- // TODO: also print graphQLErrors
66
- });
67
- }
49
+ }
68
50
  }
51
+ export { NetworkErrorLinkPlugin };
69
52
 
70
53
  //# sourceMappingURL=NetworkErrorLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","onError","print","boolean","ApolloLinkPlugin","createErrorOverlay","LocalAwsLambdaTimeoutMessage","config","appConfig","ErrorOverlay","GqlErrorOverlay","NetworkErrorEvent","isLocalAwsLambdaFnInvocationTimeoutError","error","result","code","NetworkErrorLinkPlugin","constructor","getEventPublisher","createLink","networkError","operation","debug","getKey","process","env","REACT_APP_DEBUG","errorType","event","message","operationName","query","variables","statusCode","publish","element","createElement","closeable"],"sources":["NetworkErrorLinkPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { onError } from \"apollo-link-error\";\nimport { type ServerError } from \"apollo-link-http-common\";\nimport { print } from \"graphql/language/index.js\";\nimport { boolean } from \"boolean\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay.js\";\nimport { LocalAwsLambdaTimeoutMessage } from \"./NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js\";\nimport { config as appConfig } from \"~/config.js\";\nimport { ErrorOverlay } from \"~/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js\";\nimport { GqlErrorOverlay } from \"./NetworkErrorLinkPlugin/GqlErrorOverlay.js\";\nimport type { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { NetworkErrorEvent } from \"~/errors/index.js\";\n\nconst isLocalAwsLambdaFnInvocationTimeoutError = (error: any): error is ServerError => {\n return error.result && error.result.code === \"LOCAL_AWS_LAMBDA_TIMEOUT\";\n};\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n constructor(private getEventPublisher: () => EventPublisher.Interface) {\n super();\n }\n\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError) {\n // Publish network error event\n const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError)\n ? \"timeout\"\n : \"network\";\n\n const event = new NetworkErrorEvent({\n message: networkError.message,\n operationName: operation.operationName,\n query: print(operation.query),\n variables: operation.variables,\n errorType,\n statusCode: (networkError as any).statusCode,\n result: (networkError as any).result\n });\n\n this.getEventPublisher().publish(event);\n\n // Keep existing overlay logic for now\n if (debug) {\n if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) {\n createErrorOverlay({\n element: (\n <ErrorOverlay\n message={<LocalAwsLambdaTimeoutMessage />}\n closeable={false}\n />\n ),\n closeable: false\n });\n return;\n }\n\n createErrorOverlay({\n element: (\n <GqlErrorOverlay\n query={print(operation.query)}\n networkError={networkError}\n />\n )\n });\n }\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,mBAAmB;AAE3C,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,gBAAgB;AACzB,OAAOC,kBAAkB;AACzB,SAASC,4BAA4B;AACrC,SAASC,MAAM,IAAIC,SAAS;AAC5B,SAASC,YAAY;AACrB,SAASC,eAAe;AAExB,SAASC,iBAAiB;AAE1B,MAAMC,wCAAwC,GAAIC,KAAU,IAA2B;EACnF,OAAOA,KAAK,CAACC,MAAM,IAAID,KAAK,CAACC,MAAM,CAACC,IAAI,KAAK,0BAA0B;AAC3E,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASZ,gBAAgB,CAAC;EACzDa,WAAWA,CAASC,iBAAiD,EAAE;IACnE,KAAK,CAAC,CAAC;IAAC,KADQA,iBAAiD,GAAjDA,iBAAiD;EAErE;EAEgBC,UAAUA,CAAA,EAAG;IACzB,OAAOlB,OAAO,CAAC,CAAC;MAAEmB,YAAY;MAAEC;IAAU,CAAC,KAAK;MAC5C,MAAMC,KAAK,GAAGd,SAAS,CAACe,MAAM,CAAC,OAAO,EAAEpB,OAAO,CAACqB,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;MAE7E,IAAIN,YAAY,EAAE;QACd;QACA,MAAMO,SAAS,GAAGf,wCAAwC,CAACQ,YAAY,CAAC,GAClE,SAAS,GACT,SAAS;QAEf,MAAMQ,KAAK,GAAG,IAAIjB,iBAAiB,CAAC;UAChCkB,OAAO,EAAET,YAAY,CAACS,OAAO;UAC7BC,aAAa,EAAET,SAAS,CAACS,aAAa;UACtCC,KAAK,EAAE7B,KAAK,CAACmB,SAAS,CAACU,KAAK,CAAC;UAC7BC,SAAS,EAAEX,SAAS,CAACW,SAAS;UAC9BL,SAAS;UACTM,UAAU,EAAGb,YAAY,CAASa,UAAU;UAC5CnB,MAAM,EAAGM,YAAY,CAASN;QAClC,CAAC,CAAC;QAEF,IAAI,CAACI,iBAAiB,CAAC,CAAC,CAACgB,OAAO,CAACN,KAAK,CAAC;;QAEvC;QACA,IAAIN,KAAK,EAAE;UACP,IAAIV,wCAAwC,CAACQ,YAAY,CAAC,EAAE;YACxDf,kBAAkB,CAAC;cACf8B,OAAO,eACHnC,KAAA,CAAAoC,aAAA,CAAC3B,YAAY;gBACToB,OAAO,eAAE7B,KAAA,CAAAoC,aAAA,CAAC9B,4BAA4B,MAAE,CAAE;gBAC1C+B,SAAS,EAAE;cAAM,CACpB,CACJ;cACDA,SAAS,EAAE;YACf,CAAC,CAAC;YACF;UACJ;UAEAhC,kBAAkB,CAAC;YACf8B,OAAO,eACHnC,KAAA,CAAAoC,aAAA,CAAC1B,eAAe;cACZqB,KAAK,EAAE7B,KAAK,CAACmB,SAAS,CAACU,KAAK,CAAE;cAC9BX,YAAY,EAAEA;YAAa,CAC9B;UAET,CAAC,CAAC;QACN;MACJ;;MAEA;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"plugins/NetworkErrorLinkPlugin.js","sources":["../../src/plugins/NetworkErrorLinkPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { onError } from \"apollo-link-error\";\nimport { type ServerError } from \"apollo-link-http-common\";\nimport { print } from \"graphql/language/index.js\";\nimport { boolean } from \"boolean\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay.js\";\nimport { LocalAwsLambdaTimeoutMessage } from \"./NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js\";\nimport { config as appConfig } from \"~/config.js\";\nimport { ErrorOverlay } from \"~/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js\";\nimport { GqlErrorOverlay } from \"./NetworkErrorLinkPlugin/GqlErrorOverlay.js\";\nimport type { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { NetworkErrorEvent } from \"~/errors/index.js\";\n\nconst isLocalAwsLambdaFnInvocationTimeoutError = (error: any): error is ServerError => {\n return error.result && error.result.code === \"LOCAL_AWS_LAMBDA_TIMEOUT\";\n};\n\n/**\n * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.\n */\nexport class NetworkErrorLinkPlugin extends ApolloLinkPlugin {\n constructor(private getEventPublisher: () => EventPublisher.Interface) {\n super();\n }\n\n public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError) {\n // Publish network error event\n const errorType = isLocalAwsLambdaFnInvocationTimeoutError(networkError)\n ? \"timeout\"\n : \"network\";\n\n const event = new NetworkErrorEvent({\n message: networkError.message,\n operationName: operation.operationName,\n query: print(operation.query),\n variables: operation.variables,\n errorType,\n statusCode: (networkError as any).statusCode,\n result: (networkError as any).result\n });\n\n this.getEventPublisher().publish(event);\n\n // Keep existing overlay logic for now\n if (debug) {\n if (isLocalAwsLambdaFnInvocationTimeoutError(networkError)) {\n createErrorOverlay({\n element: (\n <ErrorOverlay\n message={<LocalAwsLambdaTimeoutMessage />}\n closeable={false}\n />\n ),\n closeable: false\n });\n return;\n }\n\n createErrorOverlay({\n element: (\n <GqlErrorOverlay\n query={print(operation.query)}\n networkError={networkError}\n />\n )\n });\n }\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"names":["isLocalAwsLambdaFnInvocationTimeoutError","error","NetworkErrorLinkPlugin","ApolloLinkPlugin","getEventPublisher","onError","networkError","operation","debug","appConfig","boolean","process","errorType","event","NetworkErrorEvent","print","createErrorOverlay","ErrorOverlay","LocalAwsLambdaTimeoutMessage","GqlErrorOverlay"],"mappings":";;;;;;;;;;;AAcA,MAAMA,2CAA2C,CAACC,QACvCA,MAAM,MAAM,IAAIA,AAAsB,+BAAtBA,MAAM,MAAM,CAAC,IAAI;AAMrC,MAAMC,+BAA+BC;IACxC,YAAoBC,iBAAiD,CAAE;QACnE,KAAK,SADWA,iBAAiB,GAAjBA;IAEpB;IAEgB,aAAa;QACzB,OAAOC,QAAQ,CAAC,EAAEC,YAAY,EAAEC,SAAS,EAAE;YACvC,MAAMC,QAAQC,OAAAA,MAAgB,CAAC,SAASC,yBAAQC,QAAQ,GAAG,CAAC,eAAe;YAE3E,IAAIL,cAAc;gBAEd,MAAMM,YAAYZ,yCAAyCM,gBACrD,YACA;gBAEN,MAAMO,QAAQ,IAAIC,kBAAkB;oBAChC,SAASR,aAAa,OAAO;oBAC7B,eAAeC,UAAU,aAAa;oBACtC,OAAOQ,MAAMR,UAAU,KAAK;oBAC5B,WAAWA,UAAU,SAAS;oBAC9BK;oBACA,YAAaN,aAAqB,UAAU;oBAC5C,QAASA,aAAqB,MAAM;gBACxC;gBAEA,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAACO;gBAGjC,IAAIL,OAAO;oBACP,IAAIR,yCAAyCM,eAAe,YACxDU,mBAAmB;wBACf,SAAS,WAAT,GACI,oBAACC,cAAYA;4BACT,uBAAS,oBAACC,8BAA4BA;4BACtC,WAAW;;wBAGnB,WAAW;oBACf;oBAIJF,mBAAmB;wBACf,SAAS,WAAT,GACI,oBAACG,iBAAeA;4BACZ,OAAOJ,MAAMR,UAAU,KAAK;4BAC5B,cAAcD;;oBAG1B;gBACJ;YACJ;QAGJ;IACJ;AACJ"}
@@ -1,21 +1,16 @@
1
1
  import { ApolloLink } from "apollo-link";
2
2
  import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
3
  function omitTypename(key, value) {
4
- return key === "__typename" ? undefined : value;
4
+ return "__typename" === key ? void 0 : value;
5
5
  }
6
-
7
- /**
8
- * This link removes `__typename` from the variables being sent to the API.
9
- */
10
- export class OmitTypenameLinkPlugin extends ApolloLinkPlugin {
11
- createLink() {
12
- return new ApolloLink((operation, forward) => {
13
- if (operation.variables) {
14
- operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
15
- }
16
- return forward(operation);
17
- });
18
- }
6
+ class OmitTypenameLinkPlugin extends ApolloLinkPlugin {
7
+ createLink() {
8
+ return new ApolloLink((operation, forward)=>{
9
+ if (operation.variables) operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);
10
+ return forward(operation);
11
+ });
12
+ }
19
13
  }
14
+ export { OmitTypenameLinkPlugin };
20
15
 
21
16
  //# sourceMappingURL=OmitTypenameLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApolloLink","ApolloLinkPlugin","omitTypename","key","value","undefined","OmitTypenameLinkPlugin","createLink","operation","forward","variables","JSON","parse","stringify"],"sources":["OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,aAAa;AACxC,SAASC,gBAAgB;AAEzB,SAASC,YAAYA,CAACC,GAAW,EAAEC,KAAa,EAAsB;EAClE,OAAOD,GAAG,KAAK,YAAY,GAAGE,SAAS,GAAGD,KAAK;AACnD;;AAEA;AACA;AACA;AACA,OAAO,MAAME,sBAAsB,SAASL,gBAAgB,CAAC;EACzCM,UAAUA,CAAA,EAAe;IACrC,OAAO,IAAIP,UAAU,CAAC,CAACQ,SAAS,EAAEC,OAAO,KAAK;MAC1C,IAAID,SAAS,CAACE,SAAS,EAAE;QACrBF,SAAS,CAACE,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACL,SAAS,CAACE,SAAS,CAAC,EAAER,YAAY,CAAC;MACvF;MACA,OAAOO,OAAO,CAACD,SAAS,CAAC;IAC7B,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"plugins/OmitTypenameLinkPlugin.js","sources":["../../src/plugins/OmitTypenameLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\n\nfunction omitTypename(key: string, value: string): string | undefined {\n return key === \"__typename\" ? undefined : value;\n}\n\n/**\n * This link removes `__typename` from the variables being sent to the API.\n */\nexport class OmitTypenameLinkPlugin extends ApolloLinkPlugin {\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.variables) {\n operation.variables = JSON.parse(JSON.stringify(operation.variables), omitTypename);\n }\n return forward(operation);\n });\n }\n}\n"],"names":["omitTypename","key","value","undefined","OmitTypenameLinkPlugin","ApolloLinkPlugin","ApolloLink","operation","forward","JSON"],"mappings":";;AAGA,SAASA,aAAaC,GAAW,EAAEC,KAAa;IAC5C,OAAOD,AAAQ,iBAARA,MAAuBE,SAAYD;AAC9C;AAKO,MAAME,+BAA+BC;IACxB,aAAyB;QACrC,OAAO,IAAIC,WAAW,CAACC,WAAWC;YAC9B,IAAID,UAAU,SAAS,EACnBA,UAAU,SAAS,GAAGE,KAAK,KAAK,CAACA,KAAK,SAAS,CAACF,UAAU,SAAS,GAAGP;YAE1E,OAAOQ,QAAQD;QACnB;IACJ;AACJ"}
@@ -1,37 +1,28 @@
1
1
  import { setContext } from "apollo-link-context";
2
2
  import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
3
- /**
4
- * Append `x-tenant` header from URL query (necessary for prerendering service).
5
- */
6
- export class TenantHeaderLinkPlugin extends ApolloLinkPlugin {
7
- constructor(tenant) {
8
- super();
9
- this.name = "tenant-header-link";
10
- this.tenant = tenant;
11
- }
12
- createLink() {
13
- return setContext((_, {
14
- headers
15
- }) => {
16
- // If tenant header is already set, do not overwrite it.
17
- if (headers && "x-tenant" in headers) {
18
- return {
19
- headers
20
- };
21
- }
22
- if (this.tenant) {
23
- return {
24
- headers: {
25
- ...headers,
26
- "x-tenant": this.tenant
27
- }
28
- };
29
- }
30
- return {
31
- headers
32
- };
33
- });
34
- }
3
+ class TenantHeaderLinkPlugin extends ApolloLinkPlugin {
4
+ constructor(tenant){
5
+ super();
6
+ this.name = "tenant-header-link";
7
+ this.tenant = tenant;
8
+ }
9
+ createLink() {
10
+ return setContext((_, { headers })=>{
11
+ if (headers && "x-tenant" in headers) return {
12
+ headers
13
+ };
14
+ if (this.tenant) return {
15
+ headers: {
16
+ ...headers,
17
+ "x-tenant": this.tenant
18
+ }
19
+ };
20
+ return {
21
+ headers
22
+ };
23
+ });
24
+ }
35
25
  }
26
+ export { TenantHeaderLinkPlugin };
36
27
 
37
28
  //# sourceMappingURL=TenantHeaderLinkPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["setContext","ApolloLinkPlugin","TenantHeaderLinkPlugin","constructor","tenant","name","createLink","_","headers"],"sources":["TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { ApolloLink } from \"apollo-link\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant;\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,qBAAqB;AAChD,SAASC,gBAAgB;AAGzB;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASD,gBAAgB,CAAC;EAGlDE,WAAWA,CAACC,MAAc,EAAE;IAC/B,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,IAAI,GAAG,oBAAoB;IAEhC,IAAI,CAACD,MAAM,GAAGA,MAAM;EACxB;EAEgBE,UAAUA,CAAA,EAAe;IACrC,OAAON,UAAU,CAAC,CAACO,CAAC,EAAE;MAAEC;IAAQ,CAAC,KAAK;MAClC;MACA,IAAIA,OAAO,IAAI,UAAU,IAAIA,OAAO,EAAE;QAClC,OAAO;UAAEA;QAAQ,CAAC;MACtB;MAEA,IAAI,IAAI,CAACJ,MAAM,EAAE;QACb,OAAO;UACHI,OAAO,EAAE;YACL,GAAGA,OAAO;YACV,UAAU,EAAE,IAAI,CAACJ;UACrB;QACJ,CAAC;MACL;MAEA,OAAO;QAAEI;MAAQ,CAAC;IACtB,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"plugins/TenantHeaderLinkPlugin.js","sources":["../../src/plugins/TenantHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { ApolloLink } from \"apollo-link\";\n\n/**\n * Append `x-tenant` header from URL query (necessary for prerendering service).\n */\nexport class TenantHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly tenant: string;\n\n public constructor(tenant: string) {\n super();\n this.name = \"tenant-header-link\";\n\n this.tenant = tenant;\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n // If tenant header is already set, do not overwrite it.\n if (headers && \"x-tenant\" in headers) {\n return { headers };\n }\n\n if (this.tenant) {\n return {\n headers: {\n ...headers,\n \"x-tenant\": this.tenant\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"names":["TenantHeaderLinkPlugin","ApolloLinkPlugin","tenant","setContext","_","headers"],"mappings":";;AAOO,MAAMA,+BAA+BC;IAGxC,YAAmBC,MAAc,CAAE;QAC/B,KAAK;QACL,IAAI,CAAC,IAAI,GAAG;QAEZ,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEgB,aAAyB;QACrC,OAAOC,WAAW,CAACC,GAAG,EAAEC,OAAO,EAAE;YAE7B,IAAIA,WAAW,cAAcA,SACzB,OAAO;gBAAEA;YAAQ;YAGrB,IAAI,IAAI,CAAC,MAAM,EACX,OAAO;gBACH,SAAS;oBACL,GAAGA,OAAO;oBACV,YAAY,IAAI,CAAC,MAAM;gBAC3B;YACJ;YAGJ,OAAO;gBAAEA;YAAQ;QACrB;IACJ;AACJ"}