@webiny/app 6.3.0-beta.4 → 6.4.0-beta.0
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.
- package/App.js +70 -77
- package/App.js.map +1 -1
- package/AppContainer.js +3 -6
- package/AppContainer.js.map +1 -1
- package/apollo-client/InMemoryCache.js +11 -13
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.js +26 -38
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
- package/components/Image.js +11 -17
- package/components/Image.js.map +1 -1
- package/components/index.js +0 -2
- package/config/RouterConfig/Route.js +23 -28
- package/config/RouterConfig/Route.js.map +1 -1
- package/config/RouterConfig.js +11 -10
- package/config/RouterConfig.js.map +1 -1
- package/config.js +19 -20
- package/config.js.map +1 -1
- package/contexts/Ui/index.js +26 -28
- package/contexts/Ui/index.js.map +1 -1
- package/core/Plugin.js +7 -9
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.js +15 -34
- package/core/Plugins.js.map +1 -1
- package/core/Provider.js +5 -13
- package/core/Provider.js.map +1 -1
- package/core/createProvider.js +3 -6
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.js +8 -13
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.js +8 -5
- package/errors/AuthenticationErrorEvent.js.map +1 -1
- package/errors/NetworkErrorEvent.js +8 -5
- package/errors/NetworkErrorEvent.js.map +1 -1
- package/errors/abstractions.js +3 -2
- package/errors/abstractions.js.map +1 -1
- package/errors/index.js +1 -4
- package/exports/admin/env-config.js +0 -2
- package/exports/admin/graphql-client.js +0 -2
- package/exports/admin/local-storage.js +0 -2
- package/exports/admin/router.js +0 -2
- package/exports/admin/security.js +0 -2
- package/exports/admin.js +0 -2
- package/features/envConfig/EnvConfig.js +12 -13
- package/features/envConfig/EnvConfig.js.map +1 -1
- package/features/envConfig/abstractions.js +2 -1
- package/features/envConfig/abstractions.js.map +1 -1
- package/features/envConfig/feature.js +9 -8
- package/features/envConfig/feature.js.map +1 -1
- package/features/envConfig/index.js +0 -2
- package/features/eventPublisher/EventPublisher.js +13 -21
- package/features/eventPublisher/EventPublisher.js.map +1 -1
- package/features/eventPublisher/abstractions.js +7 -9
- package/features/eventPublisher/abstractions.js.map +1 -1
- package/features/eventPublisher/feature.js +13 -12
- package/features/eventPublisher/feature.js.map +1 -1
- package/features/eventPublisher/index.js +1 -3
- package/features/graphqlClient/AuthenticationErrorPublishing.js +26 -26
- package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -1
- package/features/graphqlClient/BatchingGraphQLClient.js +104 -149
- package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -1
- package/features/graphqlClient/FetchGraphQLClient.js +41 -48
- package/features/graphqlClient/FetchGraphQLClient.js.map +1 -1
- package/features/graphqlClient/NetworkErrorPublishing.js +35 -42
- package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -1
- package/features/graphqlClient/RequestValue.js +42 -41
- package/features/graphqlClient/RequestValue.js.map +1 -1
- package/features/graphqlClient/RetryGraphQLClient.js +36 -45
- package/features/graphqlClient/RetryGraphQLClient.js.map +1 -1
- package/features/graphqlClient/__tests__/GraphQLClient.test.js +383 -356
- package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -1
- package/features/graphqlClient/abstractions.js +2 -1
- package/features/graphqlClient/abstractions.js.map +1 -1
- package/features/graphqlClient/feature.js +14 -20
- package/features/graphqlClient/feature.js.map +1 -1
- package/features/graphqlClient/index.js +0 -2
- package/features/graphqlClient/types.js +0 -3
- package/features/localStorage/BrowserLocalStorageGateway.js +56 -63
- package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -1
- package/features/localStorage/LocalStorage.js +27 -24
- package/features/localStorage/LocalStorage.js.map +1 -1
- package/features/localStorage/LocalStorageRepository.js +75 -88
- package/features/localStorage/LocalStorageRepository.js.map +1 -1
- package/features/localStorage/abstractions.js +5 -16
- package/features/localStorage/abstractions.js.map +1 -1
- package/features/localStorage/feature.js +17 -28
- package/features/localStorage/feature.js.map +1 -1
- package/features/localStorage/index.js +1 -3
- package/features/mainGraphQLClient/MainGraphQLClient.js +18 -14
- package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -1
- package/features/mainGraphQLClient/abstractions.js +2 -1
- package/features/mainGraphQLClient/abstractions.js.map +1 -1
- package/features/mainGraphQLClient/feature.js +11 -10
- package/features/mainGraphQLClient/feature.js.map +1 -1
- package/features/mainGraphQLClient/index.js +0 -2
- package/features/router/HistoryRouterGateway.js +75 -105
- package/features/router/HistoryRouterGateway.js.map +1 -1
- package/features/router/HistoryRouterGateway.test.js +184 -193
- package/features/router/HistoryRouterGateway.test.js.map +1 -1
- package/features/router/Route.js +38 -54
- package/features/router/Route.js.map +1 -1
- package/features/router/RouteUrl.js +84 -217
- package/features/router/RouteUrl.js.map +1 -1
- package/features/router/Router.js +67 -124
- package/features/router/Router.js.map +1 -1
- package/features/router/RouterPresenter.js +44 -49
- package/features/router/RouterPresenter.js.map +1 -1
- package/features/router/RouterRepository.js +103 -111
- package/features/router/RouterRepository.js.map +1 -1
- package/features/router/RouterRepository.test.js +119 -150
- package/features/router/RouterRepository.test.js.map +1 -1
- package/features/router/abstractions.js +4 -14
- package/features/router/abstractions.js.map +1 -1
- package/features/router/feature.js +13 -12
- package/features/router/feature.js.map +1 -1
- package/features/router/index.js +1 -3
- package/helpers/InterfaceGenerator/date.js +0 -3
- package/helpers/InterfaceGenerator/id.js +0 -3
- package/helpers/InterfaceGenerator/identity.js +0 -3
- package/helpers/InterfaceGenerator/index.js +0 -3
- package/helpers/InterfaceGenerator/numeric.js +0 -3
- package/helpers/InterfaceGenerator/truthful.js +0 -3
- package/hooks/useAutocomplete/index.js +0 -2
- package/hooks/useAutocomplete/useAutocomplete.js +12 -15
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +2 -1
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +2 -1
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +2 -1
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.js +0 -2
- package/hooks/useDataList/functions/searchDataByKey.js +9 -14
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.js +0 -2
- package/hooks/useDataList/useDataList.js +131 -152
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.js +0 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +25 -34
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useHandler.js +12 -16
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.js +18 -20
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.js +7 -6
- package/hooks/useRegisterLegacyPlugin.js.map +1 -1
- package/hooks/useUi.js +2 -3
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +8 -4
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.js +0 -2
- package/index.js +6 -11
- package/package.json +13 -13
- package/plugins/AddQuerySelectionPlugin.js +36 -61
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +12 -11
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.js +20 -22
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.js +16 -15
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.js +19 -21
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +39 -45
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +18 -22
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +21 -29
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +6 -15
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/Typography.js +9 -14
- package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +11 -18
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.js +41 -58
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +9 -14
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.js +23 -32
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/components/Image.js +8 -15
- package/plugins/components/Image.js.map +1 -1
- package/plugins/image.js +94 -133
- package/plugins/image.js.map +1 -1
- package/plugins/index.js +35 -59
- package/plugins/index.js.map +1 -1
- package/presentation/envConfig/useEnvConfig.js +4 -8
- package/presentation/envConfig/useEnvConfig.js.map +1 -1
- package/presentation/localStorage/index.js +0 -2
- package/presentation/localStorage/useLocalStorage.js +10 -16
- package/presentation/localStorage/useLocalStorage.js.map +1 -1
- package/presentation/localStorage/useLocalStorageValue.js +15 -13
- package/presentation/localStorage/useLocalStorageValue.js.map +1 -1
- package/presentation/localStorage/useLocalStorageValues.js +23 -30
- package/presentation/localStorage/useLocalStorageValues.js.map +1 -1
- package/presentation/router/RouteElementRegistry.js +22 -25
- package/presentation/router/RouteElementRegistry.js.map +1 -1
- package/presentation/router/abstractions.js +2 -1
- package/presentation/router/abstractions.js.map +1 -1
- package/presentation/router/components/Redirect.js +8 -10
- package/presentation/router/components/Redirect.js.map +1 -1
- package/presentation/router/components/RouteContent.js +14 -17
- package/presentation/router/components/RouteContent.js.map +1 -1
- package/presentation/router/components/RouteLink.js +11 -16
- package/presentation/router/components/RouteLink.js.map +1 -1
- package/presentation/router/components/SimpleLink.js +18 -24
- package/presentation/router/components/SimpleLink.js.map +1 -1
- package/presentation/router/hooks/useRoute.js +15 -23
- package/presentation/router/hooks/useRoute.js.map +1 -1
- package/presentation/router/hooks/useRouter.js +22 -23
- package/presentation/router/hooks/useRouter.js.map +1 -1
- package/presentation/router/index.js +0 -2
- package/presentation/router/types.js +0 -3
- package/react-butterfiles/Files.js +148 -217
- package/react-butterfiles/Files.js.map +1 -1
- package/react-butterfiles/index.js +2 -1
- package/react-butterfiles/index.js.map +1 -1
- package/react-butterfiles/utils/generateId.js +2 -3
- package/react-butterfiles/utils/generateId.js.map +1 -1
- package/react-butterfiles/utils/readFileContent.js +9 -13
- package/react-butterfiles/utils/readFileContent.js.map +1 -1
- package/renderApp.js +7 -6
- package/renderApp.js.map +1 -1
- package/router.js +0 -3
- package/rslib-runtime.js +14 -0
- package/rslib-runtime.js.map +1 -0
- package/shared/di/DiContainerProvider.js +8 -12
- package/shared/di/DiContainerProvider.js.map +1 -1
- package/shared/di/createFeature.js +7 -8
- package/shared/di/createFeature.js.map +1 -1
- package/shared/di/useFeature.js +7 -3
- package/shared/di/useFeature.js.map +1 -1
- package/static/svg/close_24px.33adaadc.svg +1 -0
- package/types.js +0 -3
- package/utils/createGenericContext.js +17 -21
- package/utils/createGenericContext.js.map +1 -1
- package/utils/createHashing.js +13 -16
- package/utils/createHashing.js.map +1 -1
- package/utils/index.js +0 -2
- package/utils/legacyPluginToReactComponent.js +11 -10
- package/utils/legacyPluginToReactComponent.js.map +1 -1
- package/components/index.js.map +0 -1
- package/errors/index.js.map +0 -1
- package/exports/admin/env-config.js.map +0 -1
- package/exports/admin/graphql-client.js.map +0 -1
- package/exports/admin/local-storage.js.map +0 -1
- package/exports/admin/router.js.map +0 -1
- package/exports/admin/security.js.map +0 -1
- package/exports/admin.js.map +0 -1
- package/features/envConfig/index.js.map +0 -1
- package/features/eventPublisher/index.js.map +0 -1
- package/features/graphqlClient/index.js.map +0 -1
- package/features/graphqlClient/types.js.map +0 -1
- package/features/localStorage/index.js.map +0 -1
- package/features/mainGraphQLClient/index.js.map +0 -1
- package/features/router/index.js.map +0 -1
- package/helpers/InterfaceGenerator/date.js.map +0 -1
- package/helpers/InterfaceGenerator/id.js.map +0 -1
- package/helpers/InterfaceGenerator/identity.js.map +0 -1
- package/helpers/InterfaceGenerator/index.js.map +0 -1
- package/helpers/InterfaceGenerator/numeric.js.map +0 -1
- package/helpers/InterfaceGenerator/truthful.js.map +0 -1
- package/hooks/useAutocomplete/index.js.map +0 -1
- package/hooks/useDataList/functions/index.js.map +0 -1
- package/hooks/useDataList/index.js.map +0 -1
- package/hooks/useDataList/utils/index.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/presentation/localStorage/index.js.map +0 -1
- package/presentation/router/index.js.map +0 -1
- package/presentation/router/types.js.map +0 -1
- package/router.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/index.js.map +0 -1
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
networkError
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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,"
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,"
|
|
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 \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 command? If so, please restart the command or deploy your changes via the \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 command. For example: <Code>yarn webiny deploy api --env dev</Code>.\n <br />\n <br />\n Learn more: \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
|
|
2
|
-
|
|
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
|
-
|
|
54
|
-
|
|
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
|
-
|
|
66
|
+
`);
|
|
67
|
+
export { OverlayWrapper, Pre };
|
|
77
68
|
|
|
78
69
|
//# sourceMappingURL=StyledComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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,"
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
12
|
+
const NetworkErrorLinkPlugin_createErrorOverlay = createErrorOverlay;
|
|
13
|
+
export default NetworkErrorLinkPlugin_createErrorOverlay;
|
|
21
14
|
|
|
22
15
|
//# sourceMappingURL=createErrorOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
|
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
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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,"
|
|
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
|
-
|
|
4
|
+
return "__typename" === key ? void 0 : value;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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,"
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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,"
|
|
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"}
|