@webiny/app 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e
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.d.ts +5 -6
- package/App.js +75 -88
- package/App.js.map +1 -1
- package/AppContainer.js +3 -6
- package/AppContainer.js.map +1 -1
- package/README.md +7 -15
- package/components/Image.d.ts +1 -2
- package/components/Image.js +12 -18
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -4
- package/config/RouterConfig/Route.d.ts +9 -10
- package/config/RouterConfig/Route.js +23 -37
- package/config/RouterConfig/Route.js.map +1 -1
- package/config/RouterConfig.d.ts +11 -14
- package/config/RouterConfig.js +12 -11
- 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.d.ts +1 -1
- package/core/Plugin.js +9 -11
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.d.ts +4 -3
- package/core/Plugins.js +18 -36
- package/core/Plugins.js.map +1 -1
- package/core/Provider.d.ts +1 -1
- package/core/Provider.js +6 -14
- package/core/Provider.js.map +1 -1
- package/core/createProvider.js +3 -6
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.js +9 -14
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.d.ts +9 -0
- package/errors/AuthenticationErrorEvent.js +13 -0
- package/errors/AuthenticationErrorEvent.js.map +1 -0
- package/errors/NetworkErrorEvent.d.ts +15 -0
- package/errors/NetworkErrorEvent.js +13 -0
- package/errors/NetworkErrorEvent.js.map +1 -0
- package/errors/abstractions.d.ts +12 -0
- package/errors/abstractions.js +6 -0
- package/errors/abstractions.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.js +3 -0
- package/errors/overlay/ErrorOverlay.d.ts +9 -0
- package/errors/overlay/ErrorOverlay.js +43 -0
- package/errors/overlay/ErrorOverlay.js.map +1 -0
- package/{plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts → errors/overlay/GqlErrorOverlay.d.ts} +2 -2
- package/errors/overlay/GqlErrorOverlay.js +27 -0
- package/errors/overlay/GqlErrorOverlay.js.map +1 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.js +20 -0
- package/errors/overlay/LocalAwsLambdaTimeoutMessage.js.map +1 -0
- package/errors/overlay/StyledComponents.d.ts +7 -0
- package/errors/overlay/StyledComponents.js +10 -0
- package/errors/overlay/StyledComponents.js.map +1 -0
- package/errors/overlay/Typography.d.ts +8 -0
- package/errors/overlay/Typography.js +13 -0
- package/errors/overlay/Typography.js.map +1 -0
- package/errors/overlay/assets/close_24px.js +19 -0
- package/errors/overlay/assets/close_24px.js.map +1 -0
- package/errors/overlay/createErrorOverlay.d.ts +7 -0
- package/errors/overlay/createErrorOverlay.js +15 -0
- package/errors/overlay/createErrorOverlay.js.map +1 -0
- package/exports/admin/env-config.d.ts +2 -0
- package/exports/admin/env-config.js +2 -0
- package/exports/admin/graphql-client.d.ts +1 -0
- package/exports/admin/graphql-client.js +1 -0
- package/exports/admin/local-storage.d.ts +2 -0
- package/exports/admin/local-storage.js +2 -0
- package/exports/admin/router.d.ts +5 -0
- package/exports/admin/router.js +5 -0
- package/exports/admin/security.d.ts +1 -0
- package/exports/admin/security.js +1 -0
- package/exports/admin.d.ts +8 -0
- package/exports/admin.js +8 -0
- package/features/apiStreamClient/FetchApiStreamClient.d.ts +9 -0
- package/features/apiStreamClient/FetchApiStreamClient.js +63 -0
- package/features/apiStreamClient/FetchApiStreamClient.js.map +1 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.d.ts +1 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js +170 -0
- package/features/apiStreamClient/__tests__/FetchApiStreamClient.test.js.map +1 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.d.ts +1 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.js +160 -0
- package/features/apiStreamClient/__tests__/readServerSentEvents.test.js.map +1 -0
- package/features/apiStreamClient/abstractions.d.ts +44 -0
- package/features/apiStreamClient/abstractions.js +10 -0
- package/features/apiStreamClient/abstractions.js.map +1 -0
- package/features/apiStreamClient/feature.d.ts +3 -0
- package/features/apiStreamClient/feature.js +17 -0
- package/features/apiStreamClient/feature.js.map +1 -0
- package/features/apiStreamClient/index.d.ts +5 -0
- package/features/apiStreamClient/index.js +5 -0
- package/features/apiStreamClient/readServerSentEvents.d.ts +10 -0
- package/features/apiStreamClient/readServerSentEvents.js +29 -0
- package/features/apiStreamClient/readServerSentEvents.js.map +1 -0
- package/features/apiStreamClient/toPayloadHash.d.ts +14 -0
- package/features/apiStreamClient/toPayloadHash.js +7 -0
- package/features/apiStreamClient/toPayloadHash.js.map +1 -0
- package/features/envConfig/EnvConfig.d.ts +7 -0
- package/features/envConfig/EnvConfig.js +16 -0
- package/features/envConfig/EnvConfig.js.map +1 -0
- package/features/envConfig/abstractions.d.ts +28 -0
- package/features/envConfig/abstractions.js +5 -0
- package/features/envConfig/abstractions.js.map +1 -0
- package/features/envConfig/feature.d.ts +17 -0
- package/features/envConfig/feature.js +15 -0
- package/features/envConfig/feature.js.map +1 -0
- package/features/envConfig/index.d.ts +1 -0
- package/features/envConfig/index.js +1 -0
- package/features/eventPublisher/EventPublisher.d.ts +8 -0
- package/features/eventPublisher/EventPublisher.js +19 -0
- package/features/eventPublisher/EventPublisher.js.map +1 -0
- package/features/eventPublisher/abstractions.d.ts +18 -0
- package/features/eventPublisher/abstractions.js +12 -0
- package/features/eventPublisher/abstractions.js.map +1 -0
- package/features/eventPublisher/feature.d.ts +3 -0
- package/features/eventPublisher/feature.js +17 -0
- package/features/eventPublisher/feature.js.map +1 -0
- package/features/eventPublisher/index.d.ts +3 -0
- package/features/eventPublisher/index.js +2 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.d.ts +13 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.js +35 -0
- package/features/graphqlClient/AuthenticationErrorPublishing.js.map +1 -0
- package/features/graphqlClient/BatchingGraphQLClient.d.ts +16 -0
- package/features/graphqlClient/BatchingGraphQLClient.js +118 -0
- package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
- package/features/graphqlClient/FetchGraphQLClient.d.ts +7 -0
- package/features/graphqlClient/FetchGraphQLClient.js +51 -0
- package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
- package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
- package/features/graphqlClient/NetworkErrorPublishing.js +48 -0
- package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
- package/features/graphqlClient/RequestValue.d.ts +21 -0
- package/features/graphqlClient/RequestValue.js +46 -0
- package/features/graphqlClient/RequestValue.js.map +1 -0
- package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
- package/features/graphqlClient/RetryGraphQLClient.js +45 -0
- package/features/graphqlClient/RetryGraphQLClient.js.map +1 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.d.ts +1 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.js +471 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
- package/features/graphqlClient/abstractions.d.ts +18 -0
- package/features/graphqlClient/abstractions.js +5 -0
- package/features/graphqlClient/abstractions.js.map +1 -0
- package/features/graphqlClient/feature.d.ts +6 -0
- package/features/graphqlClient/feature.js +25 -0
- package/features/graphqlClient/feature.js.map +1 -0
- package/features/graphqlClient/index.d.ts +1 -0
- package/features/graphqlClient/index.js +1 -0
- package/features/graphqlClient/types.d.ts +5 -0
- package/features/graphqlClient/types.js +0 -0
- package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
- package/features/localStorage/BrowserLocalStorageGateway.js +61 -0
- package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
- package/features/localStorage/LocalStorage.d.ts +12 -0
- package/features/localStorage/LocalStorage.js +34 -0
- package/features/localStorage/LocalStorage.js.map +1 -0
- package/features/localStorage/LocalStorageRepository.d.ts +20 -0
- package/features/localStorage/LocalStorageRepository.js +82 -0
- package/features/localStorage/LocalStorageRepository.js.map +1 -0
- package/features/localStorage/abstractions.d.ts +48 -0
- package/features/localStorage/abstractions.js +8 -0
- package/features/localStorage/abstractions.js.map +1 -0
- package/features/localStorage/feature.d.ts +12 -0
- package/features/localStorage/feature.js +23 -0
- package/features/localStorage/feature.js.map +1 -0
- package/features/localStorage/index.d.ts +1 -0
- package/features/localStorage/index.js +1 -0
- package/features/mainGraphQLClient/MainGraphQLClient.d.ts +11 -0
- package/features/mainGraphQLClient/MainGraphQLClient.js +27 -0
- package/features/mainGraphQLClient/MainGraphQLClient.js.map +1 -0
- package/features/mainGraphQLClient/abstractions.d.ts +17 -0
- package/features/mainGraphQLClient/abstractions.js +5 -0
- package/features/mainGraphQLClient/abstractions.js.map +1 -0
- package/features/mainGraphQLClient/feature.d.ts +3 -0
- package/features/mainGraphQLClient/feature.js +17 -0
- package/features/mainGraphQLClient/feature.js.map +1 -0
- package/features/mainGraphQLClient/index.d.ts +1 -0
- package/features/mainGraphQLClient/index.js +1 -0
- package/features/router/HistoryRouterGateway.d.ts +25 -0
- package/features/router/HistoryRouterGateway.js +100 -0
- package/features/router/HistoryRouterGateway.js.map +1 -0
- package/features/router/HistoryRouterGateway.test.d.ts +1 -0
- package/features/router/HistoryRouterGateway.test.js +195 -0
- package/features/router/HistoryRouterGateway.test.js.map +1 -0
- package/features/router/Route.d.ts +19 -0
- package/features/router/Route.js +43 -0
- package/features/router/Route.js.map +1 -0
- package/features/router/RouteUrl.d.ts +85 -0
- package/features/router/RouteUrl.js +99 -0
- package/features/router/RouteUrl.js.map +1 -0
- package/features/router/Router.d.ts +45 -0
- package/features/router/Router.js +72 -0
- package/features/router/Router.js.map +1 -0
- package/features/router/RouterPresenter.d.ts +23 -0
- package/features/router/RouterPresenter.js +62 -0
- package/features/router/RouterPresenter.js.map +1 -0
- package/features/router/RouterRepository.d.ts +32 -0
- package/features/router/RouterRepository.js +123 -0
- package/features/router/RouterRepository.js.map +1 -0
- package/features/router/RouterRepository.test.d.ts +1 -0
- package/features/router/RouterRepository.test.js +138 -0
- package/features/router/RouterRepository.test.js.map +1 -0
- package/features/router/abstractions.d.ts +90 -0
- package/features/router/abstractions.js +7 -0
- package/features/router/abstractions.js.map +1 -0
- package/features/router/feature.d.ts +4 -0
- package/features/router/feature.js +19 -0
- package/features/router/feature.js.map +1 -0
- package/features/router/index.d.ts +2 -0
- package/features/router/index.js +1 -0
- package/helpers/InterfaceGenerator/date.d.ts +15 -0
- package/helpers/InterfaceGenerator/date.js +0 -0
- package/helpers/InterfaceGenerator/id.d.ts +23 -0
- package/helpers/InterfaceGenerator/id.js +0 -0
- package/helpers/InterfaceGenerator/identity.d.ts +10 -0
- package/helpers/InterfaceGenerator/identity.js +0 -0
- package/helpers/InterfaceGenerator/index.d.ts +5 -0
- package/helpers/InterfaceGenerator/index.js +0 -0
- package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
- package/helpers/InterfaceGenerator/numeric.js +0 -0
- package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
- package/helpers/InterfaceGenerator/truthful.js +0 -0
- 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.d.ts +1 -1
- package/hooks/useRegisterLegacyPlugin.js +7 -6
- package/hooks/useRegisterLegacyPlugin.js.map +1 -1
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +3 -4
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +8 -4
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -3
- package/index.d.ts +20 -15
- package/index.js +19 -19
- package/package.json +34 -42
- package/plugins/components/Image.d.ts +6 -0
- package/plugins/components/Image.js +12 -0
- package/plugins/components/Image.js.map +1 -0
- package/plugins/image.d.ts +2 -2
- package/plugins/image.js +95 -134
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +3 -3
- package/plugins/index.js +35 -59
- package/plugins/index.js.map +1 -1
- package/presentation/envConfig/useEnvConfig.d.ts +6 -0
- package/presentation/envConfig/useEnvConfig.js +9 -0
- package/presentation/envConfig/useEnvConfig.js.map +1 -0
- package/presentation/localStorage/index.d.ts +3 -0
- package/presentation/localStorage/index.js +3 -0
- package/presentation/localStorage/useLocalStorage.d.ts +6 -0
- package/presentation/localStorage/useLocalStorage.js +15 -0
- package/presentation/localStorage/useLocalStorage.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
- package/presentation/localStorage/useLocalStorageValue.js +22 -0
- package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
- package/presentation/localStorage/useLocalStorageValues.js +32 -0
- package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
- package/presentation/router/RouteElementRegistry.d.ts +14 -0
- package/presentation/router/RouteElementRegistry.js +29 -0
- package/presentation/router/RouteElementRegistry.js.map +1 -0
- package/presentation/router/abstractions.d.ts +13 -0
- package/presentation/router/abstractions.js +5 -0
- package/presentation/router/abstractions.js.map +1 -0
- package/presentation/router/components/Redirect.d.ts +14 -0
- package/presentation/router/components/Redirect.js +13 -0
- package/presentation/router/components/Redirect.js.map +1 -0
- package/presentation/router/components/RouteContent.d.ts +2 -0
- package/presentation/router/components/RouteContent.js +20 -0
- package/presentation/router/components/RouteContent.js.map +1 -0
- package/presentation/router/components/RouteLink.d.ts +50 -0
- package/presentation/router/components/RouteLink.js +17 -0
- package/presentation/router/components/RouteLink.js.map +1 -0
- package/presentation/router/components/RouteParamsSync.d.ts +22 -0
- package/presentation/router/components/RouteParamsSync.js +53 -0
- package/presentation/router/components/RouteParamsSync.js.map +1 -0
- package/presentation/router/components/SimpleLink.d.ts +44 -0
- package/presentation/router/components/SimpleLink.js +24 -0
- package/presentation/router/components/SimpleLink.js.map +1 -0
- package/presentation/router/hooks/useRoute.d.ts +7 -0
- package/presentation/router/hooks/useRoute.js +23 -0
- package/presentation/router/hooks/useRoute.js.map +1 -0
- package/presentation/router/hooks/useRouter.d.ts +12 -0
- package/presentation/router/hooks/useRouter.js +30 -0
- package/presentation/router/hooks/useRouter.js.map +1 -0
- package/presentation/router/index.d.ts +6 -0
- package/presentation/router/index.js +4 -0
- package/presentation/router/types.d.ts +5 -0
- package/presentation/router/types.js +0 -0
- package/renderApp.d.ts +1 -1
- package/renderApp.js +7 -6
- package/renderApp.js.map +1 -1
- package/router.d.ts +5 -0
- package/router.js +5 -0
- package/rslib-runtime.js +14 -0
- package/rslib-runtime.js.map +1 -0
- package/shared/di/DiContainerProvider.d.ts +8 -0
- package/shared/di/DiContainerProvider.js +13 -0
- package/shared/di/DiContainerProvider.js.map +1 -0
- package/shared/di/createFeature.d.ts +11 -0
- package/shared/di/createFeature.js +10 -0
- package/shared/di/createFeature.js.map +1 -0
- package/shared/di/useFeature.d.ts +2 -0
- package/shared/di/useFeature.js +12 -0
- package/shared/di/useFeature.js.map +1 -0
- package/static/svg/close_24px.33adaadc.svg +1 -0
- package/types.d.ts +6 -24
- package/types.js +0 -14
- 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.d.ts +2 -10
- package/utils/index.js +2 -12
- package/utils/legacyPluginToReactComponent.js +12 -11
- package/utils/legacyPluginToReactComponent.js.map +1 -1
- package/apollo-client/InMemoryCache.d.ts +0 -8
- package/apollo-client/InMemoryCache.js +0 -20
- package/apollo-client/InMemoryCache.js.map +0 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +0 -11
- package/apollo-client/IntrospectionFragmentMatcher.js +0 -45
- package/apollo-client/IntrospectionFragmentMatcher.js.map +0 -1
- package/components/Routes.d.ts +0 -2
- package/components/Routes.js +0 -36
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -19
- package/components/View.js.map +0 -1
- package/components/index.js.map +0 -1
- package/core/DebounceRender.d.ts +0 -12
- package/core/DebounceRender.js +0 -31
- package/core/DebounceRender.js.map +0 -1
- package/core/Routes.d.ts +0 -6
- package/core/Routes.js +0 -34
- package/core/Routes.js.map +0 -1
- package/hooks/useAutocomplete/index.d.ts +0 -1
- package/hooks/useAutocomplete/index.js +0 -3
- package/hooks/useAutocomplete/index.js.map +0 -1
- package/hooks/useAutocomplete/useAutocomplete.d.ts +0 -11
- package/hooks/useAutocomplete/useAutocomplete.js +0 -23
- package/hooks/useAutocomplete/useAutocomplete.js.map +0 -1
- package/hooks/useDataList/functions/getData.d.ts +0 -2
- package/hooks/useDataList/functions/getData.js +0 -4
- package/hooks/useDataList/functions/getData.js.map +0 -1
- package/hooks/useDataList/functions/getError.d.ts +0 -2
- package/hooks/useDataList/functions/getError.js +0 -4
- package/hooks/useDataList/functions/getError.js.map +0 -1
- package/hooks/useDataList/functions/getMeta.d.ts +0 -2
- package/hooks/useDataList/functions/getMeta.js +0 -4
- package/hooks/useDataList/functions/getMeta.js.map +0 -1
- package/hooks/useDataList/functions/index.d.ts +0 -3
- package/hooks/useDataList/functions/index.js +0 -5
- package/hooks/useDataList/functions/index.js.map +0 -1
- package/hooks/useDataList/functions/searchDataByKey.d.ts +0 -2
- package/hooks/useDataList/functions/searchDataByKey.js +0 -18
- package/hooks/useDataList/functions/searchDataByKey.js.map +0 -1
- package/hooks/useDataList/index.d.ts +0 -1
- package/hooks/useDataList/index.js +0 -3
- package/hooks/useDataList/index.js.map +0 -1
- package/hooks/useDataList/useDataList.d.ts +0 -36
- package/hooks/useDataList/useDataList.js +0 -183
- package/hooks/useDataList/useDataList.js.map +0 -1
- package/hooks/useDataList/utils/index.d.ts +0 -2
- package/hooks/useDataList/utils/index.js +0 -4
- package/hooks/useDataList/utils/index.js.map +0 -1
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +0 -10
- package/hooks/useDataList/utils/prepareLoadListParams.js +0 -38
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +0 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -26
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
- package/hooks/useDataList/utils/types.d.ts +0 -40
- package/hooks/useDataList/utils/types.js +0 -3
- package/hooks/useDataList/utils/types.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/plugins/AddQuerySelectionPlugin.d.ts +0 -22
- package/plugins/AddQuerySelectionPlugin.js +0 -72
- package/plugins/AddQuerySelectionPlugin.js.map +0 -1
- package/plugins/ApolloCacheObjectIdPlugin.d.ts +0 -15
- package/plugins/ApolloCacheObjectIdPlugin.js +0 -16
- package/plugins/ApolloCacheObjectIdPlugin.js.map +0 -1
- package/plugins/ApolloDynamicLink.d.ts +0 -7
- package/plugins/ApolloDynamicLink.js +0 -31
- package/plugins/ApolloDynamicLink.js.map +0 -1
- package/plugins/ApolloLinkPlugin.d.ts +0 -13
- package/plugins/ApolloLinkPlugin.js +0 -22
- package/plugins/ApolloLinkPlugin.js.map +0 -1
- package/plugins/ConsoleLinkPlugin.d.ts +0 -8
- package/plugins/ConsoleLinkPlugin.js +0 -26
- package/plugins/ConsoleLinkPlugin.js.map +0 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
- package/plugins/LocaleHeaderLinkPlugin.js +0 -32
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +0 -66
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +0 -9
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -78
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +0 -7
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +0 -31
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +0 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +0 -7
- package/plugins/NetworkErrorLinkPlugin.js +0 -30
- package/plugins/NetworkErrorLinkPlugin.js.map +0 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +0 -8
- package/plugins/OmitTypenameLinkPlugin.js +0 -21
- package/plugins/OmitTypenameLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -16
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +0 -10
- package/plugins/TenantHeaderLinkPlugin.js +0 -39
- package/plugins/TenantHeaderLinkPlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -19
- package/plugins/ViewPlugin.js.map +0 -1
- package/react-butterfiles/Files.d.ts +0 -69
- package/react-butterfiles/Files.js +0 -227
- package/react-butterfiles/Files.js.map +0 -1
- package/react-butterfiles/index.d.ts +0 -2
- package/react-butterfiles/index.js +0 -4
- package/react-butterfiles/index.js.map +0 -1
- package/react-butterfiles/utils/generateId.d.ts +0 -1
- package/react-butterfiles/utils/generateId.js +0 -5
- package/react-butterfiles/utils/generateId.js.map +0 -1
- package/react-butterfiles/utils/readFileContent.d.ts +0 -1
- package/react-butterfiles/utils/readFileContent.js +0 -15
- package/react-butterfiles/utils/readFileContent.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getApiUrl.d.ts +0 -1
- package/utils/getApiUrl.js +0 -5
- package/utils/getApiUrl.js.map +0 -1
- package/utils/getGqlApiUrl.d.ts +0 -1
- package/utils/getGqlApiUrl.js +0 -6
- package/utils/getGqlApiUrl.js.map +0 -1
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
- package/utils/getHeadlessCmsGqlApiUrl.js +0 -12
- package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
- package/utils/getLocaleCode.d.ts +0 -6
- package/utils/getLocaleCode.js +0 -33
- package/utils/getLocaleCode.js.map +0 -1
- package/utils/getPrerenderId.d.ts +0 -6
- package/utils/getPrerenderId.js +0 -5
- package/utils/getPrerenderId.js.map +0 -1
- package/utils/getTenantId.d.ts +0 -6
- package/utils/getTenantId.js +0 -45
- package/utils/getTenantId.js.map +0 -1
- package/utils/index.js.map +0 -1
- package/utils/isLocalhost.d.ts +0 -1
- package/utils/isLocalhost.js +0 -7
- package/utils/isLocalhost.js.map +0 -1
- package/utils/isPrerendering.d.ts +0 -1
- package/utils/isPrerendering.js +0 -5
- package/utils/isPrerendering.js.map +0 -1
- /package/{plugins/NetworkErrorLinkPlugin → errors/overlay}/assets/close_24px.svg +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloLink","ApolloLinkPlugin","AddQuerySelectionPlugin","constructor","config","createLink","operation","forward","operationName","addSelectionToQuery","query","document","isProcessed","markProcessed","addSelection","selectionPath","firstQueryDefinition","definitions","selectionSet","tree","selections","fields","split","fieldLoop","field","selection","name","value","push","hasOwnProperty","__webiny__","Set","has","cacheKey","add"],"sources":["AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport type { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast\";\n\ndeclare module \"graphql\" {\n interface DocumentNode {\n __webiny__: Set<string>;\n }\n}\n\ninterface Config {\n operationName: string;\n selectionPath: string;\n addSelection: DocumentNode;\n}\n\nexport class AddQuerySelectionPlugin extends ApolloLinkPlugin {\n private readonly config: Config;\n\n constructor(config: Config) {\n super();\n this.config = config;\n }\n\n public override createLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (operation.operationName !== this.config.operationName) {\n return forward(operation);\n }\n\n this.addSelectionToQuery(operation.operationName, operation.query);\n\n return forward(operation);\n });\n }\n\n public addSelectionToQuery(operationName: string, document: DocumentNode): void {\n if (operationName !== this.config.operationName) {\n return;\n }\n\n // If this plugin already processed the given document (documents are always passed by reference),\n // then we don't want to apply the selection again, to avoid adding duplicate selections.\n if (this.isProcessed(document)) {\n return;\n }\n\n this.markProcessed(document);\n\n const { addSelection, selectionPath } = this.config;\n\n const firstQueryDefinition = document.definitions[0] as ExecutableDefinitionNode;\n if (!firstQueryDefinition) {\n return;\n } else if (!firstQueryDefinition.selectionSet) {\n return;\n }\n\n let tree = firstQueryDefinition.selectionSet.selections as FieldNode[];\n const fields = selectionPath.split(\".\");\n\n fieldLoop: for (const field of fields) {\n for (const selection of tree) {\n if (!selection.selectionSet) {\n continue;\n }\n if (selection.name.value === field) {\n tree = selection.selectionSet.selections as FieldNode[];\n continue fieldLoop;\n }\n }\n // If we get here, it means we didn't find the necessary selection\n return;\n }\n /**\n * We must cast because there are a lot of types that are not intertwined and TS is complaining\n */\n tree.push(\n ...((addSelection.definitions[0] as ExecutableDefinitionNode).selectionSet\n .selections as FieldNode[])\n );\n }\n\n private isProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n return document.__webiny__.has(this.cacheKey);\n }\n\n private markProcessed(document: DocumentNode) {\n if (!document.hasOwnProperty(\"__webiny__\")) {\n document.__webiny__ = new Set();\n }\n\n document.__webiny__.add(this.cacheKey);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,aAAa;AAExC,SAASC,gBAAgB;AAezB,OAAO,MAAMC,uBAAuB,SAASD,gBAAgB,CAAC;EAG1DE,WAAWA,CAACC,MAAc,EAAE;IACxB,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEgBC,UAAUA,CAAA,EAAe;IACrC,OAAO,IAAIL,UAAU,CAAC,CAACM,SAAS,EAAEC,OAAO,KAAK;MAC1C,IAAID,SAAS,CAACE,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;QACvD,OAAOD,OAAO,CAACD,SAAS,CAAC;MAC7B;MAEA,IAAI,CAACG,mBAAmB,CAACH,SAAS,CAACE,aAAa,EAAEF,SAAS,CAACI,KAAK,CAAC;MAElE,OAAOH,OAAO,CAACD,SAAS,CAAC;IAC7B,CAAC,CAAC;EACN;EAEOG,mBAAmBA,CAACD,aAAqB,EAAEG,QAAsB,EAAQ;IAC5E,IAAIH,aAAa,KAAK,IAAI,CAACJ,MAAM,CAACI,aAAa,EAAE;MAC7C;IACJ;;IAEA;IACA;IACA,IAAI,IAAI,CAACI,WAAW,CAACD,QAAQ,CAAC,EAAE;MAC5B;IACJ;IAEA,IAAI,CAACE,aAAa,CAACF,QAAQ,CAAC;IAE5B,MAAM;MAAEG,YAAY;MAAEC;IAAc,CAAC,GAAG,IAAI,CAACX,MAAM;IAEnD,MAAMY,oBAAoB,GAAGL,QAAQ,CAACM,WAAW,CAAC,CAAC,CAA6B;IAChF,IAAI,CAACD,oBAAoB,EAAE;MACvB;IACJ,CAAC,MAAM,IAAI,CAACA,oBAAoB,CAACE,YAAY,EAAE;MAC3C;IACJ;IAEA,IAAIC,IAAI,GAAGH,oBAAoB,CAACE,YAAY,CAACE,UAAyB;IACtE,MAAMC,MAAM,GAAGN,aAAa,CAACO,KAAK,CAAC,GAAG,CAAC;IAEvCC,SAAS,EAAE,KAAK,MAAMC,KAAK,IAAIH,MAAM,EAAE;MACnC,KAAK,MAAMI,SAAS,IAAIN,IAAI,EAAE;QAC1B,IAAI,CAACM,SAAS,CAACP,YAAY,EAAE;UACzB;QACJ;QACA,IAAIO,SAAS,CAACC,IAAI,CAACC,KAAK,KAAKH,KAAK,EAAE;UAChCL,IAAI,GAAGM,SAAS,CAACP,YAAY,CAACE,UAAyB;UACvD,SAASG,SAAS;QACtB;MACJ;MACA;MACA;IACJ;IACA;AACR;AACA;IACQJ,IAAI,CAACS,IAAI,CACL,GAAKd,YAAY,CAACG,WAAW,CAAC,CAAC,CAAC,CAA8BC,YAAY,CACrEE,UACT,CAAC;EACL;EAEQR,WAAWA,CAACD,QAAsB,EAAE;IACxC,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEA,OAAOpB,QAAQ,CAACmB,UAAU,CAACE,GAAG,CAAC,IAAI,CAACC,QAAQ,CAAC;EACjD;EAEQpB,aAAaA,CAACF,QAAsB,EAAE;IAC1C,IAAI,CAACA,QAAQ,CAACkB,cAAc,CAAC,YAAY,CAAC,EAAE;MACxClB,QAAQ,CAACmB,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACnC;IAEApB,QAAQ,CAACmB,UAAU,CAACI,GAAG,CAAC,IAAI,CAACD,QAAQ,CAAC;EAC1C;AACJ","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export interface ApolloCacheObject {
|
|
3
|
-
__typename?: string;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}
|
|
6
|
-
interface ApolloCacheObjectIdPluginCallable<T> {
|
|
7
|
-
(data: T): string | null | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare class ApolloCacheObjectIdPlugin<T extends ApolloCacheObject = ApolloCacheObject> extends Plugin {
|
|
10
|
-
static readonly type: string;
|
|
11
|
-
private readonly _getObjectId?;
|
|
12
|
-
constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>);
|
|
13
|
-
getObjectId(data: T): string | null | undefined;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export class ApolloCacheObjectIdPlugin extends Plugin {
|
|
3
|
-
static type = "cache-get-object-id";
|
|
4
|
-
constructor(getObjectId) {
|
|
5
|
-
super();
|
|
6
|
-
this._getObjectId = getObjectId;
|
|
7
|
-
}
|
|
8
|
-
getObjectId(data) {
|
|
9
|
-
if (typeof this._getObjectId !== "function") {
|
|
10
|
-
throw Error(`You must provide a "getObjectId" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`);
|
|
11
|
-
}
|
|
12
|
-
return this._getObjectId(data);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=ApolloCacheObjectIdPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","ApolloCacheObjectIdPlugin","type","constructor","getObjectId","_getObjectId","data","Error"],"sources":["ApolloCacheObjectIdPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n // A value for `id`, null to prevent normalization, or undefined to continue with defaults.\n (data: T): string | null | undefined;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;AAYxC,OAAO,MAAMC,yBAAyB,SAE5BD,MAAM,CAAC;EACb,OAAgCE,IAAI,GAAW,qBAAqB;EAG7DC,WAAWA,CAACC,WAAkD,EAAE;IACnE,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,YAAY,GAAGD,WAAW;EACnC;EAEOA,WAAWA,CAACE,IAAO,EAAE;IACxB,IAAI,OAAO,IAAI,CAACD,YAAY,KAAK,UAAU,EAAE;MACzC,MAAME,KAAK,CACP,8GACJ,CAAC;IACL;IAEA,OAAO,IAAI,CAACF,YAAY,CAACC,IAAI,CAAC;EAClC;AACJ","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NextLink } from "apollo-link";
|
|
2
|
-
import { ApolloLink } from "apollo-link";
|
|
3
|
-
import type { Operation } from "apollo-link/lib/types";
|
|
4
|
-
export declare class ApolloDynamicLink extends ApolloLink {
|
|
5
|
-
private cache;
|
|
6
|
-
request(operation: Operation, forward: NextLink): any;
|
|
7
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { plugins } from "@webiny/plugins";
|
|
3
|
-
function createLink(plugin) {
|
|
4
|
-
try {
|
|
5
|
-
return plugin.createLink();
|
|
6
|
-
} catch (e) {
|
|
7
|
-
console.error(`Caught an error while executing "createLink" on plugin`, plugin);
|
|
8
|
-
console.error(e);
|
|
9
|
-
}
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
export class ApolloDynamicLink extends ApolloLink {
|
|
13
|
-
cache = new Map();
|
|
14
|
-
request(operation, forward) {
|
|
15
|
-
const linkPlugins = plugins.byType("apollo-link");
|
|
16
|
-
if (!linkPlugins.length) {
|
|
17
|
-
return forward(operation);
|
|
18
|
-
}
|
|
19
|
-
const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(",");
|
|
20
|
-
if (!this.cache.has(cacheKey)) {
|
|
21
|
-
/**
|
|
22
|
-
* We filter out falsy items from the linkPlugins because there might be some error while creating link.
|
|
23
|
-
*/
|
|
24
|
-
const links = linkPlugins.map(createLink).filter(Boolean);
|
|
25
|
-
this.cache.set(cacheKey, ApolloLink.from(links));
|
|
26
|
-
}
|
|
27
|
-
return this.cache.get(cacheKey).request(operation, forward);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=ApolloDynamicLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloLink","plugins","createLink","plugin","e","console","error","ApolloDynamicLink","cache","Map","request","operation","forward","linkPlugins","byType","length","cacheKey","map","pl","join","has","links","filter","Boolean","set","from","get"],"sources":["ApolloDynamicLink.ts"],"sourcesContent":["import type { NextLink } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { Operation } from \"apollo-link/lib/types\";\n\nfunction createLink(plugin: ApolloLinkPlugin) {\n try {\n return plugin.createLink();\n } catch (e) {\n console.error(`Caught an error while executing \"createLink\" on plugin`, plugin);\n console.error(e);\n }\n return null;\n}\n\nexport class ApolloDynamicLink extends ApolloLink {\n private cache = new Map();\n\n public override request(operation: Operation, forward: NextLink) {\n const linkPlugins = plugins.byType<ApolloLinkPlugin>(\"apollo-link\");\n\n if (!linkPlugins.length) {\n return forward(operation);\n }\n\n const cacheKey = linkPlugins.map(pl => pl.cacheKey).join(\",\");\n\n if (!this.cache.has(cacheKey)) {\n /**\n * We filter out falsy items from the linkPlugins because there might be some error while creating link.\n */\n const links = linkPlugins.map(createLink).filter(Boolean) as ApolloLink[];\n this.cache.set(cacheKey, ApolloLink.from(links));\n }\n\n return this.cache.get(cacheKey).request(operation, forward);\n }\n}\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,SAASC,OAAO,QAAQ,iBAAiB;AAIzC,SAASC,UAAUA,CAACC,MAAwB,EAAE;EAC1C,IAAI;IACA,OAAOA,MAAM,CAACD,UAAU,CAAC,CAAC;EAC9B,CAAC,CAAC,OAAOE,CAAC,EAAE;IACRC,OAAO,CAACC,KAAK,CAAC,wDAAwD,EAAEH,MAAM,CAAC;IAC/EE,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;EACpB;EACA,OAAO,IAAI;AACf;AAEA,OAAO,MAAMG,iBAAiB,SAASP,UAAU,CAAC;EACtCQ,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC;EAETC,OAAOA,CAACC,SAAoB,EAAEC,OAAiB,EAAE;IAC7D,MAAMC,WAAW,GAAGZ,OAAO,CAACa,MAAM,CAAmB,aAAa,CAAC;IAEnE,IAAI,CAACD,WAAW,CAACE,MAAM,EAAE;MACrB,OAAOH,OAAO,CAACD,SAAS,CAAC;IAC7B;IAEA,MAAMK,QAAQ,GAAGH,WAAW,CAACI,GAAG,CAACC,EAAE,IAAIA,EAAE,CAACF,QAAQ,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC;IAE7D,IAAI,CAAC,IAAI,CAACX,KAAK,CAACY,GAAG,CAACJ,QAAQ,CAAC,EAAE;MAC3B;AACZ;AACA;MACY,MAAMK,KAAK,GAAGR,WAAW,CAACI,GAAG,CAACf,UAAU,CAAC,CAACoB,MAAM,CAACC,OAAO,CAAiB;MACzE,IAAI,CAACf,KAAK,CAACgB,GAAG,CAACR,QAAQ,EAAEhB,UAAU,CAACyB,IAAI,CAACJ,KAAK,CAAC,CAAC;IACpD;IAEA,OAAO,IAAI,CAACb,KAAK,CAACkB,GAAG,CAACV,QAAQ,CAAC,CAACN,OAAO,CAACC,SAAS,EAAEC,OAAO,CAAC;EAC/D;AACJ","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ApolloLink } from "apollo-link";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
export interface ApolloLinkFactory {
|
|
4
|
-
(): ApolloLink;
|
|
5
|
-
}
|
|
6
|
-
export declare class ApolloLinkPlugin extends Plugin {
|
|
7
|
-
static readonly type: string;
|
|
8
|
-
readonly cacheKey: string;
|
|
9
|
-
private readonly factory?;
|
|
10
|
-
private cache?;
|
|
11
|
-
constructor(factory?: ApolloLinkFactory);
|
|
12
|
-
createLink(): ApolloLink;
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { nanoid } from "nanoid";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
export class ApolloLinkPlugin extends Plugin {
|
|
4
|
-
static type = "apollo-link";
|
|
5
|
-
constructor(factory) {
|
|
6
|
-
super();
|
|
7
|
-
this.factory = factory;
|
|
8
|
-
this.cacheKey = nanoid();
|
|
9
|
-
}
|
|
10
|
-
createLink() {
|
|
11
|
-
if (this.cache) {
|
|
12
|
-
return this.cache;
|
|
13
|
-
}
|
|
14
|
-
if (typeof this.factory === "function") {
|
|
15
|
-
this.cache = this.factory();
|
|
16
|
-
return this.cache;
|
|
17
|
-
}
|
|
18
|
-
throw Error(`Missing ApolloLinkFactory in plugin "${this.name}"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the "createLink" method.`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=ApolloLinkPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["nanoid","Plugin","ApolloLinkPlugin","type","constructor","factory","cacheKey","createLink","cache","Error","name"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import type { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,SAASC,MAAM,QAAQ,iBAAiB;AAMxC,OAAO,MAAMC,gBAAgB,SAASD,MAAM,CAAC;EACzC,OAAgCE,IAAI,GAAW,aAAa;EAK5DC,WAAWA,CAACC,OAA2B,EAAE;IACrC,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,QAAQ,GAAGN,MAAM,CAAC,CAAC;EAC5B;EAEOO,UAAUA,CAAA,EAAe;IAC5B,IAAI,IAAI,CAACC,KAAK,EAAE;MACZ,OAAO,IAAI,CAACA,KAAK;IACrB;IAEA,IAAI,OAAO,IAAI,CAACH,OAAO,KAAK,UAAU,EAAE;MACpC,IAAI,CAACG,KAAK,GAAG,IAAI,CAACH,OAAO,CAAC,CAAC;MAE3B,OAAO,IAAI,CAACG,KAAK;IACrB;IAEA,MAAMC,KAAK,CACP,wCAAwC,IAAI,CAACC,IAAI,oHACrD,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
3
|
-
/**
|
|
4
|
-
* This link checks for presence of `extensions.console` in the response and logs all items to browser console.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ConsoleLinkPlugin extends ApolloLinkPlugin {
|
|
7
|
-
createLink(): ApolloLink;
|
|
8
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
3
|
-
/**
|
|
4
|
-
* This link checks for presence of `extensions.console` in the response and logs all items to browser console.
|
|
5
|
-
*/
|
|
6
|
-
export class ConsoleLinkPlugin extends ApolloLinkPlugin {
|
|
7
|
-
createLink() {
|
|
8
|
-
return new ApolloLink((operation, forward) => {
|
|
9
|
-
const firstDefinition = operation.query.definitions[0];
|
|
10
|
-
const isQuery = firstDefinition["operation"] === "query";
|
|
11
|
-
return forward(operation).map(data => {
|
|
12
|
-
if (data.extensions && Array.isArray(data.extensions.console) && data.extensions.console.length) {
|
|
13
|
-
const variables = isQuery ? JSON.stringify(operation.variables) : "{ see request details in the Network tab }";
|
|
14
|
-
console.groupCollapsed(`Logs for graphQL ${isQuery ? "query" : "mutation"}: %c${operation.operationName || "anonymous operation"} %c${variables}%c`, "color: #fa5a28", "color: #6b6b6b", "color: black");
|
|
15
|
-
data.extensions.console.forEach(log => {
|
|
16
|
-
console[log.method](...log.args);
|
|
17
|
-
});
|
|
18
|
-
console.groupEnd();
|
|
19
|
-
}
|
|
20
|
-
return data;
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=ConsoleLinkPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloLink","ApolloLinkPlugin","ConsoleLinkPlugin","createLink","operation","forward","firstDefinition","query","definitions","isQuery","map","data","extensions","Array","isArray","console","length","variables","JSON","stringify","groupCollapsed","operationName","forEach","log","method","args","groupEnd"],"sources":["ConsoleLinkPlugin.ts"],"sourcesContent":["import type { FetchResult as BaseFetchResult } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { OperationDefinitionNode } from \"graphql/language/ast\";\n\ninterface Log {\n args: any[];\n method: \"error\" | \"info\" | \"log\" | \"warn\";\n}\n\ninterface FetchResult extends BaseFetchResult {\n extensions?: {\n console?: Log[];\n };\n}\n\n/**\n * This link checks for presence of `extensions.console` in the response and logs all items to browser console.\n */\nexport class ConsoleLinkPlugin extends ApolloLinkPlugin {\n public override createLink() {\n return new ApolloLink((operation, forward) => {\n const firstDefinition = operation.query.definitions[0] as OperationDefinitionNode;\n const isQuery = firstDefinition[\"operation\"] === \"query\";\n\n return forward(operation).map((data: FetchResult) => {\n if (\n data.extensions &&\n Array.isArray(data.extensions.console) &&\n data.extensions.console.length\n ) {\n const variables = isQuery\n ? JSON.stringify(operation.variables)\n : \"{ see request details in the Network tab }\";\n console.groupCollapsed(\n `Logs for graphQL ${isQuery ? \"query\" : \"mutation\"}: %c${\n operation.operationName || \"anonymous operation\"\n } %c${variables}%c`,\n \"color: #fa5a28\",\n \"color: #6b6b6b\",\n \"color: black\"\n );\n data.extensions.console.forEach((log: Log) => {\n console[log.method](...log.args);\n });\n console.groupEnd();\n }\n\n return data;\n });\n });\n }\n}\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,aAAa;AACxC,SAASC,gBAAgB;AAczB;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SAASD,gBAAgB,CAAC;EACpCE,UAAUA,CAAA,EAAG;IACzB,OAAO,IAAIH,UAAU,CAAC,CAACI,SAAS,EAAEC,OAAO,KAAK;MAC1C,MAAMC,eAAe,GAAGF,SAAS,CAACG,KAAK,CAACC,WAAW,CAAC,CAAC,CAA4B;MACjF,MAAMC,OAAO,GAAGH,eAAe,CAAC,WAAW,CAAC,KAAK,OAAO;MAExD,OAAOD,OAAO,CAACD,SAAS,CAAC,CAACM,GAAG,CAAEC,IAAiB,IAAK;QACjD,IACIA,IAAI,CAACC,UAAU,IACfC,KAAK,CAACC,OAAO,CAACH,IAAI,CAACC,UAAU,CAACG,OAAO,CAAC,IACtCJ,IAAI,CAACC,UAAU,CAACG,OAAO,CAACC,MAAM,EAChC;UACE,MAAMC,SAAS,GAAGR,OAAO,GACnBS,IAAI,CAACC,SAAS,CAACf,SAAS,CAACa,SAAS,CAAC,GACnC,4CAA4C;UAClDF,OAAO,CAACK,cAAc,CAClB,oBAAoBX,OAAO,GAAG,OAAO,GAAG,UAAU,OAC9CL,SAAS,CAACiB,aAAa,IAAI,qBAAqB,MAC9CJ,SAAS,IAAI,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,cACJ,CAAC;UACDN,IAAI,CAACC,UAAU,CAACG,OAAO,CAACO,OAAO,CAAEC,GAAQ,IAAK;YAC1CR,OAAO,CAACQ,GAAG,CAACC,MAAM,CAAC,CAAC,GAAGD,GAAG,CAACE,IAAI,CAAC;UACpC,CAAC,CAAC;UACFV,OAAO,CAACW,QAAQ,CAAC,CAAC;QACtB;QAEA,OAAOf,IAAI;MACf,CAAC,CAAC;IACN,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
-
import type { ApolloLink } from "apollo-link";
|
|
3
|
-
/**
|
|
4
|
-
* Append `x-i18n-locale` header from URL query (necessary for prerendering service).
|
|
5
|
-
*/
|
|
6
|
-
export declare class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {
|
|
7
|
-
private readonly locale;
|
|
8
|
-
constructor(locale?: string);
|
|
9
|
-
createLink(): ApolloLink;
|
|
10
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { setContext } from "apollo-link-context";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
3
|
-
import { getLocaleCode } from "../utils";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Append `x-i18n-locale` header from URL query (necessary for prerendering service).
|
|
7
|
-
*/
|
|
8
|
-
export class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {
|
|
9
|
-
constructor(locale) {
|
|
10
|
-
super();
|
|
11
|
-
this.locale = locale || getLocaleCode();
|
|
12
|
-
}
|
|
13
|
-
createLink() {
|
|
14
|
-
return setContext((_, {
|
|
15
|
-
headers
|
|
16
|
-
}) => {
|
|
17
|
-
if (this.locale) {
|
|
18
|
-
return {
|
|
19
|
-
headers: {
|
|
20
|
-
...headers,
|
|
21
|
-
"x-i18n-locale": `content:${this.locale};`
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
headers
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=LocaleHeaderLinkPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["setContext","ApolloLinkPlugin","getLocaleCode","LocaleHeaderLinkPlugin","constructor","locale","createLink","_","headers"],"sources":["LocaleHeaderLinkPlugin.ts"],"sourcesContent":["import { setContext } from \"apollo-link-context\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport type { ApolloLink } from \"apollo-link\";\nimport { getLocaleCode } from \"~/utils\";\n\n/**\n * Append `x-i18n-locale` header from URL query (necessary for prerendering service).\n */\nexport class LocaleHeaderLinkPlugin extends ApolloLinkPlugin {\n private readonly locale: string;\n\n constructor(locale?: string) {\n super();\n\n this.locale = locale || (getLocaleCode() as string);\n }\n\n public override createLink(): ApolloLink {\n return setContext((_, { headers }) => {\n if (this.locale) {\n return {\n headers: {\n ...headers,\n \"x-i18n-locale\": `content:${this.locale};`\n }\n };\n }\n\n return { headers };\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,qBAAqB;AAChD,SAASC,gBAAgB;AAEzB,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASF,gBAAgB,CAAC;EAGzDG,WAAWA,CAACC,MAAe,EAAE;IACzB,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM,IAAKH,aAAa,CAAC,CAAY;EACvD;EAEgBI,UAAUA,CAAA,EAAe;IACrC,OAAON,UAAU,CAAC,CAACO,CAAC,EAAE;MAAEC;IAAQ,CAAC,KAAK;MAClC,IAAI,IAAI,CAACH,MAAM,EAAE;QACb,OAAO;UACHG,OAAO,EAAE;YACL,GAAGA,OAAO;YACV,eAAe,EAAE,WAAW,IAAI,CAACH,MAAM;UAC3C;QACJ,CAAC;MACL;MAEA,OAAO;QAAEG;MAAQ,CAAC;IACtB,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import get from "lodash/get";
|
|
3
|
-
import { IconButton } from "@webiny/ui/Button";
|
|
4
|
-
import { Typography } from "@webiny/ui/Typography";
|
|
5
|
-
import { i18n } from "../../i18n";
|
|
6
|
-
import { OverlayWrapper, Pre } from "./StyledComponents";
|
|
7
|
-
import { ReactComponent as CloseIcon } from "./assets/close_24px.svg";
|
|
8
|
-
const t = i18n.ns("app/graphql/error-overlay");
|
|
9
|
-
const ENVIRONMENT_VARIABLES_ARTICLE_LINK = "https://www.webiny.com/docs/how-to-guides/environment-variables";
|
|
10
|
-
const ErrorOverlay = props => {
|
|
11
|
-
const {
|
|
12
|
-
query,
|
|
13
|
-
networkError
|
|
14
|
-
} = props;
|
|
15
|
-
const [open, setOpen] = useState(true);
|
|
16
|
-
// Log error in browser's developer console for further inspection.
|
|
17
|
-
console.error({
|
|
18
|
-
networkError
|
|
19
|
-
});
|
|
20
|
-
if (!open) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const stackTrace = get(networkError, "result.error.stack");
|
|
24
|
-
return /*#__PURE__*/React.createElement(OverlayWrapper, null, /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
className: "inner"
|
|
26
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
className: "header"
|
|
28
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: "header__title"
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
31
|
-
use: "headline4"
|
|
32
|
-
}, networkError.message)), /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
className: "header__action"
|
|
34
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
35
|
-
icon: /*#__PURE__*/React.createElement(CloseIcon, null),
|
|
36
|
-
onClick: () => setOpen(false)
|
|
37
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
38
|
-
className: "body"
|
|
39
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
className: "body__summary"
|
|
41
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
42
|
-
use: "subtitle1"
|
|
43
|
-
}, t`Error occurred while executing operation:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, query))), stackTrace && /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "body__description"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
46
|
-
use: "subtitle1"
|
|
47
|
-
}, t`Complete stack trace:`), /*#__PURE__*/React.createElement(Pre, null, /*#__PURE__*/React.createElement("code", null, stackTrace)))), /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: "footer"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
50
|
-
use: "body2"
|
|
51
|
-
}, t`
|
|
52
|
-
This screen is only visible if {message} environment variable is set.
|
|
53
|
-
Read more about it in the {link}. `({
|
|
54
|
-
message: /*#__PURE__*/React.createElement("span", {
|
|
55
|
-
className: "highlight"
|
|
56
|
-
}, "`REACT_APP_DEBUG=true`"),
|
|
57
|
-
link: /*#__PURE__*/React.createElement("a", {
|
|
58
|
-
href: ENVIRONMENT_VARIABLES_ARTICLE_LINK,
|
|
59
|
-
target: "_blank",
|
|
60
|
-
rel: "noreferrer noopener"
|
|
61
|
-
}, "environment variables article")
|
|
62
|
-
}), /*#__PURE__*/React.createElement("br", null), t`Open your browser's developer console to further inspect this error.`))));
|
|
63
|
-
};
|
|
64
|
-
export default ErrorOverlay;
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=ErrorOverlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","get","IconButton","Typography","i18n","OverlayWrapper","Pre","ReactComponent","CloseIcon","t","ns","ENVIRONMENT_VARIABLES_ARTICLE_LINK","ErrorOverlay","props","query","networkError","open","setOpen","console","error","stackTrace","createElement","className","use","message","icon","onClick","link","href","target","rel"],"sources":["ErrorOverlay.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport get from \"lodash/get\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"../../i18n\";\nimport { OverlayWrapper, Pre } from \"./StyledComponents\";\nimport { ReactComponent as CloseIcon } from \"./assets/close_24px.svg\";\n\nconst t = i18n.ns(\"app/graphql/error-overlay\");\n\nconst ENVIRONMENT_VARIABLES_ARTICLE_LINK =\n \"https://www.webiny.com/docs/how-to-guides/environment-variables\";\n\ninterface ErrorOverlayProps {\n query: string;\n networkError: {\n message: string;\n result?: {\n error?: {\n stack?: string;\n };\n };\n };\n}\nconst ErrorOverlay = (props: ErrorOverlayProps) => {\n const { query, networkError } = props;\n const [open, setOpen] = useState(true);\n // Log error in browser's developer console for further inspection.\n console.error({ networkError });\n\n if (!open) {\n return null;\n }\n\n const stackTrace = get(networkError, \"result.error.stack\");\n\n return (\n <OverlayWrapper>\n <div className=\"inner\">\n <div className=\"header\">\n <div className=\"header__title\">\n <Typography use={\"headline4\"}>{networkError.message}</Typography>\n </div>\n <div className=\"header__action\">\n <IconButton icon={<CloseIcon />} onClick={() => setOpen(false)} />\n </div>\n </div>\n <div className=\"body\">\n <div className=\"body__summary\">\n <Typography\n use={\"subtitle1\"}\n >{t`Error occurred while executing operation:`}</Typography>\n <Pre>\n <code>{query}</code>\n </Pre>\n </div>\n {stackTrace && (\n <div className=\"body__description\">\n <Typography use={\"subtitle1\"}>{t`Complete stack trace:`}</Typography>\n <Pre>\n <code>{stackTrace}</code>\n </Pre>\n </div>\n )}\n </div>\n <div className=\"footer\">\n <Typography use={\"body2\"}>\n {t`\n This screen is only visible if {message} environment variable is set.\n Read more about it in the {link}. `({\n message: <span className={\"highlight\"}>`REACT_APP_DEBUG=true`</span>,\n link: (\n <a\n href={ENVIRONMENT_VARIABLES_ARTICLE_LINK}\n target={\"_blank\"}\n rel={\"noreferrer noopener\"}\n >\n environment variables article\n </a>\n )\n })}\n <br />\n {t`Open your browser's developer console to further inspect this error.`}\n </Typography>\n </div>\n </div>\n </OverlayWrapper>\n );\n};\n\nexport default ErrorOverlay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,GAAG,MAAM,YAAY;AAC5B,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,IAAI;AACb,SAASC,cAAc,EAAEC,GAAG;AAC5B,SAASC,cAAc,IAAIC,SAAS;AAEpC,MAAMC,CAAC,GAAGL,IAAI,CAACM,EAAE,CAAC,2BAA2B,CAAC;AAE9C,MAAMC,kCAAkC,GACpC,iEAAiE;AAarE,MAAMC,YAAY,GAAIC,KAAwB,IAAK;EAC/C,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,KAAK;EACrC,MAAM,CAACG,IAAI,EAAEC,OAAO,CAAC,GAAGjB,QAAQ,CAAC,IAAI,CAAC;EACtC;EACAkB,OAAO,CAACC,KAAK,CAAC;IAAEJ;EAAa,CAAC,CAAC;EAE/B,IAAI,CAACC,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EAEA,MAAMI,UAAU,GAAGnB,GAAG,CAACc,YAAY,EAAE,oBAAoB,CAAC;EAE1D,oBACIhB,KAAA,CAAAsB,aAAA,CAAChB,cAAc,qBACXN,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAO,gBAClBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAe,gBAC1BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAY,GAAER,YAAY,CAACS,OAAoB,CAC/D,CAAC,eACNzB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAgB,gBAC3BvB,KAAA,CAAAsB,aAAA,CAACnB,UAAU;IAACuB,IAAI,eAAE1B,KAAA,CAAAsB,aAAA,CAACb,SAAS,MAAE,CAAE;IAACkB,OAAO,EAAEA,CAAA,KAAMT,OAAO,CAAC,KAAK;EAAE,CAAE,CAChE,CACJ,CAAC,eACNlB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAM,gBACjBvB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAe,gBAC1BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IACPoB,GAAG,EAAE;EAAY,GACnBd,CAAC,2CAAwD,CAAC,eAC5DV,KAAA,CAAAsB,aAAA,CAACf,GAAG,qBACAP,KAAA,CAAAsB,aAAA,eAAOP,KAAY,CAClB,CACJ,CAAC,EACLM,UAAU,iBACPrB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAmB,gBAC9BvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAY,GAAEd,CAAC,uBAAoC,CAAC,eACrEV,KAAA,CAAAsB,aAAA,CAACf,GAAG,qBACAP,KAAA,CAAAsB,aAAA,eAAOD,UAAiB,CACvB,CACJ,CAER,CAAC,eACNrB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAQ,gBACnBvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;IAACoB,GAAG,EAAE;EAAQ,GACpBd,CAAC;AAC1B;AACA,2DAA2D,CAAC;IAChCe,OAAO,eAAEzB,KAAA,CAAAsB,aAAA;MAAMC,SAAS,EAAE;IAAY,GAAC,wBAA4B,CAAC;IACpEK,IAAI,eACA5B,KAAA,CAAAsB,aAAA;MACIO,IAAI,EAAEjB,kCAAmC;MACzCkB,MAAM,EAAE,QAAS;MACjBC,GAAG,EAAE;IAAsB,GAC9B,+BAEE;EAEX,CAAC,CAAC,eACF/B,KAAA,CAAAsB,aAAA,WAAK,CAAC,EACLZ,CAAC,sEACM,CACX,CACJ,CACO,CAAC;AAEzB,CAAC;AAED,eAAeG,YAAY","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const OverlayWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const Pre: import("@emotion/styled").StyledComponent<{
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
})(`
|
|
8
|
-
width: 100vw;
|
|
9
|
-
height: 100vh;
|
|
10
|
-
position: fixed;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
z-index: 105; // The highest z-index value is 100 for Dialogs
|
|
14
|
-
|
|
15
|
-
.inner {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
overflow: auto;
|
|
22
|
-
background-color: white;
|
|
23
|
-
padding: 1rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header {
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
margin-bottom: 1rem;
|
|
31
|
-
.header__title {
|
|
32
|
-
color: var(--mdc-theme-error);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.body {
|
|
37
|
-
flex-grow: 1;
|
|
38
|
-
.body__summary {
|
|
39
|
-
margin-bottom: 1rem;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.footer {
|
|
44
|
-
color: var(--mdc-theme-text-secondary-on-background);
|
|
45
|
-
|
|
46
|
-
.highlight {
|
|
47
|
-
background-color: rgba(251, 245, 180, 0.5);
|
|
48
|
-
padding: 0 4px;
|
|
49
|
-
border-radius: 6px;
|
|
50
|
-
font-family: monospace;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJTdHlsZWRDb21wb25lbnRzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5leHBvcnQgY29uc3QgT3ZlcmxheVdyYXBwZXIgPSBzdHlsZWQoXCJkaXZcIikoYFxuICAgIHdpZHRoOiAxMDB2dztcbiAgICBoZWlnaHQ6IDEwMHZoO1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICB0b3A6IDA7XG4gICAgbGVmdDogMDtcbiAgICB6LWluZGV4OiAxMDU7IC8vIFRoZSBoaWdoZXN0IHotaW5kZXggdmFsdWUgaXMgMTAwIGZvciBEaWFsb2dzXG4gICAgXG4gICAgLmlubmVyIHtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgb3ZlcmZsb3c6IGF1dG87XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHdoaXRlO1xuICAgICAgICBwYWRkaW5nOiAxcmVtO1xuICAgIH1cbiAgICBcbiAgICAuaGVhZGVyIHtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICBtYXJnaW4tYm90dG9tOiAxcmVtO1xuICAgICAgICAuaGVhZGVyX190aXRsZSB7XG4gICAgICAgICAgICBjb2xvcjogdmFyKC0tbWRjLXRoZW1lLWVycm9yKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICAuYm9keSB7XG4gICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgLmJvZHlfX3N1bW1hcnkge1xuICAgICAgICAgICAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBcbiAgICAuZm9vdGVyIHtcbiAgICAgICAgY29sb3I6IHZhcigtLW1kYy10aGVtZS10ZXh0LXNlY29uZGFyeS1vbi1iYWNrZ3JvdW5kKTtcbiAgICAgICAgXG4gICAgICAgIC5oaWdobGlnaHQge1xuICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTEsIDI0NSwgMTgwLCAwLjUpO1xuICAgICAgICAgICAgcGFkZGluZzogMCA0cHg7XG4gICAgICAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7XG4gICAgICAgICAgICBmb250LWZhbWlseTogbW9ub3NwYWNlO1xuICAgICAgICB9XG4gICAgfVxuYCk7XG5cbmV4cG9ydCBjb25zdCBQcmUgPSBzdHlsZWQoXCJwcmVcIikoYFxuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICBkaXNwbGF5OiBibG9jaztcbiAgICBwYWRkaW5nOiAwLjVlbTtcbiAgICBtYXJnaW4tdG9wOiAwLjVlbTtcbiAgICBtYXJnaW4tYm90dG9tOiAwLjVlbTtcbiAgICBvdmVyZmxvdy14OiBhdXRvO1xuICAgIHdoaXRlLXNwYWNlOiBwcmUtd3JhcDtcbiAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO1xuICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjUxLCAyNDUsIDE4MCwgMC4zKTtcbiAgICBjb2xvcjogaW5oZXJpdDtcbiAgICBcbiAgICBjb2RlIHtcbiAgICAgICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICAgICAgZm9udC1zaXplOiAwLjg1cmVtO1xuICAgICAgICBsaW5lLWhlaWdodDogMXJlbTtcbiAgICB9XG5gKTtcbiJdfQ== */");
|
|
54
|
-
export const Pre = /*#__PURE__*/_styled("pre", process.env.NODE_ENV === "production" ? {
|
|
55
|
-
target: "e1rvk94r0"
|
|
56
|
-
} : {
|
|
57
|
-
target: "e1rvk94r0",
|
|
58
|
-
label: "Pre"
|
|
59
|
-
})(`
|
|
60
|
-
position: relative;
|
|
61
|
-
display: block;
|
|
62
|
-
padding: 0.5em;
|
|
63
|
-
margin-top: 0.5em;
|
|
64
|
-
margin-bottom: 0.5em;
|
|
65
|
-
overflow-x: auto;
|
|
66
|
-
white-space: pre-wrap;
|
|
67
|
-
border-radius: 0.25rem;
|
|
68
|
-
background-color: rgba(251, 245, 180, 0.3);
|
|
69
|
-
color: inherit;
|
|
70
|
-
|
|
71
|
-
code {
|
|
72
|
-
font-family: monospace;
|
|
73
|
-
font-size: 0.85rem;
|
|
74
|
-
line-height: 1rem;
|
|
75
|
-
}
|
|
76
|
-
`, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtEbUIiLCJmaWxlIjoiU3R5bGVkQ29tcG9uZW50cy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuZXhwb3J0IGNvbnN0IE92ZXJsYXlXcmFwcGVyID0gc3R5bGVkKFwiZGl2XCIpKGBcbiAgICB3aWR0aDogMTAwdnc7XG4gICAgaGVpZ2h0OiAxMDB2aDtcbiAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgdG9wOiAwO1xuICAgIGxlZnQ6IDA7XG4gICAgei1pbmRleDogMTA1OyAvLyBUaGUgaGlnaGVzdCB6LWluZGV4IHZhbHVlIGlzIDEwMCBmb3IgRGlhbG9nc1xuICAgIFxuICAgIC5pbm5lciB7XG4gICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgIG92ZXJmbG93OiBhdXRvO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB3aGl0ZTtcbiAgICAgICAgcGFkZGluZzogMXJlbTtcbiAgICB9XG4gICAgXG4gICAgLmhlYWRlciB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgbWFyZ2luLWJvdHRvbTogMXJlbTtcbiAgICAgICAgLmhlYWRlcl9fdGl0bGUge1xuICAgICAgICAgICAgY29sb3I6IHZhcigtLW1kYy10aGVtZS1lcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmJvZHkge1xuICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgIC5ib2R5X19zdW1tYXJ5IHtcbiAgICAgICAgICAgIG1hcmdpbi1ib3R0b206IDFyZW07XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLmZvb3RlciB7XG4gICAgICAgIGNvbG9yOiB2YXIoLS1tZGMtdGhlbWUtdGV4dC1zZWNvbmRhcnktb24tYmFja2dyb3VuZCk7XG4gICAgICAgIFxuICAgICAgICAuaGlnaGxpZ2h0IHtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjUxLCAyNDUsIDE4MCwgMC41KTtcbiAgICAgICAgICAgIHBhZGRpbmc6IDAgNHB4O1xuICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4O1xuICAgICAgICAgICAgZm9udC1mYW1pbHk6IG1vbm9zcGFjZTtcbiAgICAgICAgfVxuICAgIH1cbmApO1xuXG5leHBvcnQgY29uc3QgUHJlID0gc3R5bGVkKFwicHJlXCIpKGBcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgcGFkZGluZzogMC41ZW07XG4gICAgbWFyZ2luLXRvcDogMC41ZW07XG4gICAgbWFyZ2luLWJvdHRvbTogMC41ZW07XG4gICAgb3ZlcmZsb3cteDogYXV0bztcbiAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7XG4gICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1MSwgMjQ1LCAxODAsIDAuMyk7XG4gICAgY29sb3I6IGluaGVyaXQ7XG4gICAgXG4gICAgY29kZSB7XG4gICAgICAgIGZvbnQtZmFtaWx5OiBtb25vc3BhY2U7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NXJlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDFyZW07XG4gICAgfVxuYCk7XG4iXX0= */");
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=StyledComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 flex-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,2zEAAC;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,2zEAAC","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ServerError, ServerParseError } from "apollo-link-http-common";
|
|
2
|
-
interface CreateErrorOverlayParams {
|
|
3
|
-
query: string;
|
|
4
|
-
networkError: Error | ServerError | ServerParseError;
|
|
5
|
-
}
|
|
6
|
-
declare const createErrorOverlay: (params: CreateErrorOverlayParams) => void;
|
|
7
|
-
export default createErrorOverlay;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* TODO fix with react 19
|
|
4
|
-
*/
|
|
5
|
-
// eslint-disable-next-line react/no-deprecated
|
|
6
|
-
import { render } from "react-dom";
|
|
7
|
-
import ErrorOverlay from "./ErrorOverlay";
|
|
8
|
-
const createErrorOverlay = params => {
|
|
9
|
-
const {
|
|
10
|
-
query,
|
|
11
|
-
networkError
|
|
12
|
-
} = params;
|
|
13
|
-
// If the element already present in DOM, return immediately.
|
|
14
|
-
if (document.getElementById("overlay-root")) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
// Create root element to hold React tree.
|
|
18
|
-
const container = document.createElement("div");
|
|
19
|
-
container.id = "overlay-root";
|
|
20
|
-
// Insert root element into body.
|
|
21
|
-
const body = document.getElementsByTagName("body")[0];
|
|
22
|
-
body.appendChild(container);
|
|
23
|
-
// Mount the ErrorOverlay component into root element.
|
|
24
|
-
render(/*#__PURE__*/React.createElement(ErrorOverlay, {
|
|
25
|
-
query: query,
|
|
26
|
-
networkError: networkError
|
|
27
|
-
}), container);
|
|
28
|
-
};
|
|
29
|
-
export default createErrorOverlay;
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=createErrorOverlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","render","ErrorOverlay","createErrorOverlay","params","query","networkError","document","getElementById","container","createElement","id","body","getElementsByTagName","appendChild"],"sources":["createErrorOverlay.tsx"],"sourcesContent":["import React from \"react\";\n/**\n * TODO fix with react 19\n */\n// eslint-disable-next-line react/no-deprecated\nimport { render } from \"react-dom\";\nimport ErrorOverlay from \"./ErrorOverlay\";\nimport type { ServerError, ServerParseError } from \"apollo-link-http-common\";\n\ninterface CreateErrorOverlayParams {\n query: string;\n networkError: Error | ServerError | ServerParseError;\n}\nconst createErrorOverlay = (params: CreateErrorOverlayParams): void => {\n const { query, networkError } = 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 render(<ErrorOverlay query={query} networkError={networkError} />, container);\n};\n\nexport default createErrorOverlay;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB;AACA;AACA;AACA;AACA,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,YAAY;AAOnB,MAAMC,kBAAkB,GAAIC,MAAgC,IAAW;EACnE,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGF,MAAM;EACtC;EACA,IAAIG,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;EACAR,MAAM,cAACD,KAAA,CAAAU,aAAA,CAACR,YAAY;IAACG,KAAK,EAAEA,KAAM;IAACC,YAAY,EAAEA;EAAa,CAAE,CAAC,EAAEG,SAAS,CAAC;AACjF,CAAC;AAED,eAAeN,kBAAkB","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
-
/**
|
|
3
|
-
* This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
|
|
4
|
-
*/
|
|
5
|
-
export declare class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
|
|
6
|
-
createLink(): import("apollo-link").ApolloLink;
|
|
7
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
-
import { onError } from "apollo-link-error";
|
|
3
|
-
import { print } from "graphql/language";
|
|
4
|
-
import createErrorOverlay from "./NetworkErrorLinkPlugin/createErrorOverlay";
|
|
5
|
-
import { boolean } from "boolean";
|
|
6
|
-
import { config as appConfig } from "../config";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
|
|
10
|
-
*/
|
|
11
|
-
export class NetworkErrorLinkPlugin extends ApolloLinkPlugin {
|
|
12
|
-
createLink() {
|
|
13
|
-
return onError(({
|
|
14
|
-
networkError,
|
|
15
|
-
operation
|
|
16
|
-
}) => {
|
|
17
|
-
const debug = appConfig.getKey("DEBUG", boolean(process.env.REACT_APP_DEBUG));
|
|
18
|
-
if (networkError && debug) {
|
|
19
|
-
createErrorOverlay({
|
|
20
|
-
query: print(operation.query),
|
|
21
|
-
networkError
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// TODO: also print graphQLErrors
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=NetworkErrorLinkPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloLinkPlugin","onError","print","createErrorOverlay","boolean","config","appConfig","NetworkErrorLinkPlugin","createLink","networkError","operation","debug","getKey","process","env","REACT_APP_DEBUG","query"],"sources":["NetworkErrorLinkPlugin.ts"],"sourcesContent":["import { ApolloLinkPlugin } from \"./ApolloLinkPlugin\";\nimport { onError } from \"apollo-link-error\";\nimport { print } from \"graphql/language\";\nimport createErrorOverlay from \"./NetworkErrorLinkPlugin/createErrorOverlay\";\nimport { boolean } from \"boolean\";\nimport { config as appConfig } from \"~/config\";\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 public override createLink() {\n return onError(({ networkError, operation }) => {\n const debug = appConfig.getKey(\"DEBUG\", boolean(process.env.REACT_APP_DEBUG));\n\n if (networkError && debug) {\n createErrorOverlay({ query: print(operation.query), networkError });\n }\n\n // TODO: also print graphQLErrors\n });\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,kBAAkB;AACzB,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,MAAM,IAAIC,SAAS;;AAE5B;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASP,gBAAgB,CAAC;EACzCQ,UAAUA,CAAA,EAAG;IACzB,OAAOP,OAAO,CAAC,CAAC;MAAEQ,YAAY;MAAEC;IAAU,CAAC,KAAK;MAC5C,MAAMC,KAAK,GAAGL,SAAS,CAACM,MAAM,CAAC,OAAO,EAAER,OAAO,CAACS,OAAO,CAACC,GAAG,CAACC,eAAe,CAAC,CAAC;MAE7E,IAAIN,YAAY,IAAIE,KAAK,EAAE;QACvBR,kBAAkB,CAAC;UAAEa,KAAK,EAAEd,KAAK,CAACQ,SAAS,CAACM,KAAK,CAAC;UAAEP;QAAa,CAAC,CAAC;MACvE;;MAEA;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
3
|
-
/**
|
|
4
|
-
* This link removes `__typename` from the variables being sent to the API.
|
|
5
|
-
*/
|
|
6
|
-
export declare class OmitTypenameLinkPlugin extends ApolloLinkPlugin {
|
|
7
|
-
createLink(): ApolloLink;
|
|
8
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
3
|
-
function omitTypename(key, value) {
|
|
4
|
-
return key === "__typename" ? undefined : value;
|
|
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
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=OmitTypenameLinkPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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\";\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":[]}
|
package/plugins/RoutePlugin.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
interface Config {
|
|
4
|
-
route: React.ReactElement | null;
|
|
5
|
-
}
|
|
6
|
-
export declare class RoutePlugin extends Plugin {
|
|
7
|
-
static readonly type: string;
|
|
8
|
-
private _config;
|
|
9
|
-
constructor(config?: Config);
|
|
10
|
-
get route(): Config["route"];
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/plugins/RoutePlugin.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export class RoutePlugin extends Plugin {
|
|
3
|
-
static type = "route";
|
|
4
|
-
constructor(config) {
|
|
5
|
-
super();
|
|
6
|
-
this._config = config || {};
|
|
7
|
-
}
|
|
8
|
-
get route() {
|
|
9
|
-
if (!this._config.route) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return this._config.route;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=RoutePlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","RoutePlugin","type","constructor","config","_config","route"],"sources":["RoutePlugin.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\ninterface Config {\n route: React.ReactElement | null;\n}\n\nexport class RoutePlugin extends Plugin {\n public static override readonly type: string = \"route\";\n private _config: Partial<Config>;\n\n constructor(config?: Config) {\n super();\n this._config = config || {};\n }\n\n get route(): Config[\"route\"] {\n if (!this._config.route) {\n return null;\n }\n return this._config.route;\n }\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,iBAAiB;AAMxC,OAAO,MAAMC,WAAW,SAASD,MAAM,CAAC;EACpC,OAAgCE,IAAI,GAAW,OAAO;EAGtDC,WAAWA,CAACC,MAAe,EAAE;IACzB,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;EAC/B;EAEA,IAAIE,KAAKA,CAAA,EAAoB;IACzB,IAAI,CAAC,IAAI,CAACD,OAAO,CAACC,KAAK,EAAE;MACrB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACD,OAAO,CAACC,KAAK;EAC7B;AACJ","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
-
import type { ApolloLink } from "apollo-link";
|
|
3
|
-
/**
|
|
4
|
-
* Append `x-tenant` header from URL query (necessary for prerendering service).
|
|
5
|
-
*/
|
|
6
|
-
export declare class TenantHeaderLinkPlugin extends ApolloLinkPlugin {
|
|
7
|
-
private readonly tenant;
|
|
8
|
-
constructor(tenant?: string);
|
|
9
|
-
createLink(): ApolloLink;
|
|
10
|
-
}
|