@webiny/app 0.0.0-unstable.78f581c1d2 → 0.0.0-unstable.7be00a75a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +25 -0
- package/App.js +82 -0
- package/App.js.map +1 -0
- package/AppContainer.d.ts +23 -0
- package/AppContainer.js +6 -0
- package/AppContainer.js.map +1 -0
- package/README.md +7 -15
- package/apollo-client/InMemoryCache.d.ts +3 -2
- package/apollo-client/InMemoryCache.js +16 -77
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
- package/apollo-client/IntrospectionFragmentMatcher.js +33 -0
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
- package/components/Image.d.ts +2 -3
- package/components/Image.js +15 -41
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -21
- package/config/RouterConfig/Route.d.ts +29 -0
- package/config/RouterConfig/Route.js +28 -0
- package/config/RouterConfig/Route.js.map +1 -0
- package/config/RouterConfig.d.ts +31 -0
- package/config/RouterConfig.js +19 -0
- package/config/RouterConfig.js.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +20 -29
- package/config.js.map +1 -1
- package/contexts/Ui/index.d.ts +4 -8
- package/contexts/Ui/index.js +27 -89
- package/contexts/Ui/index.js.map +1 -1
- package/core/Plugin.d.ts +8 -0
- package/core/Plugin.js +12 -0
- package/core/Plugin.js.map +1 -0
- package/core/Plugins.d.ts +15 -0
- package/core/Plugins.js +21 -0
- package/core/Plugins.js.map +1 -0
- package/core/Provider.d.ts +8 -0
- package/core/Provider.js +10 -0
- package/core/Provider.js.map +1 -0
- package/core/createProvider.d.ts +10 -0
- package/core/createProvider.js +6 -0
- package/core/createProvider.js.map +1 -0
- package/core/createProviderPlugin.d.ts +8 -0
- package/core/createProviderPlugin.js +12 -0
- package/core/createProviderPlugin.js.map +1 -0
- 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/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 +7 -0
- package/exports/admin.js +7 -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 +397 -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 +22 -0
- package/features/router/HistoryRouterGateway.js +88 -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 +21 -0
- package/features/router/RouterPresenter.js +52 -0
- package/features/router/RouterPresenter.js.map +1 -0
- package/features/router/RouterRepository.d.ts +30 -0
- package/features/router/RouterRepository.js +117 -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 +81 -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/useAutocomplete/index.d.ts +1 -1
- package/hooks/useAutocomplete/index.js +1 -13
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +15 -36
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +4 -15
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +4 -15
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +4 -15
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.d.ts +3 -3
- package/hooks/useDataList/functions/index.js +3 -31
- package/hooks/useDataList/functions/searchDataByKey.js +10 -26
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.d.ts +1 -1
- package/hooks/useDataList/index.js +1 -13
- package/hooks/useDataList/useDataList.d.ts +2 -3
- package/hooks/useDataList/useDataList.js +139 -205
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.d.ts +1 -2
- package/hooks/useDataList/utils/index.js +1 -23
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +26 -45
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useHandler.js +14 -19
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.d.ts +3 -3
- package/hooks/useHandlers.js +19 -28
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
- package/hooks/useRegisterLegacyPlugin.js +12 -0
- package/hooks/useRegisterLegacyPlugin.js.map +1 -0
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +5 -15
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +11 -21
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -15
- package/index.d.ts +25 -4
- package/index.js +23 -37
- package/package.json +38 -38
- package/plugins/AddQuerySelectionPlugin.d.ts +10 -3
- package/plugins/AddQuerySelectionPlugin.js +43 -128
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +15 -51
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +24 -78
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +21 -61
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.d.ts +1 -1
- package/plugins/ConsoleLinkPlugin.js +20 -59
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +47 -95
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +27 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +23 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +8 -5
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -20
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js +13 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js +19 -0
- package/plugins/NetworkErrorLinkPlugin/assets/close_24px.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +13 -36
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
- package/plugins/NetworkErrorLinkPlugin.js +51 -63
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +12 -51
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +3 -8
- package/plugins/TenantHeaderLinkPlugin.js +25 -82
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- 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 +1 -1
- package/plugins/image.js +97 -175
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +5 -5
- package/plugins/index.js +38 -106
- 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/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 +6 -0
- package/presentation/router/hooks/useRoute.js +22 -0
- package/presentation/router/hooks/useRoute.js.map +1 -0
- package/presentation/router/hooks/useRouter.d.ts +11 -0
- package/presentation/router/hooks/useRouter.js +29 -0
- package/presentation/router/hooks/useRouter.js.map +1 -0
- package/presentation/router/index.d.ts +4 -0
- package/presentation/router/index.js +3 -0
- package/presentation/router/types.d.ts +5 -0
- package/presentation/router/types.js +0 -0
- package/renderApp.d.ts +2 -0
- package/renderApp.js +10 -0
- package/renderApp.js.map +1 -0
- 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 +30 -30
- package/types.js +0 -13
- package/utils/createGenericContext.d.ts +13 -0
- package/utils/createGenericContext.js +21 -0
- package/utils/createGenericContext.js.map +1 -0
- package/utils/createHashing.d.ts +2 -0
- package/utils/createHashing.js +15 -0
- package/utils/createHashing.js.map +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/legacyPluginToReactComponent.d.ts +7 -0
- package/utils/legacyPluginToReactComponent.js +15 -0
- package/utils/legacyPluginToReactComponent.js.map +1 -0
- package/components/Routes.d.ts +0 -2
- package/components/Routes.js +0 -49
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -41
- package/components/View.js.map +0 -1
- package/components/index.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/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -31
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +0 -1
- package/hooks/useDataList/utils/types.d.ts +0 -34
- package/hooks/useDataList/utils/types.js +0 -5
- package/hooks/useDataList/utils/types.js.map +0 -1
- package/i18n/index.js.map +0 -1
- package/index.js.map +0 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -15
- package/plugins/LocaleHeaderLinkPlugin.js +0 -77
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -53
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -58
- package/plugins/ViewPlugin.js.map +0 -1
- package/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.7be00a75a9",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -15,15 +19,16 @@
|
|
|
15
19
|
"license": "MIT",
|
|
16
20
|
"dependencies": {
|
|
17
21
|
"@apollo/react-hooks": "3.1.5",
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@webiny/i18n": "0.0.0-unstable.
|
|
23
|
-
"@webiny/i18n-react": "0.0.0-unstable.
|
|
24
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
25
|
-
"@webiny/react-
|
|
26
|
-
"@webiny/
|
|
22
|
+
"@emotion/styled": "11.14.1",
|
|
23
|
+
"@types/react": "18.3.29",
|
|
24
|
+
"@webiny/di": "0.0.0-unstable.7be00a75a9",
|
|
25
|
+
"@webiny/feature": "0.0.0-unstable.7be00a75a9",
|
|
26
|
+
"@webiny/i18n": "0.0.0-unstable.7be00a75a9",
|
|
27
|
+
"@webiny/i18n-react": "0.0.0-unstable.7be00a75a9",
|
|
28
|
+
"@webiny/plugins": "0.0.0-unstable.7be00a75a9",
|
|
29
|
+
"@webiny/react-composition": "0.0.0-unstable.7be00a75a9",
|
|
30
|
+
"@webiny/react-properties": "0.0.0-unstable.7be00a75a9",
|
|
31
|
+
"@webiny/stdlib": "0.0.0-unstable.7be00a75a9",
|
|
27
32
|
"apollo-cache": "1.3.5",
|
|
28
33
|
"apollo-cache-inmemory": "1.6.6",
|
|
29
34
|
"apollo-client": "2.6.10",
|
|
@@ -32,44 +37,39 @@
|
|
|
32
37
|
"apollo-link-error": "1.1.13",
|
|
33
38
|
"apollo-link-http-common": "0.2.16",
|
|
34
39
|
"apollo-utilities": "1.3.4",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
40
|
+
"graphql": "16.14.0",
|
|
41
|
+
"history": "5.3.0",
|
|
37
42
|
"invariant": "2.2.4",
|
|
38
|
-
"lodash": "4.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"react
|
|
42
|
-
"
|
|
43
|
+
"lodash": "4.18.1",
|
|
44
|
+
"mobx": "6.15.3",
|
|
45
|
+
"nanoid": "5.1.11",
|
|
46
|
+
"react": "18.3.1",
|
|
47
|
+
"react-dom": "18.3.1",
|
|
48
|
+
"ts-invariant": "0.10.3",
|
|
49
|
+
"warning": "4.0.3",
|
|
50
|
+
"zod": "4.4.3"
|
|
43
51
|
},
|
|
44
52
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"@webiny/cli": "^0.0.0-unstable.78f581c1d2",
|
|
53
|
-
"@webiny/project-utils": "^0.0.0-unstable.78f581c1d2",
|
|
54
|
-
"babel-plugin-lodash": "^3.3.4",
|
|
55
|
-
"rimraf": "^3.0.2",
|
|
56
|
-
"typescript": "4.7.4"
|
|
53
|
+
"@types/lodash": "4.17.24",
|
|
54
|
+
"@types/warning": "3.0.4",
|
|
55
|
+
"@webiny/build-tools": "0.0.0-unstable.7be00a75a9",
|
|
56
|
+
"rimraf": "6.1.3",
|
|
57
|
+
"type-fest": "5.6.0",
|
|
58
|
+
"typescript": "6.0.3",
|
|
59
|
+
"vitest": "4.1.7"
|
|
57
60
|
},
|
|
58
61
|
"publishConfig": {
|
|
59
|
-
"access": "public"
|
|
60
|
-
"directory": "dist"
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"build": "yarn webiny run build",
|
|
64
|
-
"watch": "yarn webiny run watch"
|
|
62
|
+
"access": "public"
|
|
65
63
|
},
|
|
66
64
|
"adio": {
|
|
67
65
|
"ignore": {
|
|
68
66
|
"dependencies": [
|
|
69
|
-
"@types/web",
|
|
70
67
|
"react-dom"
|
|
71
68
|
]
|
|
72
69
|
}
|
|
73
70
|
},
|
|
74
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
|
|
72
|
+
"webiny": {
|
|
73
|
+
"publishFrom": "dist"
|
|
74
|
+
}
|
|
75
75
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ApolloLink } from "apollo-link";
|
|
2
|
-
import { DocumentNode } from "graphql";
|
|
3
|
-
import { ApolloLinkPlugin } from "./ApolloLinkPlugin";
|
|
2
|
+
import type { DocumentNode } from "graphql";
|
|
3
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
|
|
4
|
+
declare module "graphql" {
|
|
5
|
+
interface DocumentNode {
|
|
6
|
+
__webiny__: Set<string>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
4
9
|
interface Config {
|
|
5
10
|
operationName: string;
|
|
6
11
|
selectionPath: string;
|
|
@@ -10,6 +15,8 @@ export declare class AddQuerySelectionPlugin extends ApolloLinkPlugin {
|
|
|
10
15
|
private readonly config;
|
|
11
16
|
constructor(config: Config);
|
|
12
17
|
createLink(): ApolloLink;
|
|
13
|
-
addSelectionToQuery(operationName: string,
|
|
18
|
+
addSelectionToQuery(operationName: string, document: DocumentNode): void;
|
|
19
|
+
private isProcessed;
|
|
20
|
+
private markProcessed;
|
|
14
21
|
}
|
|
15
22
|
export {};
|
|
@@ -1,132 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.AddQuerySelectionPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
|
-
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _apolloLink = require("apollo-link");
|
|
27
|
-
|
|
28
|
-
var _ApolloLinkPlugin2 = require("./ApolloLinkPlugin");
|
|
29
|
-
|
|
30
|
-
var AddQuerySelectionPlugin = /*#__PURE__*/function (_ApolloLinkPlugin) {
|
|
31
|
-
(0, _inherits2.default)(AddQuerySelectionPlugin, _ApolloLinkPlugin);
|
|
32
|
-
|
|
33
|
-
var _super = (0, _createSuper2.default)(AddQuerySelectionPlugin);
|
|
34
|
-
|
|
35
|
-
function AddQuerySelectionPlugin(config) {
|
|
36
|
-
var _this;
|
|
37
|
-
|
|
38
|
-
(0, _classCallCheck2.default)(this, AddQuerySelectionPlugin);
|
|
39
|
-
_this = _super.call(this);
|
|
40
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "config", void 0);
|
|
41
|
-
_this.config = config;
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
(0, _createClass2.default)(AddQuerySelectionPlugin, [{
|
|
46
|
-
key: "createLink",
|
|
47
|
-
value: function createLink() {
|
|
48
|
-
var _this2 = this;
|
|
49
|
-
|
|
50
|
-
return new _apolloLink.ApolloLink(function (operation, forward) {
|
|
51
|
-
if (operation.operationName !== _this2.config.operationName) {
|
|
52
|
-
return forward(operation);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
_this2.addSelectionToQuery(operation.operationName, operation.query);
|
|
56
|
-
|
|
57
|
-
return forward(operation);
|
|
58
|
-
});
|
|
1
|
+
import { ApolloLink } from "apollo-link";
|
|
2
|
+
import { ApolloLinkPlugin } from "./ApolloLinkPlugin.js";
|
|
3
|
+
class AddQuerySelectionPlugin extends ApolloLinkPlugin {
|
|
4
|
+
constructor(config){
|
|
5
|
+
super();
|
|
6
|
+
this.config = config;
|
|
59
7
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
_step;
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
fieldLoop: for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
89
|
-
var field = _step.value;
|
|
90
|
-
|
|
91
|
-
var _iterator2 = (0, _createForOfIteratorHelper2.default)(tree),
|
|
92
|
-
_step2;
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
96
|
-
var selection = _step2.value;
|
|
97
|
-
|
|
98
|
-
if (!selection.selectionSet) {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (selection.name.value === field) {
|
|
103
|
-
tree = selection.selectionSet.selections;
|
|
104
|
-
continue fieldLoop;
|
|
105
|
-
}
|
|
106
|
-
} // If we get here, it means we didn't find the necessary selection
|
|
107
|
-
|
|
108
|
-
} catch (err) {
|
|
109
|
-
_iterator2.e(err);
|
|
110
|
-
} finally {
|
|
111
|
-
_iterator2.f();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return;
|
|
8
|
+
createLink() {
|
|
9
|
+
return new ApolloLink((operation, forward)=>{
|
|
10
|
+
if (operation.operationName !== this.config.operationName) return forward(operation);
|
|
11
|
+
this.addSelectionToQuery(operation.operationName, operation.query);
|
|
12
|
+
return forward(operation);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
addSelectionToQuery(operationName, document) {
|
|
16
|
+
if (operationName !== this.config.operationName) return;
|
|
17
|
+
if (this.isProcessed(document)) return;
|
|
18
|
+
this.markProcessed(document);
|
|
19
|
+
const { addSelection, selectionPath } = this.config;
|
|
20
|
+
const firstQueryDefinition = document.definitions[0];
|
|
21
|
+
if (!firstQueryDefinition) return;
|
|
22
|
+
if (!firstQueryDefinition.selectionSet) return;
|
|
23
|
+
let tree = firstQueryDefinition.selectionSet.selections;
|
|
24
|
+
const fields = selectionPath.split(".");
|
|
25
|
+
fieldLoop: for (const field of fields){
|
|
26
|
+
for (const selection of tree)if (selection.selectionSet) {
|
|
27
|
+
if (selection.name.value === field) {
|
|
28
|
+
tree = selection.selectionSet.selections;
|
|
29
|
+
continue fieldLoop;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
115
33
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
(_tree = tree).push.apply(_tree, (0, _toConsumableArray2.default)(addSelection.definitions[0].selectionSet.selections));
|
|
34
|
+
tree.push(...addSelection.definitions[0].selectionSet.selections);
|
|
35
|
+
}
|
|
36
|
+
isProcessed(document) {
|
|
37
|
+
if (!document.hasOwnProperty("__webiny__")) document.__webiny__ = new Set();
|
|
38
|
+
return document.__webiny__.has(this.cacheKey);
|
|
39
|
+
}
|
|
40
|
+
markProcessed(document) {
|
|
41
|
+
if (!document.hasOwnProperty("__webiny__")) document.__webiny__ = new Set();
|
|
42
|
+
document.__webiny__.add(this.cacheKey);
|
|
127
43
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}(_ApolloLinkPlugin2.ApolloLinkPlugin);
|
|
44
|
+
}
|
|
45
|
+
export { AddQuerySelectionPlugin };
|
|
131
46
|
|
|
132
|
-
|
|
47
|
+
//# sourceMappingURL=AddQuerySelectionPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/AddQuerySelectionPlugin.js","sources":["../../src/plugins/AddQuerySelectionPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport type { DocumentNode } from \"graphql\";\nimport { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { ExecutableDefinitionNode, FieldNode } from \"graphql/language/ast.js\";\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"],"names":["AddQuerySelectionPlugin","ApolloLinkPlugin","config","ApolloLink","operation","forward","operationName","document","addSelection","selectionPath","firstQueryDefinition","tree","fields","fieldLoop","field","selection","Set"],"mappings":";;AAiBO,MAAMA,gCAAgCC;IAGzC,YAAYC,MAAc,CAAE;QACxB,KAAK;QACL,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEgB,aAAyB;QACrC,OAAO,IAAIC,WAAW,CAACC,WAAWC;YAC9B,IAAID,UAAU,aAAa,KAAK,IAAI,CAAC,MAAM,CAAC,aAAa,EACrD,OAAOC,QAAQD;YAGnB,IAAI,CAAC,mBAAmB,CAACA,UAAU,aAAa,EAAEA,UAAU,KAAK;YAEjE,OAAOC,QAAQD;QACnB;IACJ;IAEO,oBAAoBE,aAAqB,EAAEC,QAAsB,EAAQ;QAC5E,IAAID,kBAAkB,IAAI,CAAC,MAAM,CAAC,aAAa,EAC3C;QAKJ,IAAI,IAAI,CAAC,WAAW,CAACC,WACjB;QAGJ,IAAI,CAAC,aAAa,CAACA;QAEnB,MAAM,EAAEC,YAAY,EAAEC,aAAa,EAAE,GAAG,IAAI,CAAC,MAAM;QAEnD,MAAMC,uBAAuBH,SAAS,WAAW,CAAC,EAAE;QACpD,IAAI,CAACG,sBACD;QACG,IAAI,CAACA,qBAAqB,YAAY,EACzC;QAGJ,IAAIC,OAAOD,qBAAqB,YAAY,CAAC,UAAU;QACvD,MAAME,SAASH,cAAc,KAAK,CAAC;QAEnCI,WAAW,KAAK,MAAMC,SAASF,OAAQ;YACnC,KAAK,MAAMG,aAAaJ,KACpB,IAAKI,UAAU,YAAY,EAG3B;gBAAA,IAAIA,UAAU,IAAI,CAAC,KAAK,KAAKD,OAAO;oBAChCH,OAAOI,UAAU,YAAY,CAAC,UAAU;oBACxC,SAASF;gBACb;YAAA;YAGJ;QACJ;QAIAF,KAAK,IAAI,IACAH,aAAa,WAAW,CAAC,EAAE,CAA8B,YAAY,CACrE,UAAU;IAEvB;IAEQ,YAAYD,QAAsB,EAAE;QACxC,IAAI,CAACA,SAAS,cAAc,CAAC,eACzBA,SAAS,UAAU,GAAG,IAAIS;QAG9B,OAAOT,SAAS,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ;IAChD;IAEQ,cAAcA,QAAsB,EAAE;QAC1C,IAAI,CAACA,SAAS,cAAc,CAAC,eACzBA,SAAS,UAAU,GAAG,IAAIS;QAG9BT,SAAS,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ;IACzC;AACJ"}
|
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _plugins = require("@webiny/plugins");
|
|
23
|
-
|
|
24
|
-
var ApolloCacheObjectIdPlugin = /*#__PURE__*/function (_Plugin) {
|
|
25
|
-
(0, _inherits2.default)(ApolloCacheObjectIdPlugin, _Plugin);
|
|
26
|
-
|
|
27
|
-
var _super = (0, _createSuper2.default)(ApolloCacheObjectIdPlugin);
|
|
28
|
-
|
|
29
|
-
function ApolloCacheObjectIdPlugin(getObjectId) {
|
|
30
|
-
var _this;
|
|
31
|
-
|
|
32
|
-
(0, _classCallCheck2.default)(this, ApolloCacheObjectIdPlugin);
|
|
33
|
-
_this = _super.call(this);
|
|
34
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_getObjectId", void 0);
|
|
35
|
-
_this._getObjectId = getObjectId;
|
|
36
|
-
return _this;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
(0, _createClass2.default)(ApolloCacheObjectIdPlugin, [{
|
|
40
|
-
key: "getObjectId",
|
|
41
|
-
value: function getObjectId(data) {
|
|
42
|
-
if (typeof this._getObjectId !== "function") {
|
|
43
|
-
throw Error("You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return this._getObjectId(data);
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
class ApolloCacheObjectIdPlugin extends Plugin {
|
|
3
|
+
static{
|
|
4
|
+
this.type = "cache-get-object-id";
|
|
5
|
+
}
|
|
6
|
+
constructor(getObjectId){
|
|
7
|
+
super();
|
|
8
|
+
this._getObjectId = getObjectId;
|
|
9
|
+
}
|
|
10
|
+
getObjectId(data) {
|
|
11
|
+
if ("function" != typeof this._getObjectId) throw Error('You must provide a "getObjectId" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.');
|
|
12
|
+
return this._getObjectId(data);
|
|
47
13
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}(_plugins.Plugin);
|
|
14
|
+
}
|
|
15
|
+
export { ApolloCacheObjectIdPlugin };
|
|
51
16
|
|
|
52
|
-
|
|
53
|
-
(0, _defineProperty2.default)(ApolloCacheObjectIdPlugin, "type", "cache-get-object-id");
|
|
17
|
+
//# sourceMappingURL=ApolloCacheObjectIdPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/ApolloCacheObjectIdPlugin.js","sources":["../../src/plugins/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"],"names":["ApolloCacheObjectIdPlugin","Plugin","getObjectId","data","Error"],"mappings":";AAYO,MAAMA,kCAEHC;;aAC0B,IAAI,GAAW;;IAG/C,YAAmBC,WAAkD,CAAE;QACnE,KAAK;QACL,IAAI,CAAC,YAAY,GAAGA;IACxB;IAEO,YAAYC,IAAO,EAAE;QACxB,IAAI,AAA6B,cAA7B,OAAO,IAAI,CAAC,YAAY,EACxB,MAAMC,MACF;QAIR,OAAO,IAAI,CAAC,YAAY,CAACD;IAC7B;AACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { NextLink } from "apollo-link";
|
|
2
|
+
import { ApolloLink } from "apollo-link";
|
|
3
|
+
import type { Operation } from "apollo-link/lib/types.js";
|
|
3
4
|
export declare class ApolloDynamicLink extends ApolloLink {
|
|
4
5
|
private cache;
|
|
5
6
|
request(operation: Operation, forward: NextLink): any;
|
|
@@ -1,83 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ApolloDynamicLink = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _apolloLink = require("apollo-link");
|
|
23
|
-
|
|
24
|
-
var _plugins = require("@webiny/plugins");
|
|
25
|
-
|
|
1
|
+
import { ApolloLink } from "apollo-link";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
26
3
|
function createLink(plugin) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return null;
|
|
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;
|
|
35
11
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
-
args[_key] = arguments[_key];
|
|
12
|
+
class ApolloDynamicLink extends ApolloLink {
|
|
13
|
+
request(operation, forward) {
|
|
14
|
+
const linkPlugins = plugins.byType("apollo-link");
|
|
15
|
+
if (!linkPlugins.length) return forward(operation);
|
|
16
|
+
const cacheKey = linkPlugins.map((pl)=>pl.cacheKey).join(",");
|
|
17
|
+
if (!this.cache.has(cacheKey)) {
|
|
18
|
+
const links = linkPlugins.map(createLink).filter(Boolean);
|
|
19
|
+
this.cache.set(cacheKey, ApolloLink.from(links));
|
|
20
|
+
}
|
|
21
|
+
return this.cache.get(cacheKey).request(operation, forward);
|
|
49
22
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cache", new Map());
|
|
53
|
-
return _this;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
(0, _createClass2.default)(ApolloDynamicLink, [{
|
|
57
|
-
key: "request",
|
|
58
|
-
value: function request(operation, forward) {
|
|
59
|
-
var linkPlugins = _plugins.plugins.byType("apollo-link");
|
|
60
|
-
|
|
61
|
-
if (!linkPlugins.length) {
|
|
62
|
-
return forward(operation);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var cacheKey = linkPlugins.map(function (pl) {
|
|
66
|
-
return pl.cacheKey;
|
|
67
|
-
}).join(",");
|
|
68
|
-
|
|
69
|
-
if (!this.cache.has(cacheKey)) {
|
|
70
|
-
/**
|
|
71
|
-
* We filter out falsy items from the linkPlugins because there might be some error while creating link.
|
|
72
|
-
*/
|
|
73
|
-
var links = linkPlugins.map(createLink).filter(Boolean);
|
|
74
|
-
this.cache.set(cacheKey, _apolloLink.ApolloLink.from(links));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return this.cache.get(cacheKey).request(operation, forward);
|
|
23
|
+
constructor(...args){
|
|
24
|
+
super(...args), this.cache = new Map();
|
|
78
25
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}(_apolloLink.ApolloLink);
|
|
26
|
+
}
|
|
27
|
+
export { ApolloDynamicLink };
|
|
82
28
|
|
|
83
|
-
|
|
29
|
+
//# sourceMappingURL=ApolloDynamicLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/ApolloDynamicLink.js","sources":["../../src/plugins/ApolloDynamicLink.ts"],"sourcesContent":["import type { NextLink } from \"apollo-link\";\nimport { ApolloLink } from \"apollo-link\";\nimport { plugins } from \"@webiny/plugins\";\nimport type { ApolloLinkPlugin } from \"./ApolloLinkPlugin.js\";\nimport type { Operation } from \"apollo-link/lib/types.js\";\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"],"names":["createLink","plugin","e","console","ApolloDynamicLink","ApolloLink","operation","forward","linkPlugins","plugins","cacheKey","pl","links","Boolean","Map"],"mappings":";;AAMA,SAASA,WAAWC,MAAwB;IACxC,IAAI;QACA,OAAOA,OAAO,UAAU;IAC5B,EAAE,OAAOC,GAAG;QACRC,QAAQ,KAAK,CAAC,0DAA0DF;QACxEE,QAAQ,KAAK,CAACD;IAClB;IACA,OAAO;AACX;AAEO,MAAME,0BAA0BC;IAGnB,QAAQC,SAAoB,EAAEC,OAAiB,EAAE;QAC7D,MAAMC,cAAcC,QAAQ,MAAM,CAAmB;QAErD,IAAI,CAACD,YAAY,MAAM,EACnB,OAAOD,QAAQD;QAGnB,MAAMI,WAAWF,YAAY,GAAG,CAACG,CAAAA,KAAMA,GAAG,QAAQ,EAAE,IAAI,CAAC;QAEzD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACD,WAAW;YAI3B,MAAME,QAAQJ,YAAY,GAAG,CAACR,YAAY,MAAM,CAACa;YACjD,IAAI,CAAC,KAAK,CAAC,GAAG,CAACH,UAAUL,WAAW,IAAI,CAACO;QAC7C;QAEA,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACF,UAAU,OAAO,CAACJ,WAAWC;IACvD;;QArBG,qBACK,KAAK,GAAG,IAAIO;;AAqBxB"}
|