@webiny/app 5.44.1-beta.0 → 5.45.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +5 -13
- package/App.js +70 -87
- package/App.js.map +1 -1
- package/AppContainer.d.ts +23 -0
- package/AppContainer.js +9 -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 -47
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +2 -2
- package/apollo-client/IntrospectionFragmentMatcher.js +33 -50
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -1
- package/components/Image.d.ts +1 -2
- package/components/Image.js +11 -19
- package/components/Image.js.map +1 -1
- package/components/index.d.ts +1 -2
- package/components/index.js +1 -19
- package/components/index.js.map +1 -1
- package/config/RouterConfig/Route.d.ts +29 -0
- package/config/RouterConfig/Route.js +33 -0
- package/config/RouterConfig/Route.js.map +1 -0
- package/config/RouterConfig.d.ts +31 -0
- package/config/RouterConfig.js +18 -0
- package/config/RouterConfig.js.map +1 -0
- package/config.js +9 -15
- package/config.js.map +1 -1
- package/contexts/Ui/index.js +28 -52
- package/contexts/Ui/index.js.map +1 -1
- package/core/DebounceRender.js +13 -24
- package/core/DebounceRender.js.map +1 -1
- package/core/Plugin.d.ts +1 -1
- package/core/Plugin.js +11 -19
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.d.ts +1 -1
- package/core/Plugins.js +20 -25
- package/core/Plugins.js.map +1 -1
- package/core/Provider.d.ts +1 -1
- package/core/Provider.js +9 -13
- package/core/Provider.js.map +1 -1
- package/core/Routes.d.ts +2 -1
- package/core/Routes.js +13 -23
- package/core/Routes.js.map +1 -1
- package/core/createProvider.d.ts +2 -2
- package/core/createProvider.js +1 -7
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.d.ts +1 -1
- package/core/createProviderPlugin.js +4 -10
- package/core/createProviderPlugin.js.map +1 -1
- package/errors/AuthenticationErrorEvent.d.ts +9 -0
- package/errors/AuthenticationErrorEvent.js +10 -0
- package/errors/AuthenticationErrorEvent.js.map +1 -0
- package/errors/NetworkErrorEvent.d.ts +15 -0
- package/errors/NetworkErrorEvent.js +10 -0
- package/errors/NetworkErrorEvent.js.map +1 -0
- package/errors/abstractions.d.ts +12 -0
- package/errors/abstractions.js +5 -0
- package/errors/abstractions.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.js +6 -0
- package/errors/index.js.map +1 -0
- package/exports/admin/envConfig.d.ts +1 -0
- package/exports/admin/envConfig.js +3 -0
- package/exports/admin/envConfig.js.map +1 -0
- package/exports/admin/graphqlClient.d.ts +1 -0
- package/exports/admin/graphqlClient.js +3 -0
- package/exports/admin/graphqlClient.js.map +1 -0
- package/exports/admin/localStorage.d.ts +2 -0
- package/exports/admin/localStorage.js +4 -0
- package/exports/admin/localStorage.js.map +1 -0
- package/exports/admin/router.d.ts +4 -0
- package/exports/admin/router.js +6 -0
- package/exports/admin/router.js.map +1 -0
- package/exports/admin/security.d.ts +1 -0
- package/exports/admin/security.js +3 -0
- package/exports/admin/security.js.map +1 -0
- package/exports/admin.d.ts +6 -0
- package/exports/admin.js +8 -0
- package/exports/admin.js.map +1 -0
- package/features/envConfig/EnvConfig.d.ts +6 -0
- package/features/envConfig/EnvConfig.js +14 -0
- package/features/envConfig/EnvConfig.js.map +1 -0
- package/features/envConfig/abstractions.d.ts +27 -0
- package/features/envConfig/abstractions.js +4 -0
- package/features/envConfig/abstractions.js.map +1 -0
- package/features/envConfig/feature.d.ts +17 -0
- package/features/envConfig/feature.js +14 -0
- package/features/envConfig/feature.js.map +1 -0
- package/features/envConfig/index.d.ts +1 -0
- package/features/envConfig/index.js +3 -0
- package/features/envConfig/index.js.map +1 -0
- package/features/eventPublisher/EventPublisher.d.ts +8 -0
- package/features/eventPublisher/EventPublisher.js +27 -0
- package/features/eventPublisher/EventPublisher.js.map +1 -0
- package/features/eventPublisher/abstractions.d.ts +18 -0
- package/features/eventPublisher/abstractions.js +14 -0
- package/features/eventPublisher/abstractions.js.map +1 -0
- package/features/eventPublisher/feature.d.ts +1 -0
- package/features/eventPublisher/feature.js +11 -0
- package/features/eventPublisher/feature.js.map +1 -0
- package/features/eventPublisher/index.d.ts +3 -0
- package/features/eventPublisher/index.js +4 -0
- package/features/eventPublisher/index.js.map +1 -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 +18 -0
- package/features/graphqlClient/BatchingGraphQLClient.js +164 -0
- package/features/graphqlClient/BatchingGraphQLClient.js.map +1 -0
- package/features/graphqlClient/FetchGraphQLClient.d.ts +10 -0
- package/features/graphqlClient/FetchGraphQLClient.js +62 -0
- package/features/graphqlClient/FetchGraphQLClient.js.map +1 -0
- package/features/graphqlClient/NetworkErrorPublishing.d.ts +14 -0
- package/features/graphqlClient/NetworkErrorPublishing.js +55 -0
- package/features/graphqlClient/NetworkErrorPublishing.js.map +1 -0
- package/features/graphqlClient/RequestValue.d.ts +20 -0
- package/features/graphqlClient/RequestValue.js +42 -0
- package/features/graphqlClient/RequestValue.js.map +1 -0
- package/features/graphqlClient/RetryGraphQLClient.d.ts +18 -0
- package/features/graphqlClient/RetryGraphQLClient.js +54 -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 +350 -0
- package/features/graphqlClient/__tests__/GraphQLClient.test.js.map +1 -0
- package/features/graphqlClient/abstractions.d.ts +17 -0
- package/features/graphqlClient/abstractions.js +4 -0
- package/features/graphqlClient/abstractions.js.map +1 -0
- package/features/graphqlClient/feature.d.ts +6 -0
- package/features/graphqlClient/feature.js +31 -0
- package/features/graphqlClient/feature.js.map +1 -0
- package/features/graphqlClient/index.d.ts +1 -0
- package/features/graphqlClient/index.js +3 -0
- package/features/graphqlClient/index.js.map +1 -0
- package/features/graphqlClient/types.d.ts +5 -0
- package/features/graphqlClient/types.js +3 -0
- package/features/graphqlClient/types.js.map +1 -0
- package/features/localStorage/BrowserLocalStorageGateway.d.ts +9 -0
- package/features/localStorage/BrowserLocalStorageGateway.js +68 -0
- package/features/localStorage/BrowserLocalStorageGateway.js.map +1 -0
- package/features/localStorage/LocalStorage.d.ts +12 -0
- package/features/localStorage/LocalStorage.js +31 -0
- package/features/localStorage/LocalStorage.js.map +1 -0
- package/features/localStorage/LocalStorageRepository.d.ts +20 -0
- package/features/localStorage/LocalStorageRepository.js +95 -0
- package/features/localStorage/LocalStorageRepository.js.map +1 -0
- package/features/localStorage/abstractions.d.ts +48 -0
- package/features/localStorage/abstractions.js +19 -0
- package/features/localStorage/abstractions.js.map +1 -0
- package/features/localStorage/feature.d.ts +12 -0
- package/features/localStorage/feature.js +34 -0
- package/features/localStorage/feature.js.map +1 -0
- package/features/localStorage/index.d.ts +1 -0
- package/features/localStorage/index.js +3 -0
- package/features/localStorage/index.js.map +1 -0
- package/features/router/HistoryRouterGateway.d.ts +18 -0
- package/features/router/HistoryRouterGateway.js +82 -0
- package/features/router/HistoryRouterGateway.js.map +1 -0
- package/features/router/HistoryRouterGateway.test.d.ts +1 -0
- package/features/router/HistoryRouterGateway.test.js +204 -0
- package/features/router/HistoryRouterGateway.test.js.map +1 -0
- package/features/router/Route.d.ts +19 -0
- package/features/router/Route.js +59 -0
- package/features/router/Route.js.map +1 -0
- package/features/router/RouteUrl.d.ts +85 -0
- package/features/router/RouteUrl.js +232 -0
- package/features/router/RouteUrl.js.map +1 -0
- package/features/router/Router.d.ts +45 -0
- package/features/router/Router.js +129 -0
- package/features/router/Router.js.map +1 -0
- package/features/router/RouterPresenter.d.ts +17 -0
- package/features/router/RouterPresenter.js +45 -0
- package/features/router/RouterPresenter.js.map +1 -0
- package/features/router/RouterRepository.d.ts +21 -0
- package/features/router/RouterRepository.js +71 -0
- package/features/router/RouterRepository.js.map +1 -0
- package/features/router/RouterRepository.test.d.ts +1 -0
- package/features/router/RouterRepository.test.js +154 -0
- package/features/router/RouterRepository.test.js.map +1 -0
- package/features/router/abstractions.d.ts +68 -0
- package/features/router/abstractions.js +15 -0
- package/features/router/abstractions.js.map +1 -0
- package/features/router/feature.d.ts +4 -0
- package/features/router/feature.js +18 -0
- package/features/router/feature.js.map +1 -0
- package/features/router/index.d.ts +1 -0
- package/features/router/index.js +3 -0
- package/features/router/index.js.map +1 -0
- package/helpers/InterfaceGenerator/date.d.ts +15 -0
- package/helpers/InterfaceGenerator/date.js +3 -0
- package/helpers/InterfaceGenerator/date.js.map +1 -0
- package/helpers/InterfaceGenerator/id.d.ts +23 -0
- package/helpers/InterfaceGenerator/id.js +3 -0
- package/helpers/InterfaceGenerator/id.js.map +1 -0
- package/helpers/InterfaceGenerator/identity.d.ts +10 -0
- package/helpers/InterfaceGenerator/identity.js +3 -0
- package/helpers/InterfaceGenerator/identity.js.map +1 -0
- package/helpers/InterfaceGenerator/index.d.ts +5 -0
- package/helpers/InterfaceGenerator/index.js +3 -0
- package/helpers/InterfaceGenerator/index.js.map +1 -0
- package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
- package/helpers/InterfaceGenerator/numeric.js +3 -0
- package/helpers/InterfaceGenerator/numeric.js.map +1 -0
- package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
- package/helpers/InterfaceGenerator/truthful.js +3 -0
- package/helpers/InterfaceGenerator/truthful.js.map +1 -0
- package/hooks/useAutocomplete/index.d.ts +1 -1
- package/hooks/useAutocomplete/index.js +1 -12
- package/hooks/useAutocomplete/index.js.map +1 -1
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +6 -16
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +2 -11
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +2 -11
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +2 -11
- 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 -27
- package/hooks/useDataList/functions/index.js.map +1 -1
- package/hooks/useDataList/functions/searchDataByKey.js +4 -10
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.d.ts +1 -1
- package/hooks/useDataList/index.js +1 -12
- package/hooks/useDataList/index.js.map +1 -1
- package/hooks/useDataList/useDataList.d.ts +2 -3
- package/hooks/useDataList/useDataList.js +74 -94
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.d.ts +1 -2
- package/hooks/useDataList/utils/index.js +1 -20
- package/hooks/useDataList/utils/index.js.map +1 -1
- package/hooks/useDataList/utils/prepareLoadListParams.js +10 -16
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useHandler.js +7 -12
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.js +11 -17
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +1 -1
- package/hooks/useRegisterLegacyPlugin.js +5 -11
- package/hooks/useRegisterLegacyPlugin.js.map +1 -1
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +4 -10
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +5 -13
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -13
- package/i18n/index.js.map +1 -1
- package/index.d.ts +23 -15
- package/index.js +25 -177
- package/index.js.map +1 -1
- package/package.json +25 -22
- package/plugins/AddQuerySelectionPlugin.d.ts +2 -2
- package/plugins/AddQuerySelectionPlugin.js +61 -107
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +12 -31
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +19 -46
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +18 -37
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.d.ts +1 -1
- package/plugins/ConsoleLinkPlugin.js +20 -41
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +8 -13
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +35 -58
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.d.ts +14 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js +31 -0
- package/plugins/NetworkErrorLinkPlugin/GqlErrorOverlay.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.d.ts +2 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js +31 -0
- package/plugins/NetworkErrorLinkPlugin/LocalAwsLambdaTimeoutMessage.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +4 -5
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +68 -12
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/Typography.d.ts +8 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js +18 -0
- package/plugins/NetworkErrorLinkPlugin/Typography.js.map +1 -0
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +3 -3
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +10 -25
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.d.ts +4 -1
- package/plugins/NetworkErrorLinkPlugin.js +60 -37
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.d.ts +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +11 -30
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +3 -3
- package/plugins/TenantHeaderLinkPlugin.js +29 -48
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/components/Image.d.ts +6 -0
- package/plugins/components/Image.js +19 -0
- package/plugins/components/Image.js.map +1 -0
- package/plugins/image.d.ts +1 -1
- package/plugins/image.js +46 -53
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +4 -4
- package/plugins/index.js +31 -53
- package/plugins/index.js.map +1 -1
- package/presentation/localStorage/index.d.ts +3 -0
- package/presentation/localStorage/index.js +5 -0
- package/presentation/localStorage/index.js.map +1 -0
- package/presentation/localStorage/useLocalStorage.d.ts +6 -0
- package/presentation/localStorage/useLocalStorage.js +21 -0
- package/presentation/localStorage/useLocalStorage.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValue.d.ts +1 -0
- package/presentation/localStorage/useLocalStorageValue.js +20 -0
- package/presentation/localStorage/useLocalStorageValue.js.map +1 -0
- package/presentation/localStorage/useLocalStorageValues.d.ts +5 -0
- package/presentation/localStorage/useLocalStorageValues.js +39 -0
- package/presentation/localStorage/useLocalStorageValues.js.map +1 -0
- package/presentation/router/RouteElementRegistry.d.ts +14 -0
- package/presentation/router/RouteElementRegistry.js +32 -0
- package/presentation/router/RouteElementRegistry.js.map +1 -0
- package/presentation/router/abstractions.d.ts +13 -0
- package/presentation/router/abstractions.js +4 -0
- package/presentation/router/abstractions.js.map +1 -0
- package/presentation/router/components/RouteContent.d.ts +2 -0
- package/presentation/router/components/RouteContent.js +17 -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 +22 -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 +30 -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 +30 -0
- package/presentation/router/hooks/useRoute.js.map +1 -0
- package/presentation/router/hooks/useRouter.d.ts +7 -0
- package/presentation/router/hooks/useRouter.js +26 -0
- package/presentation/router/hooks/useRouter.js.map +1 -0
- package/presentation/router/index.d.ts +4 -0
- package/presentation/router/index.js +5 -0
- package/presentation/router/index.js.map +1 -0
- package/presentation/router/types.d.ts +5 -0
- package/presentation/router/types.js +3 -0
- package/presentation/router/types.js.map +1 -0
- package/react-butterfiles/Files.js +208 -235
- package/react-butterfiles/Files.js.map +1 -1
- package/react-butterfiles/file.todo +1 -0
- package/react-butterfiles/index.d.ts +1 -1
- package/react-butterfiles/index.js +2 -8
- package/react-butterfiles/index.js.map +1 -1
- package/react-butterfiles/utils/generateId.js +1 -7
- package/react-butterfiles/utils/generateId.js.map +1 -1
- package/react-butterfiles/utils/readFileContent.js +4 -10
- package/react-butterfiles/utils/readFileContent.js.map +1 -1
- package/renderApp.d.ts +1 -1
- package/renderApp.js +4 -11
- package/renderApp.js.map +1 -1
- package/router.d.ts +5 -0
- package/router.js +8 -0
- package/router.js.map +1 -0
- package/shared/di/DiContainerProvider.d.ts +8 -0
- package/shared/di/DiContainerProvider.js +17 -0
- package/shared/di/DiContainerProvider.js.map +1 -0
- package/shared/di/createFeature.d.ts +11 -0
- package/shared/di/createFeature.js +11 -0
- package/shared/di/createFeature.js.map +1 -0
- package/shared/di/useFeature.d.ts +2 -0
- package/shared/di/useFeature.js +18 -0
- package/shared/di/useFeature.js.map +1 -0
- package/types.d.ts +9 -6
- package/types.js +1 -12
- package/types.js.map +1 -1
- package/utils/createGenericContext.js +13 -22
- package/utils/createGenericContext.js.map +1 -1
- package/utils/createHashing.js +9 -15
- package/utils/createHashing.js.map +1 -1
- package/utils/index.d.ts +2 -10
- package/utils/index.js +2 -115
- package/utils/index.js.map +1 -1
- package/utils/legacyPluginToReactComponent.d.ts +1 -1
- package/utils/legacyPluginToReactComponent.js +5 -11
- package/utils/legacyPluginToReactComponent.js.map +1 -1
- package/components/Routes.d.ts +0 -2
- package/components/Routes.js +0 -46
- package/components/Routes.js.map +0 -1
- package/components/View.d.ts +0 -8
- package/components/View.js +0 -31
- package/components/View.js.map +0 -1
- package/core/AddRoute.d.ts +0 -21
- package/core/AddRoute.js +0 -21
- package/core/AddRoute.js.map +0 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.d.ts +0 -14
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +0 -30
- 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 -7
- package/hooks/useDataList/utils/types.js.map +0 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -10
- package/plugins/LocaleHeaderLinkPlugin.js +0 -49
- package/plugins/LocaleHeaderLinkPlugin.js.map +0 -1
- package/plugins/RoutePlugin.d.ts +0 -12
- package/plugins/RoutePlugin.js +0 -35
- package/plugins/RoutePlugin.js.map +0 -1
- package/plugins/ViewPlugin.d.ts +0 -14
- package/plugins/ViewPlugin.js +0 -40
- package/plugins/ViewPlugin.js.map +0 -1
- package/utils/getApiUrl.d.ts +0 -1
- package/utils/getApiUrl.js +0 -12
- package/utils/getApiUrl.js.map +0 -1
- package/utils/getGqlApiUrl.d.ts +0 -1
- package/utils/getGqlApiUrl.js +0 -12
- package/utils/getGqlApiUrl.js.map +0 -1
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +0 -5
- package/utils/getHeadlessCmsGqlApiUrl.js +0 -18
- package/utils/getHeadlessCmsGqlApiUrl.js.map +0 -1
- package/utils/getLocaleCode.d.ts +0 -6
- package/utils/getLocaleCode.js +0 -43
- package/utils/getLocaleCode.js.map +0 -1
- package/utils/getPrerenderId.d.ts +0 -6
- package/utils/getPrerenderId.js +0 -11
- package/utils/getPrerenderId.js.map +0 -1
- package/utils/getTenantId.d.ts +0 -6
- package/utils/getTenantId.js +0 -51
- package/utils/getTenantId.js.map +0 -1
- package/utils/isLocalhost.d.ts +0 -1
- package/utils/isLocalhost.js +0 -15
- package/utils/isLocalhost.js.map +0 -1
- package/utils/isPrerendering.d.ts +0 -1
- package/utils/isPrerendering.js +0 -11
- package/utils/isPrerendering.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LocalStorageRepository as LocalStorageRepositoryAbstraction, LocalStorageConfig, LocalStorageGateway } from "./abstractions.js";
|
|
2
|
+
export declare class LocalStorageRepositoryImpl implements LocalStorageRepositoryAbstraction.Interface {
|
|
3
|
+
private gateway;
|
|
4
|
+
private readonly prefix;
|
|
5
|
+
private store;
|
|
6
|
+
private unsubscribe?;
|
|
7
|
+
constructor(gateway: LocalStorageGateway.Interface, config: LocalStorageConfig.Interface);
|
|
8
|
+
private withPrefix;
|
|
9
|
+
private stripPrefix;
|
|
10
|
+
private bootstrap;
|
|
11
|
+
private subscribeToChanges;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
has(key: string): boolean;
|
|
14
|
+
get<T = string>(key: string): T | undefined;
|
|
15
|
+
set<T = string>(key: string, value: T): void;
|
|
16
|
+
remove(key: string): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
keys(): string[];
|
|
19
|
+
}
|
|
20
|
+
export declare const LocalStorageRepository: import("@webiny/di").Implementation<typeof LocalStorageRepositoryImpl>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { makeAutoObservable, runInAction } from "mobx";
|
|
2
|
+
import { LocalStorageRepository as LocalStorageRepositoryAbstraction, LocalStorageConfig, LocalStorageGateway } from "./abstractions.js";
|
|
3
|
+
import { createImplementation } from "@webiny/di";
|
|
4
|
+
export class LocalStorageRepositoryImpl {
|
|
5
|
+
store = new Map();
|
|
6
|
+
constructor(gateway, config) {
|
|
7
|
+
this.gateway = gateway;
|
|
8
|
+
this.prefix = config.prefix || "";
|
|
9
|
+
makeAutoObservable(this);
|
|
10
|
+
this.bootstrap();
|
|
11
|
+
this.subscribeToChanges();
|
|
12
|
+
}
|
|
13
|
+
withPrefix(key) {
|
|
14
|
+
return this.prefix ? `${this.prefix}:${key}` : key;
|
|
15
|
+
}
|
|
16
|
+
stripPrefix(key) {
|
|
17
|
+
return this.prefix ? key.replace(new RegExp(`^${this.prefix}:`), "") : key;
|
|
18
|
+
}
|
|
19
|
+
bootstrap() {
|
|
20
|
+
const all = this.gateway.getAll();
|
|
21
|
+
for (const [key, value] of Object.entries(all)) {
|
|
22
|
+
if (!this.prefix || key.startsWith(this.prefix + ":")) {
|
|
23
|
+
this.store.set(this.stripPrefix(key), value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
subscribeToChanges() {
|
|
28
|
+
this.unsubscribe = this.gateway.subscribe(ev => {
|
|
29
|
+
runInAction(() => {
|
|
30
|
+
if (ev instanceof StorageEvent && ev.key) {
|
|
31
|
+
if (!this.prefix || ev.key.startsWith(this.prefix + ":")) {
|
|
32
|
+
const cleanKey = this.stripPrefix(ev.key);
|
|
33
|
+
if (ev.newValue !== null) {
|
|
34
|
+
try {
|
|
35
|
+
this.store.set(cleanKey, JSON.parse(ev.newValue));
|
|
36
|
+
} catch {
|
|
37
|
+
this.store.set(cleanKey, ev.newValue);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
this.store.delete(cleanKey);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (ev instanceof CustomEvent) {
|
|
45
|
+
const {
|
|
46
|
+
key,
|
|
47
|
+
value,
|
|
48
|
+
action
|
|
49
|
+
} = ev.detail;
|
|
50
|
+
if (!this.prefix || key.startsWith(this.prefix + ":")) {
|
|
51
|
+
const cleanKey = this.stripPrefix(key);
|
|
52
|
+
if (action === "set") {
|
|
53
|
+
this.store.set(cleanKey, value);
|
|
54
|
+
}
|
|
55
|
+
if (action === "remove") {
|
|
56
|
+
this.store.delete(cleanKey);
|
|
57
|
+
}
|
|
58
|
+
if (action === "clear") {
|
|
59
|
+
this.store.clear();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
destroy() {
|
|
67
|
+
this.unsubscribe?.();
|
|
68
|
+
}
|
|
69
|
+
has(key) {
|
|
70
|
+
return this.store.has(key);
|
|
71
|
+
}
|
|
72
|
+
get(key) {
|
|
73
|
+
return this.store.get(key);
|
|
74
|
+
}
|
|
75
|
+
set(key, value) {
|
|
76
|
+
this.gateway.set(this.withPrefix(key), value);
|
|
77
|
+
}
|
|
78
|
+
remove(key) {
|
|
79
|
+
this.gateway.remove(this.withPrefix(key));
|
|
80
|
+
}
|
|
81
|
+
clear() {
|
|
82
|
+
this.gateway.clear();
|
|
83
|
+
this.store.clear();
|
|
84
|
+
}
|
|
85
|
+
keys() {
|
|
86
|
+
return Array.from(this.store.keys());
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export const LocalStorageRepository = createImplementation({
|
|
90
|
+
abstraction: LocalStorageRepositoryAbstraction,
|
|
91
|
+
implementation: LocalStorageRepositoryImpl,
|
|
92
|
+
dependencies: [LocalStorageGateway, LocalStorageConfig]
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=LocalStorageRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","runInAction","LocalStorageRepository","LocalStorageRepositoryAbstraction","LocalStorageConfig","LocalStorageGateway","createImplementation","LocalStorageRepositoryImpl","store","Map","constructor","gateway","config","prefix","bootstrap","subscribeToChanges","withPrefix","key","stripPrefix","replace","RegExp","all","getAll","value","Object","entries","startsWith","set","unsubscribe","subscribe","ev","StorageEvent","cleanKey","newValue","JSON","parse","delete","CustomEvent","action","detail","clear","destroy","has","get","remove","keys","Array","from","abstraction","implementation","dependencies"],"sources":["LocalStorageRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport {\n LocalStorageRepository as LocalStorageRepositoryAbstraction,\n LocalStorageConfig,\n LocalStorageGateway\n} from \"./abstractions.js\";\nimport { createImplementation } from \"@webiny/di\";\n\nexport class LocalStorageRepositoryImpl implements LocalStorageRepositoryAbstraction.Interface {\n private readonly prefix: string;\n private store = new Map<string, unknown>();\n private unsubscribe?: () => void;\n\n constructor(\n private gateway: LocalStorageGateway.Interface,\n config: LocalStorageConfig.Interface\n ) {\n this.prefix = config.prefix || \"\";\n makeAutoObservable(this);\n\n this.bootstrap();\n this.subscribeToChanges();\n }\n\n private withPrefix(key: string): string {\n return this.prefix ? `${this.prefix}:${key}` : key;\n }\n\n private stripPrefix(key: string): string {\n return this.prefix ? key.replace(new RegExp(`^${this.prefix}:`), \"\") : key;\n }\n\n private bootstrap() {\n const all = this.gateway.getAll();\n for (const [key, value] of Object.entries(all)) {\n if (!this.prefix || key.startsWith(this.prefix + \":\")) {\n this.store.set(this.stripPrefix(key), value);\n }\n }\n }\n\n private subscribeToChanges() {\n this.unsubscribe = this.gateway.subscribe(ev => {\n runInAction(() => {\n if (ev instanceof StorageEvent && ev.key) {\n if (!this.prefix || ev.key.startsWith(this.prefix + \":\")) {\n const cleanKey = this.stripPrefix(ev.key);\n if (ev.newValue !== null) {\n try {\n this.store.set(cleanKey, JSON.parse(ev.newValue));\n } catch {\n this.store.set(cleanKey, ev.newValue);\n }\n } else {\n this.store.delete(cleanKey);\n }\n }\n }\n if (ev instanceof CustomEvent) {\n const { key, value, action } = ev.detail;\n if (!this.prefix || key.startsWith(this.prefix + \":\")) {\n const cleanKey = this.stripPrefix(key);\n if (action === \"set\") {\n this.store.set(cleanKey, value);\n }\n if (action === \"remove\") {\n this.store.delete(cleanKey);\n }\n if (action === \"clear\") {\n this.store.clear();\n }\n }\n }\n });\n });\n }\n\n destroy() {\n this.unsubscribe?.();\n }\n\n has(key: string) {\n return this.store.has(key);\n }\n get<T = string>(key: string) {\n return this.store.get(key) as T | undefined;\n }\n set<T = string>(key: string, value: T) {\n this.gateway.set(this.withPrefix(key), value);\n }\n remove(key: string) {\n this.gateway.remove(this.withPrefix(key));\n }\n clear() {\n this.gateway.clear();\n this.store.clear();\n }\n keys(): string[] {\n return Array.from(this.store.keys());\n }\n}\n\nexport const LocalStorageRepository = createImplementation({\n abstraction: LocalStorageRepositoryAbstraction,\n implementation: LocalStorageRepositoryImpl,\n dependencies: [LocalStorageGateway, LocalStorageConfig]\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,MAAM;AACtD,SACIC,sBAAsB,IAAIC,iCAAiC,EAC3DC,kBAAkB,EAClBC,mBAAmB;AAEvB,SAASC,oBAAoB,QAAQ,YAAY;AAEjD,OAAO,MAAMC,0BAA0B,CAAwD;EAEnFC,KAAK,GAAG,IAAIC,GAAG,CAAkB,CAAC;EAG1CC,WAAWA,CACCC,OAAsC,EAC9CC,MAAoC,EACtC;IAAA,KAFUD,OAAsC,GAAtCA,OAAsC;IAG9C,IAAI,CAACE,MAAM,GAAGD,MAAM,CAACC,MAAM,IAAI,EAAE;IACjCb,kBAAkB,CAAC,IAAI,CAAC;IAExB,IAAI,CAACc,SAAS,CAAC,CAAC;IAChB,IAAI,CAACC,kBAAkB,CAAC,CAAC;EAC7B;EAEQC,UAAUA,CAACC,GAAW,EAAU;IACpC,OAAO,IAAI,CAACJ,MAAM,GAAG,GAAG,IAAI,CAACA,MAAM,IAAII,GAAG,EAAE,GAAGA,GAAG;EACtD;EAEQC,WAAWA,CAACD,GAAW,EAAU;IACrC,OAAO,IAAI,CAACJ,MAAM,GAAGI,GAA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N,OAAO,CAACiC,MAAM,CAAC,IAAI,CAAC5B,UAAU,CAACC,GAAG,CAAC,CAAC;EAC7C;EACAuB,KAAKA,CAAA,EAAG;IACJ,IAAI,CAAC7B,OAAO,CAAC6B,KAAK,CAAC,CAAC;IACpB,IAAI,CAAChC,KAAK,CAACgC,KAAK,CAAC,CAAC;EACtB;EACAK,IAAIA,CAAA,EAAa;IACb,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACvC,KAAK,CAACqC,IAAI,CAAC,CAAC,CAAC;EACxC;AACJ;AAEA,OAAO,MAAM3C,sBAAsB,GAAGI,oBAAoB,CAAC;EACvD0C,WAAW,EAAE7C,iCAAiC;EAC9C8C,cAAc,EAAE1C,0BAA0B;EAC1C2C,YAAY,EAAE,CAAC7C,mBAAmB,EAAED,kBAAkB;AAC1D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Abstraction } from "@webiny/di";
|
|
2
|
+
/** Gateway: raw IO into localStorage (or other storage). */
|
|
3
|
+
export interface ILocalStorageGateway {
|
|
4
|
+
get<T = string>(key: string): T | null;
|
|
5
|
+
set<T = string>(key: string, value: T): void;
|
|
6
|
+
remove(key: string): void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
getAll(): Record<string, unknown>;
|
|
9
|
+
subscribe(listener: (event: StorageEvent | CustomEvent) => void): () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const LocalStorageGateway: Abstraction<ILocalStorageGateway>;
|
|
12
|
+
export declare namespace LocalStorageGateway {
|
|
13
|
+
type Interface = ILocalStorageGateway;
|
|
14
|
+
}
|
|
15
|
+
/** Repository: reactive state (MobX), synchronized with gateway. */
|
|
16
|
+
export interface ILocalStorageRepository {
|
|
17
|
+
has(key: string): boolean;
|
|
18
|
+
get<T = string>(key: string): T | undefined;
|
|
19
|
+
set<T = string>(key: string, value: T): void;
|
|
20
|
+
remove(key: string): void;
|
|
21
|
+
clear(): void;
|
|
22
|
+
keys(): string[];
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const LocalStorageRepository: Abstraction<ILocalStorageRepository>;
|
|
26
|
+
export declare namespace LocalStorageRepository {
|
|
27
|
+
type Interface = ILocalStorageRepository;
|
|
28
|
+
}
|
|
29
|
+
/** Config: configure key prefixes, etc. */
|
|
30
|
+
export interface ILocalStorageConfig {
|
|
31
|
+
prefix?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const LocalStorageConfig: Abstraction<ILocalStorageConfig>;
|
|
34
|
+
export declare namespace LocalStorageConfig {
|
|
35
|
+
type Interface = ILocalStorageConfig;
|
|
36
|
+
}
|
|
37
|
+
/** Service: thin façade, delegates to repository for consumers. */
|
|
38
|
+
export interface ILocalStorage {
|
|
39
|
+
get<T = string>(key: string): T | undefined;
|
|
40
|
+
set<T = string>(key: string, value: T): void;
|
|
41
|
+
remove(key: string): void;
|
|
42
|
+
clear(): void;
|
|
43
|
+
keys(): string[];
|
|
44
|
+
}
|
|
45
|
+
export declare const LocalStorage: Abstraction<ILocalStorage>;
|
|
46
|
+
export declare namespace LocalStorage {
|
|
47
|
+
type Interface = ILocalStorage;
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Abstraction } from "@webiny/di";
|
|
2
|
+
|
|
3
|
+
/** Gateway: raw IO into localStorage (or other storage). */
|
|
4
|
+
|
|
5
|
+
export const LocalStorageGateway = new Abstraction("LocalStorageGateway");
|
|
6
|
+
|
|
7
|
+
/** Repository: reactive state (MobX), synchronized with gateway. */
|
|
8
|
+
|
|
9
|
+
export const LocalStorageRepository = new Abstraction("LocalStorageRepository");
|
|
10
|
+
|
|
11
|
+
/** Config: configure key prefixes, etc. */
|
|
12
|
+
|
|
13
|
+
export const LocalStorageConfig = new Abstraction("LocalStorageConfig");
|
|
14
|
+
|
|
15
|
+
/** Service: thin façade, delegates to repository for consumers. */
|
|
16
|
+
|
|
17
|
+
export const LocalStorage = new Abstraction("LocalStorage");
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Abstraction","LocalStorageGateway","LocalStorageRepository","LocalStorageConfig","LocalStorage"],"sources":["abstractions.ts"],"sourcesContent":["import { Abstraction } from \"@webiny/di\";\n\n/** Gateway: raw IO into localStorage (or other storage). */\nexport interface ILocalStorageGateway {\n get<T = string>(key: string): T | null;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n getAll(): Record<string, unknown>;\n subscribe(listener: (event: StorageEvent | CustomEvent) => void): () => void;\n}\n\nexport const LocalStorageGateway = new Abstraction<ILocalStorageGateway>(\"LocalStorageGateway\");\n\nexport namespace LocalStorageGateway {\n export type Interface = ILocalStorageGateway;\n}\n\n/** Repository: reactive state (MobX), synchronized with gateway. */\nexport interface ILocalStorageRepository {\n has(key: string): boolean;\n get<T = string>(key: string): T | undefined;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n keys(): string[];\n destroy(): void;\n}\n\nexport const LocalStorageRepository = new Abstraction<ILocalStorageRepository>(\n \"LocalStorageRepository\"\n);\n\nexport namespace LocalStorageRepository {\n export type Interface = ILocalStorageRepository;\n}\n\n/** Config: configure key prefixes, etc. */\nexport interface ILocalStorageConfig {\n prefix?: string;\n}\n\nexport const LocalStorageConfig = new Abstraction<ILocalStorageConfig>(\"LocalStorageConfig\");\n\nexport namespace LocalStorageConfig {\n export type Interface = ILocalStorageConfig;\n}\n\n/** Service: thin façade, delegates to repository for consumers. */\nexport interface ILocalStorage {\n get<T = string>(key: string): T | undefined;\n set<T = string>(key: string, value: T): void;\n remove(key: string): void;\n clear(): void;\n keys(): string[];\n}\n\nexport const LocalStorage = new Abstraction<ILocalStorage>(\"LocalStorage\");\n\nexport namespace LocalStorage {\n export type Interface = ILocalStorage;\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,YAAY;;AAExC;;AAUA,OAAO,MAAMC,mBAAmB,GAAG,IAAID,WAAW,CAAuB,qBAAqB,CAAC;;AAM/F;;AAWA,OAAO,MAAME,sBAAsB,GAAG,IAAIF,WAAW,CACjD,wBACJ,CAAC;;AAMD;;AAKA,OAAO,MAAMG,kBAAkB,GAAG,IAAIH,WAAW,CAAsB,oBAAoB,CAAC;;AAM5F;;AASA,OAAO,MAAMI,YAAY,GAAG,IAAIJ,WAAW,CAAgB,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalStorageFeature wires together:
|
|
3
|
+
* - BrowserLocalStorageGateway (default gateway)
|
|
4
|
+
* - LocalStorageRepository (reactive MobX mirror)
|
|
5
|
+
* - LocalStorage (thin consumer-facing facade)
|
|
6
|
+
*/
|
|
7
|
+
export declare const LocalStorageFeature: import("~/shared/di/createFeature.js").FeatureDefinition<{
|
|
8
|
+
localStorageService: import("./abstractions.js").ILocalStorage;
|
|
9
|
+
localStorageConfig: import("./abstractions.js").ILocalStorageConfig;
|
|
10
|
+
}, [config?: {
|
|
11
|
+
prefix?: string;
|
|
12
|
+
} | undefined]>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LocalStorageConfig, LocalStorageGateway, LocalStorage as Abstraction } from "./abstractions.js";
|
|
2
|
+
import { BrowserLocalStorageGateway } from "./BrowserLocalStorageGateway.js";
|
|
3
|
+
import { LocalStorageRepository } from "./LocalStorageRepository.js";
|
|
4
|
+
import { LocalStorage } from "./LocalStorage.js";
|
|
5
|
+
import { createFeature } from "../../shared/di/createFeature.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* LocalStorageFeature wires together:
|
|
9
|
+
* - BrowserLocalStorageGateway (default gateway)
|
|
10
|
+
* - LocalStorageRepository (reactive MobX mirror)
|
|
11
|
+
* - LocalStorage (thin consumer-facing facade)
|
|
12
|
+
*/
|
|
13
|
+
export const LocalStorageFeature = createFeature({
|
|
14
|
+
name: "LocalStorage",
|
|
15
|
+
register(container, config = {}) {
|
|
16
|
+
// Register config (tenant prefix, etc.)
|
|
17
|
+
container.registerInstance(LocalStorageConfig, config);
|
|
18
|
+
|
|
19
|
+
// Gateway: browser localStorage
|
|
20
|
+
container.registerInstance(LocalStorageGateway, new BrowserLocalStorageGateway());
|
|
21
|
+
|
|
22
|
+
// Repository & Service
|
|
23
|
+
container.register(LocalStorageRepository).inSingletonScope();
|
|
24
|
+
container.register(LocalStorage).inSingletonScope();
|
|
25
|
+
},
|
|
26
|
+
resolve(container) {
|
|
27
|
+
return {
|
|
28
|
+
localStorageService: container.resolve(Abstraction),
|
|
29
|
+
localStorageConfig: container.resolve(LocalStorageConfig)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LocalStorageConfig","LocalStorageGateway","LocalStorage","Abstraction","BrowserLocalStorageGateway","LocalStorageRepository","createFeature","LocalStorageFeature","name","register","container","config","registerInstance","inSingletonScope","resolve","localStorageService","localStorageConfig"],"sources":["feature.ts"],"sourcesContent":["import {\n LocalStorageConfig,\n LocalStorageGateway,\n LocalStorage as Abstraction\n} from \"./abstractions.js\";\nimport { BrowserLocalStorageGateway } from \"./BrowserLocalStorageGateway.js\";\nimport { LocalStorageRepository } from \"./LocalStorageRepository.js\";\nimport { LocalStorage } from \"./LocalStorage.js\";\nimport { createFeature } from \"~/shared/di/createFeature.js\";\n\n/**\n * LocalStorageFeature wires together:\n * - BrowserLocalStorageGateway (default gateway)\n * - LocalStorageRepository (reactive MobX mirror)\n * - LocalStorage (thin consumer-facing facade)\n */\nexport const LocalStorageFeature = createFeature({\n name: \"LocalStorage\",\n register(container, config: { prefix?: string } = {}) {\n // Register config (tenant prefix, etc.)\n container.registerInstance(LocalStorageConfig, config);\n\n // Gateway: browser localStorage\n container.registerInstance(LocalStorageGateway, new BrowserLocalStorageGateway());\n\n // Repository & Service\n container.register(LocalStorageRepository).inSingletonScope();\n container.register(LocalStorage).inSingletonScope();\n },\n resolve(container) {\n return {\n localStorageService: container.resolve(Abstraction),\n localStorageConfig: container.resolve(LocalStorageConfig)\n };\n }\n});\n"],"mappings":"AAAA,SACIA,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,IAAIC,WAAW;AAE/B,SAASC,0BAA0B;AACnC,SAASC,sBAAsB;AAC/B,SAASH,YAAY;AACrB,SAASI,aAAa;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGD,aAAa,CAAC;EAC7CE,IAAI,EAAE,cAAc;EACpBC,QAAQA,CAACC,SAAS,EAAEC,MAA2B,GAAG,CAAC,CAAC,EAAE;IAClD;IACAD,SAAS,CAACE,gBAAgB,CAACZ,kBAAkB,EAAEW,MAAM,CAAC;;IAEtD;IACAD,SAAS,CAACE,gBAAgB,CAACX,mBAAmB,EAAE,IAAIG,0BAA0B,CAAC,CAAC,CAAC;;IAEjF;IACAM,SAAS,CAACD,QAAQ,CAACJ,sBAAsB,CAAC,CAACQ,gBAAgB,CAAC,CAAC;IAC7DH,SAAS,CAACD,QAAQ,CAACP,YAAY,CAAC,CAACW,gBAAgB,CAAC,CAAC;EACvD,CAAC;EACDC,OAAOA,CAACJ,SAAS,EAAE;IACf,OAAO;MACHK,mBAAmB,EAAEL,SAAS,CAACI,OAAO,CAACX,WAAW,CAAC;MACnDa,kBAAkB,EAAEN,SAAS,CAACI,OAAO,CAACd,kBAAkB;IAC5D,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LocalStorage, LocalStorageGateway, LocalStorageRepository, LocalStorageConfig } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LocalStorage","LocalStorageGateway","LocalStorageRepository","LocalStorageConfig"],"sources":["index.ts"],"sourcesContent":["export {\n LocalStorage,\n LocalStorageGateway,\n LocalStorageRepository,\n LocalStorageConfig\n} from \"./abstractions.js\";\n"],"mappings":"AAAA,SACIA,YAAY,EACZC,mBAAmB,EACnBC,sBAAsB,EACtBC,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { History } from "history";
|
|
3
|
+
import type { RouteDefinition, OnRouteExit } from "./abstractions.js";
|
|
4
|
+
import { RouterGateway } from "./abstractions.js";
|
|
5
|
+
export declare class HistoryRouterGateway implements RouterGateway.Interface {
|
|
6
|
+
private readonly history;
|
|
7
|
+
private readonly router;
|
|
8
|
+
private stopListening;
|
|
9
|
+
private unblock;
|
|
10
|
+
constructor(history: History, baseUrl: string);
|
|
11
|
+
onRouteExit(cb: OnRouteExit): void;
|
|
12
|
+
goToRoute(name: string, params: z.ZodTypeAny): void;
|
|
13
|
+
setRoutes(routes: RouteDefinition[]): void;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
pushState(url: string): void;
|
|
16
|
+
private resolvePathname;
|
|
17
|
+
private guardRouteExit;
|
|
18
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { RouteUrl } from "./RouteUrl.js";
|
|
2
|
+
import { Router } from "./Router.js";
|
|
3
|
+
export class HistoryRouterGateway {
|
|
4
|
+
constructor(history, baseUrl) {
|
|
5
|
+
this.history = history;
|
|
6
|
+
this.router = new Router(baseUrl);
|
|
7
|
+
this.stopListening = history.listen(async ({
|
|
8
|
+
location
|
|
9
|
+
}) => {
|
|
10
|
+
const queryParams = Object.fromEntries(new URLSearchParams(location.search).entries());
|
|
11
|
+
this.resolvePathname(location.pathname, queryParams);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
onRouteExit(cb) {
|
|
15
|
+
this.guardRouteExit(cb);
|
|
16
|
+
}
|
|
17
|
+
goToRoute(name, params) {
|
|
18
|
+
const route = this.router.findRoute(name);
|
|
19
|
+
if (!route) {
|
|
20
|
+
console.warn(`Route "${name}" not found.`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const baseUrl = this.router.getBaseUrl();
|
|
24
|
+
this.history.push(RouteUrl.fromPattern(route.path, params, baseUrl));
|
|
25
|
+
}
|
|
26
|
+
setRoutes(routes) {
|
|
27
|
+
this.router.setRoutes(routes);
|
|
28
|
+
const queryParams = Object.fromEntries(new URLSearchParams(this.history.location.search).entries());
|
|
29
|
+
const currentPathname = this.history.location.pathname;
|
|
30
|
+
this.resolvePathname(currentPathname, queryParams);
|
|
31
|
+
}
|
|
32
|
+
destroy() {
|
|
33
|
+
this.stopListening();
|
|
34
|
+
this.unblock && this.unblock();
|
|
35
|
+
}
|
|
36
|
+
pushState(url) {
|
|
37
|
+
this.history.push(url);
|
|
38
|
+
}
|
|
39
|
+
async resolvePathname(pathname, queryParams) {
|
|
40
|
+
const result = this.router.resolve(pathname, queryParams);
|
|
41
|
+
if (!result) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const {
|
|
45
|
+
matchedRoute,
|
|
46
|
+
onMatch
|
|
47
|
+
} = result;
|
|
48
|
+
onMatch(matchedRoute);
|
|
49
|
+
}
|
|
50
|
+
guardRouteExit(onRouteExit) {
|
|
51
|
+
if (this.unblock) {
|
|
52
|
+
// Remove existing blocker before installing a new one.
|
|
53
|
+
this.unblock();
|
|
54
|
+
}
|
|
55
|
+
this.unblock = this.history.block(tx => {
|
|
56
|
+
let resolved = false;
|
|
57
|
+
onRouteExit({
|
|
58
|
+
continue: () => {
|
|
59
|
+
if (!resolved) {
|
|
60
|
+
resolved = true;
|
|
61
|
+
// We need to unblock the transition before retying.
|
|
62
|
+
if (this.unblock) {
|
|
63
|
+
this.unblock();
|
|
64
|
+
this.unblock = undefined;
|
|
65
|
+
}
|
|
66
|
+
// Perform transition.
|
|
67
|
+
tx.retry();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
cancel: () => {
|
|
71
|
+
resolved = true;
|
|
72
|
+
// Do nothing.
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Block the transition until `continue` is called.
|
|
77
|
+
return false;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=HistoryRouterGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RouteUrl","Router","HistoryRouterGateway","constructor","history","baseUrl","router","stopListening","listen","location","queryParams","Object","fromEntries","URLSearchParams","search","entries","resolvePathname","pathname","onRouteExit","cb","guardRouteExit","goToRoute","name","params","route","findRoute","console","warn","getBaseUrl","push","fromPattern","path","setRoutes","routes","currentPathname","destroy","unblock","pushState","url","result","resolve","matchedRoute","onMatch","block","tx","resolved","continue","undefined","retry","cancel"],"sources":["HistoryRouterGateway.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { History } from \"history\";\nimport type { RouteDefinition, OnRouteExit } from \"./abstractions.js\";\nimport { RouterGateway } from \"./abstractions.js\";\nimport { RouteUrl } from \"./RouteUrl.js\";\nimport { Router } from \"./Router.js\";\n\nexport class HistoryRouterGateway implements RouterGateway.Interface {\n private readonly history: History;\n private readonly router: Router;\n private stopListening: () => void;\n private unblock: (() => void) | undefined;\n\n constructor(history: History, baseUrl: string) {\n this.history = history;\n this.router = new Router(baseUrl);\n\n this.stopListening = history.listen(async ({ location }) => {\n const queryParams = Object.fromEntries(new URLSearchParams(location.search).entries());\n this.resolvePathname(location.pathname, queryParams);\n });\n }\n\n onRouteExit(cb: OnRouteExit): void {\n this.guardRouteExit(cb);\n }\n\n goToRoute(name: string, params: z.ZodTypeAny): void {\n const route = this.router.findRoute(name);\n if (!route) {\n console.warn(`Route \"${name}\" not found.`);\n return;\n }\n\n const baseUrl = this.router.getBaseUrl();\n this.history.push(RouteUrl.fromPattern(route.path, params, baseUrl));\n }\n\n setRoutes(routes: RouteDefinition[]) {\n this.router.setRoutes(routes);\n\n const queryParams = Object.fromEntries(\n new URLSearchParams(this.history.location.search).entries()\n );\n const currentPathname = this.history.location.pathname;\n this.resolvePathname(currentPathname, queryParams);\n }\n\n destroy(): void {\n this.stopListening();\n this.unblock && this.unblock();\n }\n\n pushState(url: string): void {\n this.history.push(url);\n }\n\n private async resolvePathname(pathname: string, queryParams?: Record<string, unknown>) {\n const result = this.router.resolve(pathname, queryParams);\n if (!result) {\n return;\n }\n\n const { matchedRoute, onMatch } = result;\n\n onMatch(matchedRoute);\n }\n\n private guardRouteExit(onRouteExit: OnRouteExit): void {\n if (this.unblock) {\n // Remove existing blocker before installing a new one.\n this.unblock();\n }\n\n this.unblock = this.history.block(tx => {\n let resolved = false;\n\n onRouteExit({\n continue: () => {\n if (!resolved) {\n resolved = true;\n // We need to unblock the transition before retying.\n if (this.unblock) {\n this.unblock();\n this.unblock = undefined;\n }\n // Perform transition.\n tx.retry();\n }\n },\n cancel: () => {\n resolved = true;\n // Do nothing.\n }\n });\n\n // Block the transition until `continue` is called.\n return false;\n });\n }\n}\n"],"mappings":"AAIA,SAASA,QAAQ;AACjB,SAASC,MAAM;AAEf,OAAO,MAAMC,oBAAoB,CAAoC;EAMjEC,WAAWA,CAACC,OAAgB,EAAEC,OAAe,EAAE;IAC3C,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,MAAM,GAAG,IAAIL,MAAM,CAACI,OAAO,CAAC;IAEjC,IAAI,CAACE,aAAa,GAAGH,OAAO,CAACI,MAAM,CAAC,OAAO;MAAEC;IAAS,CAAC,KAAK;MACxD,MAAMC,WAAW,GAAGC,MAAM,CAACC,WAAW,CAAC,IAAIC,eAAe,CAACJ,QAAQ,CAACK,MAAM,CAAC,CAACC,OAAO,CAAC,CAAC,CAAC;MACtF,IAAI,CAACC,eAAe,CAACP,QAAQ,CAACQ,QAAQ,EAAEP,WAAW,CAAC;IACxD,CAAC,CAAC;EACN;EAEAQ,WAAWA,CAACC,EAAe,EAAQ;IAC/B,IAAI,CAACC,cAAc,CAACD,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AAE;MACT;IACJ;IAEA,MAAM;MAAEE,YAAY;MAAEC;IAAQ,CAAC,GAAGH,MAAM;IAExCG,OAAO,CAACD,YAAY,CAAC;EACzB;EAEQrB,cAAcA,CAACF,WAAwB,EAAQ;IACnD,IAAI,IAAI,CAACkB,OAAO,EAAE;MACd;MACA,IAAI,CAACA,OAAO,CAAC,CAAC;IAClB;IAEA,IAAI,CAACA,OAAO,GAAG,IAAI,CAAChC,OAAO,CAACuC,KAAK,CAACC,EAAE,IAAI;MACpC,IAAIC,QAAQ,GAAG,KAAK;MAEpB3B,WAAW,CAAC;QACR4B,QAAQ,EAAEA,CAAA,KAAM;UACZ,IAAI,CAACD,QAAQ,EAAE;YACXA,QAAQ,GAAG,IAAI;YACf;YACA,IAAI,IAAI,CAACT,OAAO,EAAE;cACd,IAAI,CAACA,OAAO,CAAC,CAAC;cACd,IAAI,CAACA,OAAO,GAAGW,SAAS;YAC5B;YACA;YACAH,EAAE,CAACI,KAAK,CAAC,CAAC;UACd;QACJ,CAAC;QACDC,MAAM,EAAEA,CAAA,KAAM;UACVJ,QAAQ,GAAG,IAAI;UACf;QACJ;MACJ,CAAC,CAAC;;MAEF;MACA,OAAO,KAAK;IAChB,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { describe, it, beforeEach, expect, vi } from "vitest";
|
|
2
|
+
import { createMemoryHistory } from "history";
|
|
3
|
+
import { HistoryRouterGateway } from "./HistoryRouterGateway.js";
|
|
4
|
+
import { RouteUrl } from "./RouteUrl.js";
|
|
5
|
+
const wait = () => new Promise(resolve => setTimeout(resolve, 10));
|
|
6
|
+
describe("Router Gateway", () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
vi.clearAllMocks();
|
|
9
|
+
});
|
|
10
|
+
it("should execute onMatch when history changes", async () => {
|
|
11
|
+
const spyHome = vi.fn();
|
|
12
|
+
const spyLogin = vi.fn();
|
|
13
|
+
const spyDynamic = vi.fn();
|
|
14
|
+
|
|
15
|
+
// Create `history` and set the initial pathname to an unknown route
|
|
16
|
+
const history = createMemoryHistory();
|
|
17
|
+
history.replace("/__unknown__");
|
|
18
|
+
const gateway = new HistoryRouterGateway(history, "");
|
|
19
|
+
gateway.setRoutes([{
|
|
20
|
+
name: "home",
|
|
21
|
+
path: "/",
|
|
22
|
+
onMatch: spyHome
|
|
23
|
+
}, {
|
|
24
|
+
name: "login",
|
|
25
|
+
path: "/login",
|
|
26
|
+
onMatch: spyLogin
|
|
27
|
+
}, {
|
|
28
|
+
name: "test",
|
|
29
|
+
path: "/dynamic-route/:name",
|
|
30
|
+
onMatch: spyDynamic
|
|
31
|
+
}]);
|
|
32
|
+
history.push("/login");
|
|
33
|
+
await wait();
|
|
34
|
+
history.push("/");
|
|
35
|
+
await wait();
|
|
36
|
+
history.push("/dynamic-route/cars");
|
|
37
|
+
await wait();
|
|
38
|
+
history.push("/login");
|
|
39
|
+
await wait();
|
|
40
|
+
history.push("/dynamic-route/blogs");
|
|
41
|
+
await wait();
|
|
42
|
+
history.push("/dynamic-route/blogs?search=123");
|
|
43
|
+
await wait();
|
|
44
|
+
expect(spyLogin).toHaveBeenCalledTimes(2);
|
|
45
|
+
expect(spyLogin).toHaveBeenNthCalledWith(1, {
|
|
46
|
+
name: "login",
|
|
47
|
+
path: "/login",
|
|
48
|
+
pathname: "/login",
|
|
49
|
+
params: {}
|
|
50
|
+
});
|
|
51
|
+
expect(spyLogin).toHaveBeenNthCalledWith(2, {
|
|
52
|
+
name: "login",
|
|
53
|
+
path: "/login",
|
|
54
|
+
pathname: "/login",
|
|
55
|
+
params: {}
|
|
56
|
+
});
|
|
57
|
+
expect(spyHome).toHaveBeenCalledTimes(1);
|
|
58
|
+
expect(spyHome).toHaveBeenLastCalledWith({
|
|
59
|
+
name: "home",
|
|
60
|
+
path: "/",
|
|
61
|
+
pathname: "/",
|
|
62
|
+
params: {}
|
|
63
|
+
});
|
|
64
|
+
expect(spyDynamic).toHaveBeenCalledTimes(3);
|
|
65
|
+
expect(spyDynamic).toHaveBeenNthCalledWith(1, {
|
|
66
|
+
name: "test",
|
|
67
|
+
path: "/dynamic-route/:name",
|
|
68
|
+
pathname: "/dynamic-route/cars",
|
|
69
|
+
params: {
|
|
70
|
+
name: "cars"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
expect(spyDynamic).toHaveBeenNthCalledWith(2, {
|
|
74
|
+
name: "test",
|
|
75
|
+
path: "/dynamic-route/:name",
|
|
76
|
+
pathname: "/dynamic-route/blogs",
|
|
77
|
+
params: {
|
|
78
|
+
name: "blogs"
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
expect(spyDynamic).toHaveBeenNthCalledWith(3, {
|
|
82
|
+
name: "test",
|
|
83
|
+
path: "/dynamic-route/:name",
|
|
84
|
+
pathname: "/dynamic-route/blogs",
|
|
85
|
+
params: {
|
|
86
|
+
name: "blogs",
|
|
87
|
+
search: "123"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
it("should generate route URLs", async () => {
|
|
92
|
+
const urls = [RouteUrl.fromPattern("/"), RouteUrl.fromPattern("/login", {}), RouteUrl.fromPattern("/login", {
|
|
93
|
+
redirect: "/",
|
|
94
|
+
reason: "login"
|
|
95
|
+
}), RouteUrl.fromPattern("/dynamic-route/:name", {
|
|
96
|
+
name: "cars"
|
|
97
|
+
}), RouteUrl.fromPattern("/dynamic-route", {
|
|
98
|
+
folderId: "696556831e485d00027a1a0b#0001"
|
|
99
|
+
})];
|
|
100
|
+
expect(urls).toEqual(["/", "/login", "/login?redirect=%2F&reason=login", "/dynamic-route/cars", "/dynamic-route?folderId=696556831e485d00027a1a0b%230001"]);
|
|
101
|
+
});
|
|
102
|
+
it("should handle baseUrl for route matching and URL generation", async () => {
|
|
103
|
+
const spyFileManager = vi.fn();
|
|
104
|
+
const spyHome = vi.fn();
|
|
105
|
+
|
|
106
|
+
// Create history with a tenant prefix
|
|
107
|
+
const history = createMemoryHistory();
|
|
108
|
+
history.replace("/tenant123/__unknown__");
|
|
109
|
+
const gateway = new HistoryRouterGateway(history, "/tenant123");
|
|
110
|
+
gateway.setRoutes([{
|
|
111
|
+
name: "home",
|
|
112
|
+
path: "/",
|
|
113
|
+
onMatch: spyHome
|
|
114
|
+
}, {
|
|
115
|
+
name: "fileManager",
|
|
116
|
+
path: "/file-manager",
|
|
117
|
+
onMatch: spyFileManager
|
|
118
|
+
}]);
|
|
119
|
+
|
|
120
|
+
// Navigate to /tenant123/file-manager
|
|
121
|
+
history.push("/tenant123/file-manager");
|
|
122
|
+
await wait();
|
|
123
|
+
|
|
124
|
+
// Should match the /file-manager route
|
|
125
|
+
expect(spyFileManager).toHaveBeenCalledTimes(1);
|
|
126
|
+
expect(spyFileManager).toHaveBeenCalledWith({
|
|
127
|
+
name: "fileManager",
|
|
128
|
+
path: "/file-manager",
|
|
129
|
+
pathname: "/tenant123/file-manager",
|
|
130
|
+
params: {}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Test URL generation with baseUrl
|
|
134
|
+
const urlWithBase = RouteUrl.fromPattern("/file-manager", {}, "/tenant123");
|
|
135
|
+
expect(urlWithBase).toBe("/tenant123/file-manager");
|
|
136
|
+
const urlWithBaseAndParams = RouteUrl.fromPattern("/file-manager", {
|
|
137
|
+
folder: "abc"
|
|
138
|
+
}, "/tenant123");
|
|
139
|
+
expect(urlWithBaseAndParams).toBe("/tenant123/file-manager?folder=abc");
|
|
140
|
+
});
|
|
141
|
+
it("should properly sort routes with wildcards always at the bottom", async () => {
|
|
142
|
+
const spyWildcard = vi.fn();
|
|
143
|
+
const spySpecific = vi.fn();
|
|
144
|
+
const spyHome = vi.fn();
|
|
145
|
+
const history = createMemoryHistory();
|
|
146
|
+
// Start at a non-matching path to avoid initial route resolution
|
|
147
|
+
history.replace("/initial");
|
|
148
|
+
const gateway = new HistoryRouterGateway(history, "");
|
|
149
|
+
|
|
150
|
+
// Add wildcard first, then home route
|
|
151
|
+
// Note: setRoutes will trigger route resolution for current path (/initial)
|
|
152
|
+
gateway.setRoutes([{
|
|
153
|
+
name: "wildcard",
|
|
154
|
+
path: "*",
|
|
155
|
+
onMatch: spyWildcard
|
|
156
|
+
}, {
|
|
157
|
+
name: "home",
|
|
158
|
+
path: "/",
|
|
159
|
+
onMatch: spyHome
|
|
160
|
+
}]);
|
|
161
|
+
|
|
162
|
+
// Wildcard should have matched /initial
|
|
163
|
+
expect(spyWildcard).toHaveBeenCalledTimes(1);
|
|
164
|
+
vi.clearAllMocks();
|
|
165
|
+
|
|
166
|
+
// Now add a specific route after the wildcard - this should re-sort and keep wildcard at bottom
|
|
167
|
+
// Note: setRoutes will trigger route resolution again for /initial, matching wildcard again
|
|
168
|
+
gateway.setRoutes([{
|
|
169
|
+
name: "specific",
|
|
170
|
+
path: "/specific-route",
|
|
171
|
+
onMatch: spySpecific
|
|
172
|
+
}]);
|
|
173
|
+
|
|
174
|
+
// Wildcard should match /initial again after re-sorting
|
|
175
|
+
expect(spyWildcard).toHaveBeenCalledTimes(1);
|
|
176
|
+
vi.clearAllMocks();
|
|
177
|
+
|
|
178
|
+
// Navigate to the specific route
|
|
179
|
+
history.push("/specific-route");
|
|
180
|
+
await wait();
|
|
181
|
+
|
|
182
|
+
// Should match the specific route, not the wildcard
|
|
183
|
+
expect(spySpecific).toHaveBeenCalledTimes(1);
|
|
184
|
+
expect(spyWildcard).toHaveBeenCalledTimes(0);
|
|
185
|
+
expect(spyHome).toHaveBeenCalledTimes(0);
|
|
186
|
+
|
|
187
|
+
// Navigate to home
|
|
188
|
+
history.push("/");
|
|
189
|
+
await wait();
|
|
190
|
+
|
|
191
|
+
// Should match home route
|
|
192
|
+
expect(spyHome).toHaveBeenCalledTimes(1);
|
|
193
|
+
expect(spyWildcard).toHaveBeenCalledTimes(0);
|
|
194
|
+
|
|
195
|
+
// Navigate to unknown route
|
|
196
|
+
history.push("/unknown");
|
|
197
|
+
await wait();
|
|
198
|
+
|
|
199
|
+
// Should match wildcard
|
|
200
|
+
expect(spyWildcard).toHaveBeenCalledTimes(1);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=HistoryRouterGateway.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","it","beforeEach","expect","vi","createMemoryHistory","HistoryRouterGateway","RouteUrl","wait","Promise","resolve","setTimeout","clearAllMocks","spyHome","fn","spyLogin","spyDynamic","history","replace","gateway","setRoutes","name","path","onMatch","push","toHaveBeenCalledTimes","toHaveBeenNthCalledWith","pathname","params","toHaveBeenLastCalledWith","search","urls","fromPattern","redirect","reason","folderId","toEqual","spyFileManager","toHaveBeenCalledWith","urlWithBase","toBe","urlWithBaseAndParams","folder","spyWildcard","spySpecific"],"sources":["HistoryRouterGateway.test.ts"],"sourcesContent":["import { describe, it, beforeEach, expect, vi } from \"vitest\";\nimport { createMemoryHistory } from \"history\";\nimport { HistoryRouterGateway } from \"./HistoryRouterGateway.js\";\nimport { RouteUrl } from \"./RouteUrl.js\";\n\nconst wait = () => new Promise(resolve => setTimeout(resolve, 10));\n\ndescribe(\"Router Gateway\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n it(\"should execute onMatch when history changes\", async () => {\n const spyHome = vi.fn();\n const spyLogin = vi.fn();\n const spyDynamic = vi.fn();\n\n // Create `history` and set the initial pathname to an unknown route\n const history = createMemoryHistory();\n history.replace(\"/__unknown__\");\n\n const gateway = new HistoryRouterGateway(history, \"\");\n gateway.setRoutes([\n { name: \"home\", path: \"/\", onMatch: spyHome },\n { name: \"login\", path: \"/login\", onMatch: spyLogin },\n { name: \"test\", path: \"/dynamic-route/:name\", onMatch: spyDynamic }\n ]);\n\n history.push(\"/login\");\n await wait();\n history.push(\"/\");\n await wait();\n history.push(\"/dynamic-route/cars\");\n await wait();\n history.push(\"/login\");\n await wait();\n history.push(\"/dynamic-route/blogs\");\n await wait();\n history.push(\"/dynamic-route/blogs?search=123\");\n await wait();\n\n expect(spyLogin).toHaveBeenCalledTimes(2);\n expect(spyLogin).toHaveBeenNthCalledWith(1, {\n name: \"login\",\n path: \"/login\",\n pathname: \"/login\",\n params: {}\n });\n expect(spyLogin).toHaveBeenNthCalledWith(2, {\n name: \"login\",\n path: \"/login\",\n pathname: \"/login\",\n params: {}\n });\n expect(spyHome).toHaveBeenCalledTimes(1);\n expect(spyHome).toHaveBeenLastCalledWith({\n name: \"home\",\n path: \"/\",\n pathname: \"/\",\n params: {}\n });\n expect(spyDynamic).toHaveBeenCalledTimes(3);\n expect(spyDynamic).toHaveBeenNthCalledWith(1, {\n name: \"test\",\n path: \"/dynamic-route/:name\",\n pathname: \"/dynamic-route/cars\",\n params: {\n name: \"cars\"\n }\n });\n expect(spyDynamic).toHaveBeenNthCalledWith(2, {\n name: \"test\",\n path: \"/dynamic-route/:name\",\n pathname: \"/dynamic-route/blogs\",\n params: {\n name: \"blogs\"\n }\n });\n expect(spyDynamic).toHaveBeenNthCalledWith(3, {\n name: \"test\",\n path: \"/dynamic-route/:name\",\n pathname: \"/dynamic-route/blogs\",\n params: {\n name: \"blogs\",\n search: \"123\"\n }\n });\n });\n\n it(\"should generate route URLs\", async () => {\n const urls = [\n RouteUrl.fromPattern(\"/\"),\n RouteUrl.fromPattern(\"/login\", {}),\n RouteUrl.fromPattern(\"/login\", { redirect: \"/\", reason: \"login\" }),\n RouteUrl.fromPattern(\"/dynamic-route/:name\", { name: \"cars\" }),\n RouteUrl.fromPattern(\"/dynamic-route\", { folderId: \"696556831e485d00027a1a0b#0001\" })\n ];\n expect(urls).toEqual([\n \"/\",\n \"/login\",\n \"/login?redirect=%2F&reason=login\",\n \"/dynamic-route/cars\",\n \"/dynamic-route?folderId=696556831e485d00027a1a0b%230001\"\n ]);\n });\n\n it(\"should handle baseUrl for route matching and URL generation\", async () => {\n const spyFileManager = vi.fn();\n const spyHome = vi.fn();\n\n // Create history with a tenant prefix\n const history = createMemoryHistory();\n history.replace(\"/tenant123/__unknown__\");\n\n const gateway = new HistoryRouterGateway(history, \"/tenant123\");\n gateway.setRoutes([\n { name: \"home\", path: \"/\", onMatch: spyHome },\n { name: \"fileManager\", path: \"/file-manager\", onMatch: spyFileManager }\n ]);\n\n // Navigate to /tenant123/file-manager\n history.push(\"/tenant123/file-manager\");\n await wait();\n\n // Should match the /file-manager route\n expect(spyFileManager).toHaveBeenCalledTimes(1);\n expect(spyFileManager).toHaveBeenCalledWith({\n name: \"fileManager\",\n path: \"/file-manager\",\n pathname: \"/tenant123/file-manager\",\n params: {}\n });\n\n // Test URL generation with baseUrl\n const urlWithBase = RouteUrl.fromPattern(\"/file-manager\", {}, \"/tenant123\");\n expect(urlWithBase).toBe(\"/tenant123/file-manager\");\n\n const urlWithBaseAndParams = RouteUrl.fromPattern(\n \"/file-manager\",\n { folder: \"abc\" },\n \"/tenant123\"\n );\n expect(urlWithBaseAndParams).toBe(\"/tenant123/file-manager?folder=abc\");\n });\n\n it(\"should properly sort routes with wildcards always at the bottom\", async () => {\n const spyWildcard = vi.fn();\n const spySpecific = vi.fn();\n const spyHome = vi.fn();\n\n const history = createMemoryHistory();\n // Start at a non-matching path to avoid initial route resolution\n history.replace(\"/initial\");\n\n const gateway = new HistoryRouterGateway(history, \"\");\n\n // Add wildcard first, then home route\n // Note: setRoutes will trigger route resolution for current path (/initial)\n gateway.setRoutes([\n { name: \"wildcard\", path: \"*\", onMatch: spyWildcard },\n { name: \"home\", path: \"/\", onMatch: spyHome }\n ]);\n\n // Wildcard should have matched /initial\n expect(spyWildcard).toHaveBeenCalledTimes(1);\n vi.clearAllMocks();\n\n // Now add a specific route after the wildcard - this should re-sort and keep wildcard at bottom\n // Note: setRoutes will trigger route resolution again for /initial, matching wildcard again\n gateway.setRoutes([{ name: \"specific\", path: \"/specific-route\", onMatch: spySpecific }]);\n\n // Wildcard should match /initial again after re-sorting\n expect(spyWildcard).toHaveBeenCalledTimes(1);\n vi.clearAllMocks();\n\n // Navigate to the specific route\n history.push(\"/specific-route\");\n await wait();\n\n // Should match the specific route, not the wildcard\n expect(spySpecific).toHaveBeenCalledTimes(1);\n expect(spyWildcard).toHaveBeenCalledTimes(0);\n expect(spyHome).toHaveBeenCalledTimes(0);\n\n // Navigate to home\n history.push(\"/\");\n await wait();\n\n // Should match home route\n expect(spyHome).toHaveBeenCalledTimes(1);\n expect(spyWildcard).toHaveBeenCalledTimes(0);\n\n // Navigate to unknown route\n history.push(\"/unknown\");\n await wait();\n\n // Should match wildcard\n expect(spyWildcard).toHaveBeenCalledTimes(1);\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,UAAU,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7D,SAASC,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,oBAAoB;AAC7B,SAASC,QAAQ;AAEjB,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAIC,OAAO,CAACC,OAAO,IAAIC,UAAU,CAACD,OAAO,EAAE,EAAE,CAAC,CAAC;AAElEV,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC7BE,UAAU,CAAC,MAAM;IACbE,EAAE,CAACQ,aAAa,CAAC,CAAC;EACtB,CAAC,CAAC;EAEFX,EAAE,CAAC,6CAA6C,EAAE,YAAY;IAC1D,MAAMY,OAAO,GAAGT,EAAE,CAACU,EAAE,CAAC,CAAC;IACvB,MAAMC,QAAQ,GAAGX,EAAE,CAACU,EAAE,CAAC,CAAC;IACxB,MAAME,UAAU,GAAGZ,EAAE,CAACU,EAAE,CAAC,CAAC;;IAE1B;IACA,MAAMG,OAAO,GAAGZ,mBAAmB,CAAC,CAAC;IACrCY,OAAO,CAACC,OAAO,CAAC,cAAc,CAAC;IAE/B,MAAMC,OAAO,GAAG,IAAIb,oBAAoB,CAACW,OAAO,EAAE,EAAE,CAAC;IACrDE,OAAO,CAACC,SAAS,CAAC,CACd;MAAEC,IAAI,EAAE,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