@nascentdigital/funnel-apps 4.4.18
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/dist/react/app/domain/AppService.d.ts +19 -0
- package/dist/react/app/domain/AppService.js +19 -0
- package/dist/react/app/domain/AppServiceClient.d.ts +7 -0
- package/dist/react/app/domain/AppServiceClient.js +57 -0
- package/dist/react/app/domain/AppState.d.ts +1 -0
- package/dist/react/app/domain/AppState.js +2 -0
- package/dist/react/app/domain/index.d.ts +3 -0
- package/dist/react/app/domain/index.js +19 -0
- package/dist/react/app/server/AbstractAppService.d.ts +17 -0
- package/dist/react/app/server/AbstractAppService.js +24 -0
- package/dist/react/app/server/AppServices.d.ts +11 -0
- package/dist/react/app/server/AppServices.js +92 -0
- package/dist/react/app/server/index.d.ts +4 -0
- package/dist/react/app/server/index.js +20 -0
- package/dist/react/app/web/App.d.ts +38 -0
- package/dist/react/app/web/App.js +116 -0
- package/dist/react/app/web/AppContainer.d.ts +16 -0
- package/dist/react/app/web/AppContainer.js +109 -0
- package/dist/react/app/web/AppContext.d.ts +7 -0
- package/dist/react/app/web/AppContext.js +6 -0
- package/dist/react/app/web/AppLayout.d.ts +7 -0
- package/dist/react/app/web/AppLayout.js +34 -0
- package/dist/react/app/web/AppPage.d.ts +13 -0
- package/dist/react/app/web/AppPage.js +30 -0
- package/dist/react/app/web/AppRoot.d.ts +7 -0
- package/dist/react/app/web/AppRoot.js +43 -0
- package/dist/react/app/web/index.d.ts +5 -0
- package/dist/react/app/web/index.js +21 -0
- package/dist/react/app/web/useApp.d.ts +2 -0
- package/dist/react/app/web/useApp.js +33 -0
- package/dist/react/auth0/server/Auth0IdentityService.d.ts +25 -0
- package/dist/react/auth0/server/Auth0IdentityService.js +84 -0
- package/dist/react/auth0/server/Auth0Profile.d.ts +19 -0
- package/dist/react/auth0/server/Auth0Profile.js +108 -0
- package/dist/react/auth0/server/Auth0ProfileFactory.d.ts +15 -0
- package/dist/react/auth0/server/Auth0ProfileFactory.js +51 -0
- package/dist/react/auth0/server/Auth0ProfileManagementService.d.ts +17 -0
- package/dist/react/auth0/server/Auth0ProfileManagementService.js +127 -0
- package/dist/react/auth0/server/Auth0ProfileServices.d.ts +13 -0
- package/dist/react/auth0/server/Auth0ProfileServices.js +19 -0
- package/dist/react/auth0/server/Auth0ProfileStore.d.ts +17 -0
- package/dist/react/auth0/server/Auth0ProfileStore.js +83 -0
- package/dist/react/auth0/server/Auth0ProfileUserService.d.ts +16 -0
- package/dist/react/auth0/server/Auth0ProfileUserService.js +48 -0
- package/dist/react/auth0/server/index.d.ts +4 -0
- package/dist/react/auth0/server/index.js +20 -0
- package/dist/react/auth0/web/Auth0IdentityClient.d.ts +34 -0
- package/dist/react/auth0/web/Auth0IdentityClient.js +200 -0
- package/dist/react/auth0/web/Auth0IdentityClientProvider.d.ts +35 -0
- package/dist/react/auth0/web/Auth0IdentityClientProvider.js +67 -0
- package/dist/react/auth0/web/index.d.ts +1 -0
- package/dist/react/auth0/web/index.js +17 -0
- package/dist/react/bridge/core/BridgeConnection.d.ts +6 -0
- package/dist/react/bridge/core/BridgeConnection.js +2 -0
- package/dist/react/bridge/core/BridgeConstants.d.ts +7 -0
- package/dist/react/bridge/core/BridgeConstants.js +15 -0
- package/dist/react/bridge/core/BridgeEvent.d.ts +52 -0
- package/dist/react/bridge/core/BridgeEvent.js +28 -0
- package/dist/react/bridge/core/BridgeMethod.d.ts +12 -0
- package/dist/react/bridge/core/BridgeMethod.js +2 -0
- package/dist/react/bridge/core/BridgeMethodCall.d.ts +23 -0
- package/dist/react/bridge/core/BridgeMethodCall.js +37 -0
- package/dist/react/bridge/core/BridgeMethods.d.ts +35 -0
- package/dist/react/bridge/core/BridgeMethods.js +2 -0
- package/dist/react/bridge/core/BridgeState.d.ts +24 -0
- package/dist/react/bridge/core/BridgeState.js +2 -0
- package/dist/react/bridge/core/index.d.ts +7 -0
- package/dist/react/bridge/core/index.js +23 -0
- package/dist/react/bridge/web/Bridge.d.ts +32 -0
- package/dist/react/bridge/web/Bridge.js +183 -0
- package/dist/react/bridge/web/BridgeContext.d.ts +8 -0
- package/dist/react/bridge/web/BridgeContext.js +6 -0
- package/dist/react/bridge/web/BridgeGlobals.d.ts +12 -0
- package/dist/react/bridge/web/BridgeGlobals.js +2 -0
- package/dist/react/bridge/web/BridgeProvider.d.ts +7 -0
- package/dist/react/bridge/web/BridgeProvider.js +36 -0
- package/dist/react/bridge/web/index.d.ts +6 -0
- package/dist/react/bridge/web/index.js +22 -0
- package/dist/react/bridge/web/useBridge.d.ts +3 -0
- package/dist/react/bridge/web/useBridge.js +39 -0
- package/dist/react/bridge/web/useBridgeState.d.ts +2 -0
- package/dist/react/bridge/web/useBridgeState.js +43 -0
- package/dist/react/bridge/web/useSafeArea.d.ts +1 -0
- package/dist/react/bridge/web/useSafeArea.js +11 -0
- package/dist/react/content/core/AppContentClient.d.ts +14 -0
- package/dist/react/content/core/AppContentClient.js +51 -0
- package/dist/react/content/core/ContentClientContext.d.ts +7 -0
- package/dist/react/content/core/ContentClientContext.js +6 -0
- package/dist/react/content/core/index.d.ts +1 -0
- package/dist/react/content/core/index.js +17 -0
- package/dist/react/content/domain/ContentAppRequest.d.ts +20 -0
- package/dist/react/content/domain/ContentAppRequest.js +11 -0
- package/dist/react/content/domain/index.d.ts +1 -0
- package/dist/react/content/domain/index.js +17 -0
- package/dist/react/content/server/ContentAppService.d.ts +11 -0
- package/dist/react/content/server/ContentAppService.js +34 -0
- package/dist/react/content/server/index.d.ts +1 -0
- package/dist/react/content/server/index.js +17 -0
- package/dist/react/content/web/ContentProvider.d.ts +5 -0
- package/dist/react/content/web/ContentProvider.js +17 -0
- package/dist/react/content/web/index.d.ts +6 -0
- package/dist/react/content/web/index.js +22 -0
- package/dist/react/content/web/useCollection.d.ts +10 -0
- package/dist/react/content/web/useCollection.js +22 -0
- package/dist/react/content/web/useCollections.d.ts +10 -0
- package/dist/react/content/web/useCollections.js +32 -0
- package/dist/react/content/web/useContentClient.d.ts +1 -0
- package/dist/react/content/web/useContentClient.js +9 -0
- package/dist/react/cookies/web/CookieService.d.ts +25 -0
- package/dist/react/cookies/web/CookieService.js +45 -0
- package/dist/react/cookies/web/CookieServiceContext.d.ts +7 -0
- package/dist/react/cookies/web/CookieServiceContext.js +6 -0
- package/dist/react/cookies/web/CookieServiceProvider.d.ts +6 -0
- package/dist/react/cookies/web/CookieServiceProvider.js +16 -0
- package/dist/react/cookies/web/index.d.ts +3 -0
- package/dist/react/cookies/web/index.js +19 -0
- package/dist/react/cookies/web/useCookieService.d.ts +2 -0
- package/dist/react/cookies/web/useCookieService.js +29 -0
- package/dist/react/identity/core/AbstractIdentityClient.d.ts +22 -0
- package/dist/react/identity/core/AbstractIdentityClient.js +31 -0
- package/dist/react/identity/core/IdentityClient.d.ts +22 -0
- package/dist/react/identity/core/IdentityClient.js +13 -0
- package/dist/react/identity/core/IdentityClientContext.d.ts +7 -0
- package/dist/react/identity/core/IdentityClientContext.js +6 -0
- package/dist/react/identity/core/index.d.ts +6 -0
- package/dist/react/identity/core/index.js +22 -0
- package/dist/react/identity/core/useIdentity.d.ts +10 -0
- package/dist/react/identity/core/useIdentity.js +39 -0
- package/dist/react/identity/core/useIdentityClient.d.ts +2 -0
- package/dist/react/identity/core/useIdentityClient.js +17 -0
- package/dist/react/identity/domain/AnonymousIdentity.d.ts +15 -0
- package/dist/react/identity/domain/AnonymousIdentity.js +27 -0
- package/dist/react/identity/domain/AuthenticatedIdentity.d.ts +25 -0
- package/dist/react/identity/domain/AuthenticatedIdentity.js +32 -0
- package/dist/react/identity/domain/Identity.d.ts +6 -0
- package/dist/react/identity/domain/Identity.js +2 -0
- package/dist/react/identity/domain/IdentityAppRequest.d.ts +8 -0
- package/dist/react/identity/domain/IdentityAppRequest.js +10 -0
- package/dist/react/identity/domain/index.d.ts +4 -0
- package/dist/react/identity/domain/index.js +20 -0
- package/dist/react/identity/server/IdentityAppService.d.ts +9 -0
- package/dist/react/identity/server/IdentityAppService.js +32 -0
- package/dist/react/identity/server/IdentityService.d.ts +17 -0
- package/dist/react/identity/server/IdentityService.js +25 -0
- package/dist/react/identity/server/index.d.ts +4 -0
- package/dist/react/identity/server/index.js +20 -0
- package/dist/react/identity/web/WebIdentityClientProvider.d.ts +8 -0
- package/dist/react/identity/web/WebIdentityClientProvider.js +27 -0
- package/dist/react/identity/web/WebIdentityProvider.d.ts +5 -0
- package/dist/react/identity/web/WebIdentityProvider.js +21 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClient.d.ts +14 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClient.js +47 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClientProvider.d.ts +2 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClientProvider.js +28 -0
- package/dist/react/identity/web/bridge/index.d.ts +1 -0
- package/dist/react/identity/web/bridge/index.js +17 -0
- package/dist/react/identity/web/index.d.ts +3 -0
- package/dist/react/identity/web/index.js +19 -0
- package/dist/react/nav/core/SpecSourceContext.d.ts +7 -0
- package/dist/react/nav/core/SpecSourceContext.js +6 -0
- package/dist/react/nav/core/index.d.ts +2 -0
- package/dist/react/nav/core/index.js +18 -0
- package/dist/react/nav/core/useSpec.d.ts +3 -0
- package/dist/react/nav/core/useSpec.js +30 -0
- package/dist/react/nav/domain/Icon.d.ts +2 -0
- package/dist/react/nav/domain/Icon.js +2 -0
- package/dist/react/nav/domain/Modal.d.ts +25 -0
- package/dist/react/nav/domain/Modal.js +28 -0
- package/dist/react/nav/domain/Navigation.d.ts +13 -0
- package/dist/react/nav/domain/Navigation.js +2 -0
- package/dist/react/nav/domain/NavigationCommand.d.ts +14 -0
- package/dist/react/nav/domain/NavigationCommand.js +2 -0
- package/dist/react/nav/domain/Route.d.ts +12 -0
- package/dist/react/nav/domain/Route.js +2 -0
- package/dist/react/nav/domain/Routes.d.ts +6 -0
- package/dist/react/nav/domain/Routes.js +74 -0
- package/dist/react/nav/domain/Screen.d.ts +24 -0
- package/dist/react/nav/domain/Screen.js +28 -0
- package/dist/react/nav/domain/Skeleton.d.ts +26 -0
- package/dist/react/nav/domain/Skeleton.js +2 -0
- package/dist/react/nav/domain/Spec.d.ts +33 -0
- package/dist/react/nav/domain/Spec.js +124 -0
- package/dist/react/nav/domain/SpecSource.d.ts +21 -0
- package/dist/react/nav/domain/SpecSource.js +28 -0
- package/dist/react/nav/domain/Stack.d.ts +35 -0
- package/dist/react/nav/domain/Stack.js +44 -0
- package/dist/react/nav/domain/Tabs.d.ts +37 -0
- package/dist/react/nav/domain/Tabs.js +45 -0
- package/dist/react/nav/domain/icons/ImageIcon.d.ts +2 -0
- package/dist/react/nav/domain/icons/ImageIcon.js +7 -0
- package/dist/react/nav/domain/icons/LucideIcon.d.ts +2 -0
- package/dist/react/nav/domain/icons/LucideIcon.js +7 -0
- package/dist/react/nav/domain/icons/index.d.ts +2 -0
- package/dist/react/nav/domain/icons/index.js +18 -0
- package/dist/react/nav/domain/index.d.ts +14 -0
- package/dist/react/nav/domain/index.js +30 -0
- package/dist/react/nav/domain/sources/AbstractSpecSource.d.ts +23 -0
- package/dist/react/nav/domain/sources/AbstractSpecSource.js +64 -0
- package/dist/react/nav/domain/sources/StaticSpecSource.d.ts +9 -0
- package/dist/react/nav/domain/sources/StaticSpecSource.js +16 -0
- package/dist/react/nav/domain/sources/index.d.ts +2 -0
- package/dist/react/nav/domain/sources/index.js +18 -0
- package/dist/react/nav/server/SpecService.d.ts +9 -0
- package/dist/react/nav/server/SpecService.js +31 -0
- package/dist/react/nav/server/exports.d.ts +1 -0
- package/dist/react/nav/server/exports.js +17 -0
- package/dist/react/nav/server/index.d.ts +2 -0
- package/dist/react/nav/server/index.js +38 -0
- package/dist/react/nav/web/WebSpecProvider.d.ts +2 -0
- package/dist/react/nav/web/WebSpecProvider.js +41 -0
- package/dist/react/nav/web/index.d.ts +3 -0
- package/dist/react/nav/web/index.js +19 -0
- package/dist/react/nav/web/navigator/NativeNavigator.d.ts +13 -0
- package/dist/react/nav/web/navigator/NativeNavigator.js +47 -0
- package/dist/react/nav/web/navigator/Navigator.d.ts +7 -0
- package/dist/react/nav/web/navigator/Navigator.js +2 -0
- package/dist/react/nav/web/navigator/NavigatorContext.d.ts +7 -0
- package/dist/react/nav/web/navigator/NavigatorContext.js +6 -0
- package/dist/react/nav/web/navigator/WebNavigator.d.ts +13 -0
- package/dist/react/nav/web/navigator/WebNavigator.js +38 -0
- package/dist/react/nav/web/navigator/index.d.ts +5 -0
- package/dist/react/nav/web/navigator/index.js +21 -0
- package/dist/react/nav/web/navigator/useNavigator.d.ts +1 -0
- package/dist/react/nav/web/navigator/useNavigator.js +17 -0
- package/dist/react/nav.d.ts +1 -0
- package/dist/react/nav.js +37 -0
- package/dist/react/profile/core/AbstractProfileClient.d.ts +18 -0
- package/dist/react/profile/core/AbstractProfileClient.js +31 -0
- package/dist/react/profile/core/ProfileClient.d.ts +21 -0
- package/dist/react/profile/core/ProfileClient.js +2 -0
- package/dist/react/profile/core/ProfileClientContext.d.ts +7 -0
- package/dist/react/profile/core/ProfileClientContext.js +6 -0
- package/dist/react/profile/core/index.d.ts +6 -0
- package/dist/react/profile/core/index.js +22 -0
- package/dist/react/profile/core/useProfile.d.ts +9 -0
- package/dist/react/profile/core/useProfile.js +47 -0
- package/dist/react/profile/core/useProfileClient.d.ts +2 -0
- package/dist/react/profile/core/useProfileClient.js +17 -0
- package/dist/react/profile/core/useProfileStore.d.ts +2 -0
- package/dist/react/profile/core/useProfileStore.js +28 -0
- package/dist/react/profile/domain/Profile.d.ts +80 -0
- package/dist/react/profile/domain/Profile.js +209 -0
- package/dist/react/profile/domain/ProfileAppRequest.d.ts +15 -0
- package/dist/react/profile/domain/ProfileAppRequest.js +12 -0
- package/dist/react/profile/domain/ProfileStore.d.ts +65 -0
- package/dist/react/profile/domain/ProfileStore.js +180 -0
- package/dist/react/profile/domain/index.d.ts +3 -0
- package/dist/react/profile/domain/index.js +19 -0
- package/dist/react/profile/server/ProfileAppService.d.ts +11 -0
- package/dist/react/profile/server/ProfileAppService.js +49 -0
- package/dist/react/profile/server/ProfileManagementService.d.ts +28 -0
- package/dist/react/profile/server/ProfileManagementService.js +3 -0
- package/dist/react/profile/server/ProfileServices.d.ts +22 -0
- package/dist/react/profile/server/ProfileServices.js +24 -0
- package/dist/react/profile/server/ProfileUserService.d.ts +5 -0
- package/dist/react/profile/server/ProfileUserService.js +2 -0
- package/dist/react/profile/server/index.d.ts +5 -0
- package/dist/react/profile/server/index.js +21 -0
- package/dist/react/profile/web/WebProfile.d.ts +11 -0
- package/dist/react/profile/web/WebProfile.js +37 -0
- package/dist/react/profile/web/WebProfileClient.d.ts +9 -0
- package/dist/react/profile/web/WebProfileClient.js +76 -0
- package/dist/react/profile/web/WebProfileProvider.d.ts +5 -0
- package/dist/react/profile/web/WebProfileProvider.js +62 -0
- package/dist/react/profile/web/WebProfileStore.d.ts +8 -0
- package/dist/react/profile/web/WebProfileStore.js +32 -0
- package/dist/react/profile/web/index.d.ts +3 -0
- package/dist/react/profile/web/index.js +19 -0
- package/dist/react/push/domain/PushAppRequest.d.ts +13 -0
- package/dist/react/push/domain/PushAppRequest.js +12 -0
- package/dist/react/push/domain/PushStore.d.ts +7 -0
- package/dist/react/push/domain/PushStore.js +9 -0
- package/dist/react/push/domain/index.d.ts +2 -0
- package/dist/react/push/domain/index.js +18 -0
- package/dist/react/push/server/PushService.d.ts +22 -0
- package/dist/react/push/server/PushService.js +57 -0
- package/dist/react/push/server/index.d.ts +3 -0
- package/dist/react/push/server/index.js +19 -0
- package/dist/react/push/server/keygen.d.ts +1 -0
- package/dist/react/push/server/keygen.js +8 -0
- package/dist/react/push/web/PushClient.d.ts +35 -0
- package/dist/react/push/web/PushClient.js +204 -0
- package/dist/react/push/web/PushContext.d.ts +7 -0
- package/dist/react/push/web/PushContext.js +6 -0
- package/dist/react/push/web/PushProvider.d.ts +6 -0
- package/dist/react/push/web/PushProvider.js +42 -0
- package/dist/react/push/web/index.d.ts +4 -0
- package/dist/react/push/web/index.js +20 -0
- package/dist/react/push/web/usePushClient.d.ts +3 -0
- package/dist/react/push/web/usePushClient.js +40 -0
- package/dist/react/server.d.ts +7 -0
- package/dist/react/server.js +23 -0
- package/dist/react/ui/web/HideSplash.d.ts +1 -0
- package/dist/react/ui/web/HideSplash.js +28 -0
- package/dist/react/ui/web/Link.d.ts +6 -0
- package/dist/react/ui/web/Link.js +12 -0
- package/dist/react/ui/web/SafeArea.d.ts +9 -0
- package/dist/react/ui/web/SafeArea.js +26 -0
- package/dist/react/ui/web/index.d.ts +3 -0
- package/dist/react/ui/web/index.js +19 -0
- package/dist/react/web.d.ts +10 -0
- package/dist/react/web.js +26 -0
- package/dist/reactnative/app/domain/AppService.d.ts +19 -0
- package/dist/reactnative/app/domain/AppService.js +19 -0
- package/dist/reactnative/app/domain/AppServiceClient.d.ts +7 -0
- package/dist/reactnative/app/domain/AppServiceClient.js +57 -0
- package/dist/reactnative/app/domain/AppState.d.ts +1 -0
- package/dist/reactnative/app/domain/AppState.js +2 -0
- package/dist/reactnative/app/domain/index.d.ts +3 -0
- package/dist/reactnative/app/domain/index.js +19 -0
- package/dist/reactnative/app/rn/AppContainer.d.ts +10 -0
- package/dist/reactnative/app/rn/AppContainer.js +77 -0
- package/dist/reactnative/app/rn/AppRoot.d.ts +5 -0
- package/dist/reactnative/app/rn/AppRoot.js +22 -0
- package/dist/reactnative/app/rn/AppServiceClient.d.ts +4 -0
- package/dist/reactnative/app/rn/AppServiceClient.js +44 -0
- package/dist/reactnative/app/rn/index.d.ts +5 -0
- package/dist/reactnative/app/rn/index.js +22 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClient.d.ts +33 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClient.js +234 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClientProvider.d.ts +27 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClientProvider.js +60 -0
- package/dist/reactnative/auth0/rn/index.d.ts +2 -0
- package/dist/reactnative/auth0/rn/index.js +18 -0
- package/dist/reactnative/bridge/core/BridgeConnection.d.ts +6 -0
- package/dist/reactnative/bridge/core/BridgeConnection.js +2 -0
- package/dist/reactnative/bridge/core/BridgeConstants.d.ts +7 -0
- package/dist/reactnative/bridge/core/BridgeConstants.js +15 -0
- package/dist/reactnative/bridge/core/BridgeEvent.d.ts +52 -0
- package/dist/reactnative/bridge/core/BridgeEvent.js +28 -0
- package/dist/reactnative/bridge/core/BridgeMethod.d.ts +12 -0
- package/dist/reactnative/bridge/core/BridgeMethod.js +2 -0
- package/dist/reactnative/bridge/core/BridgeMethodCall.d.ts +23 -0
- package/dist/reactnative/bridge/core/BridgeMethodCall.js +37 -0
- package/dist/reactnative/bridge/core/BridgeMethods.d.ts +35 -0
- package/dist/reactnative/bridge/core/BridgeMethods.js +2 -0
- package/dist/reactnative/bridge/core/BridgeState.d.ts +24 -0
- package/dist/reactnative/bridge/core/BridgeState.js +2 -0
- package/dist/reactnative/bridge/core/index.d.ts +7 -0
- package/dist/reactnative/bridge/core/index.js +23 -0
- package/dist/reactnative/bridge/rn/BridgeProxy.d.ts +35 -0
- package/dist/reactnative/bridge/rn/BridgeProxy.js +331 -0
- package/dist/reactnative/bridge/rn/BridgeProxyContext.d.ts +8 -0
- package/dist/reactnative/bridge/rn/BridgeProxyContext.js +6 -0
- package/dist/reactnative/bridge/rn/BridgeProxyProvider.d.ts +8 -0
- package/dist/reactnative/bridge/rn/BridgeProxyProvider.js +39 -0
- package/dist/reactnative/bridge/rn/BridgeWebview.d.ts +7 -0
- package/dist/reactnative/bridge/rn/BridgeWebview.js +51 -0
- package/dist/reactnative/bridge/rn/index.d.ts +7 -0
- package/dist/reactnative/bridge/rn/index.js +23 -0
- package/dist/reactnative/bridge/rn/useBridgeProxy.d.ts +3 -0
- package/dist/reactnative/bridge/rn/useBridgeProxy.js +38 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyCalls.d.ts +3 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyCalls.js +32 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyState.d.ts +2 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyState.js +46 -0
- package/dist/reactnative/identity/core/AbstractIdentityClient.d.ts +22 -0
- package/dist/reactnative/identity/core/AbstractIdentityClient.js +31 -0
- package/dist/reactnative/identity/core/IdentityClient.d.ts +22 -0
- package/dist/reactnative/identity/core/IdentityClient.js +13 -0
- package/dist/reactnative/identity/core/IdentityClientContext.d.ts +7 -0
- package/dist/reactnative/identity/core/IdentityClientContext.js +6 -0
- package/dist/reactnative/identity/core/index.d.ts +6 -0
- package/dist/reactnative/identity/core/index.js +22 -0
- package/dist/reactnative/identity/core/useIdentity.d.ts +10 -0
- package/dist/reactnative/identity/core/useIdentity.js +39 -0
- package/dist/reactnative/identity/core/useIdentityClient.d.ts +2 -0
- package/dist/reactnative/identity/core/useIdentityClient.js +17 -0
- package/dist/reactnative/identity/domain/AnonymousIdentity.d.ts +15 -0
- package/dist/reactnative/identity/domain/AnonymousIdentity.js +27 -0
- package/dist/reactnative/identity/domain/AuthenticatedIdentity.d.ts +25 -0
- package/dist/reactnative/identity/domain/AuthenticatedIdentity.js +32 -0
- package/dist/reactnative/identity/domain/Identity.d.ts +6 -0
- package/dist/reactnative/identity/domain/Identity.js +2 -0
- package/dist/reactnative/identity/domain/IdentityAppRequest.d.ts +8 -0
- package/dist/reactnative/identity/domain/IdentityAppRequest.js +10 -0
- package/dist/reactnative/identity/domain/index.d.ts +4 -0
- package/dist/reactnative/identity/domain/index.js +20 -0
- package/dist/reactnative/identity/rn/RNIdentityClientProvider.d.ts +8 -0
- package/dist/reactnative/identity/rn/RNIdentityClientProvider.js +22 -0
- package/dist/reactnative/identity/rn/RNIdentityProvider.d.ts +5 -0
- package/dist/reactnative/identity/rn/RNIdentityProvider.js +14 -0
- package/dist/reactnative/identity/rn/index.d.ts +3 -0
- package/dist/reactnative/identity/rn/index.js +19 -0
- package/dist/reactnative/nav/core/SpecSourceContext.d.ts +7 -0
- package/dist/reactnative/nav/core/SpecSourceContext.js +6 -0
- package/dist/reactnative/nav/core/index.d.ts +2 -0
- package/dist/reactnative/nav/core/index.js +18 -0
- package/dist/reactnative/nav/core/useSpec.d.ts +3 -0
- package/dist/reactnative/nav/core/useSpec.js +30 -0
- package/dist/reactnative/nav/domain/Icon.d.ts +2 -0
- package/dist/reactnative/nav/domain/Icon.js +2 -0
- package/dist/reactnative/nav/domain/Modal.d.ts +25 -0
- package/dist/reactnative/nav/domain/Modal.js +28 -0
- package/dist/reactnative/nav/domain/Navigation.d.ts +13 -0
- package/dist/reactnative/nav/domain/Navigation.js +2 -0
- package/dist/reactnative/nav/domain/NavigationCommand.d.ts +14 -0
- package/dist/reactnative/nav/domain/NavigationCommand.js +2 -0
- package/dist/reactnative/nav/domain/Route.d.ts +12 -0
- package/dist/reactnative/nav/domain/Route.js +2 -0
- package/dist/reactnative/nav/domain/Routes.d.ts +6 -0
- package/dist/reactnative/nav/domain/Routes.js +74 -0
- package/dist/reactnative/nav/domain/Screen.d.ts +24 -0
- package/dist/reactnative/nav/domain/Screen.js +28 -0
- package/dist/reactnative/nav/domain/Skeleton.d.ts +26 -0
- package/dist/reactnative/nav/domain/Skeleton.js +2 -0
- package/dist/reactnative/nav/domain/Spec.d.ts +33 -0
- package/dist/reactnative/nav/domain/Spec.js +124 -0
- package/dist/reactnative/nav/domain/SpecSource.d.ts +21 -0
- package/dist/reactnative/nav/domain/SpecSource.js +28 -0
- package/dist/reactnative/nav/domain/Stack.d.ts +35 -0
- package/dist/reactnative/nav/domain/Stack.js +44 -0
- package/dist/reactnative/nav/domain/Tabs.d.ts +37 -0
- package/dist/reactnative/nav/domain/Tabs.js +45 -0
- package/dist/reactnative/nav/domain/icons/ImageIcon.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/ImageIcon.js +7 -0
- package/dist/reactnative/nav/domain/icons/LucideIcon.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/LucideIcon.js +7 -0
- package/dist/reactnative/nav/domain/icons/index.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/index.js +18 -0
- package/dist/reactnative/nav/domain/index.d.ts +14 -0
- package/dist/reactnative/nav/domain/index.js +30 -0
- package/dist/reactnative/nav/domain/sources/AbstractSpecSource.d.ts +23 -0
- package/dist/reactnative/nav/domain/sources/AbstractSpecSource.js +64 -0
- package/dist/reactnative/nav/domain/sources/StaticSpecSource.d.ts +9 -0
- package/dist/reactnative/nav/domain/sources/StaticSpecSource.js +16 -0
- package/dist/reactnative/nav/domain/sources/index.d.ts +2 -0
- package/dist/reactnative/nav/domain/sources/index.js +18 -0
- package/dist/reactnative/nav/rn/NavigationEngine.d.ts +1 -0
- package/dist/reactnative/nav/rn/NavigationEngine.js +155 -0
- package/dist/reactnative/nav/rn/NavigationScreen.d.ts +9 -0
- package/dist/reactnative/nav/rn/NavigationScreen.js +215 -0
- package/dist/reactnative/nav/rn/RNSpecProvider.d.ts +2 -0
- package/dist/reactnative/nav/rn/RNSpecProvider.js +30 -0
- package/dist/reactnative/nav/rn/RNSpecSource.d.ts +5 -0
- package/dist/reactnative/nav/rn/RNSpecSource.js +30 -0
- package/dist/reactnative/nav/rn/index.d.ts +4 -0
- package/dist/reactnative/nav/rn/index.js +20 -0
- package/dist/reactnative/profile/domain/Profile.d.ts +80 -0
- package/dist/reactnative/profile/domain/Profile.js +209 -0
- package/dist/reactnative/profile/domain/ProfileAppRequest.d.ts +15 -0
- package/dist/reactnative/profile/domain/ProfileAppRequest.js +12 -0
- package/dist/reactnative/profile/domain/ProfileStore.d.ts +65 -0
- package/dist/reactnative/profile/domain/ProfileStore.js +180 -0
- package/dist/reactnative/profile/domain/index.d.ts +3 -0
- package/dist/reactnative/profile/domain/index.js +19 -0
- package/dist/reactnative/push/domain/PushAppRequest.d.ts +13 -0
- package/dist/reactnative/push/domain/PushAppRequest.js +12 -0
- package/dist/reactnative/push/domain/PushStore.d.ts +7 -0
- package/dist/reactnative/push/domain/PushStore.js +9 -0
- package/dist/reactnative/push/domain/index.d.ts +2 -0
- package/dist/reactnative/push/domain/index.js +18 -0
- package/dist/reactnative/push/rn/PushClient.d.ts +32 -0
- package/dist/reactnative/push/rn/PushClient.js +247 -0
- package/dist/reactnative/push/rn/PushContext.d.ts +7 -0
- package/dist/reactnative/push/rn/PushContext.js +6 -0
- package/dist/reactnative/push/rn/PushProvider.d.ts +2 -0
- package/dist/reactnative/push/rn/PushProvider.js +45 -0
- package/dist/reactnative/push/rn/index.d.ts +3 -0
- package/dist/reactnative/push/rn/index.js +19 -0
- package/dist/reactnative/push/rn/usePushClient.d.ts +3 -0
- package/dist/reactnative/push/rn/usePushClient.js +40 -0
- package/dist/reactnative/rn.d.ts +7 -0
- package/dist/reactnative/rn.js +23 -0
- package/dist/reactnative/ui/rn/Tailwind.d.ts +175 -0
- package/dist/reactnative/ui/rn/Tailwind.js +211 -0
- package/dist/reactnative/ui/rn/atomic/Button.d.ts +97 -0
- package/dist/reactnative/ui/rn/atomic/Button.js +75 -0
- package/dist/reactnative/ui/rn/atomic/TextField.d.ts +112 -0
- package/dist/reactnative/ui/rn/atomic/TextField.js +135 -0
- package/dist/reactnative/ui/rn/atomic/index.d.ts +2 -0
- package/dist/reactnative/ui/rn/atomic/index.js +18 -0
- package/dist/reactnative/ui/rn/index.d.ts +1 -0
- package/dist/reactnative/ui/rn/index.js +17 -0
- package/dist/styles/rn/_index.css +2 -0
- package/dist/styles/rn/atomic/Button.css +54 -0
- package/dist/styles/rn/atomic/TextField.css +77 -0
- package/dist/styles/rn/atomic/_index.css +2 -0
- package/dist/styles/rn/base/_index.css +1 -0
- package/dist/styles/rn/base/tailwind.css +3 -0
- package/dist/styles/rn.css +1 -0
- package/dist/styles/web/_index.css +1 -0
- package/dist/styles/web/layout/SafeArea.css +17 -0
- package/dist/styles/web/layout/_index.css +1 -0
- package/dist/styles/web.css +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JsonValue } from 'type-fest';
|
|
2
|
+
import type { Identity } from '../../identity/domain';
|
|
3
|
+
export interface AppService<TRequest extends AppService.Request = AppService.Request> {
|
|
4
|
+
readonly id: TRequest['id'];
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly authenticated: boolean;
|
|
7
|
+
execute(request: TRequest, identity?: Identity): Promise<JsonValue>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace AppService {
|
|
10
|
+
type Request<TId extends string = string, TMethod extends string = string, TData extends JsonValue = JsonValue> = {
|
|
11
|
+
apiToken?: string;
|
|
12
|
+
id: TId;
|
|
13
|
+
method: TMethod;
|
|
14
|
+
data: TData;
|
|
15
|
+
};
|
|
16
|
+
namespace Request {
|
|
17
|
+
function filter<TId extends string = string, TMethod extends string = string, TData extends JsonValue = JsonValue>(request: any): request is Request<TId, TMethod, TData>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppService = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var AppService;
|
|
6
|
+
(function (AppService) {
|
|
7
|
+
let Request;
|
|
8
|
+
(function (Request) {
|
|
9
|
+
// guard
|
|
10
|
+
function filter(request) {
|
|
11
|
+
return !!request
|
|
12
|
+
&& typeof request === 'object'
|
|
13
|
+
&& !Array.isArray(request)
|
|
14
|
+
&& 'id' in request && typeof request.id === 'string'
|
|
15
|
+
&& 'method' in request && typeof request.method === 'string';
|
|
16
|
+
}
|
|
17
|
+
Request.filter = filter;
|
|
18
|
+
})(Request = AppService.Request || (AppService.Request = {}));
|
|
19
|
+
})(AppService || (exports.AppService = AppService = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppService } from './AppService';
|
|
2
|
+
export declare namespace AppServiceClient {
|
|
3
|
+
type PostArgs<TRequest extends AppService.Request> = TRequest & {
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
};
|
|
6
|
+
function post<TRequest extends AppService.Request>({ baseUrl, apiToken, id, method, data }: PostArgs<TRequest>): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppServiceClient = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
// namespace
|
|
6
|
+
var AppServiceClient;
|
|
7
|
+
(function (AppServiceClient) {
|
|
8
|
+
async function post({ baseUrl = '', apiToken, id, method, data }) {
|
|
9
|
+
var _a;
|
|
10
|
+
// try to send request
|
|
11
|
+
try {
|
|
12
|
+
// build headers
|
|
13
|
+
const headers = {};
|
|
14
|
+
if (apiToken) {
|
|
15
|
+
headers['Authorization'] = `Bearer ${apiToken}`;
|
|
16
|
+
}
|
|
17
|
+
// resolve api url
|
|
18
|
+
let url = '/api/app';
|
|
19
|
+
if (baseUrl) {
|
|
20
|
+
url = new URL(url, baseUrl).href;
|
|
21
|
+
}
|
|
22
|
+
console.log('[AppServiceCall/post] sending', { apiToken, id, method, data, url });
|
|
23
|
+
// send request
|
|
24
|
+
const response = await fetch(url, {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
credentials: 'same-origin',
|
|
27
|
+
headers,
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
id,
|
|
30
|
+
method,
|
|
31
|
+
data
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
console.log('[AppServiceCall/post] sent', { id, method });
|
|
35
|
+
// throw if response failed
|
|
36
|
+
await funnel_core_1.IsometricErrorUtils.checkResponse(response);
|
|
37
|
+
// parse response
|
|
38
|
+
const json = await response.json();
|
|
39
|
+
// return response (assume it's a result)
|
|
40
|
+
return funnel_core_1.Value.typeOf(json) === 'object'
|
|
41
|
+
? (_a = json.data) !== null && _a !== void 0 ? _a : undefined
|
|
42
|
+
: undefined;
|
|
43
|
+
}
|
|
44
|
+
// restore errors
|
|
45
|
+
catch (e) {
|
|
46
|
+
// forward iso-errors
|
|
47
|
+
if (e instanceof funnel_core_1.IsometricError) {
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
// or assume it's offline
|
|
51
|
+
else {
|
|
52
|
+
throw new funnel_core_1.OfflineError();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
AppServiceClient.post = post;
|
|
57
|
+
})(AppServiceClient || (exports.AppServiceClient = AppServiceClient = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AppState = 'initializing' | 'unauthenticated' | 'authenticated' | 'pausing' | 'paused' | 'resuming' | 'error.identity' | 'error.profile';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AppService"), exports);
|
|
18
|
+
__exportStar(require("./AppServiceClient"), exports);
|
|
19
|
+
__exportStar(require("./AppState"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JsonValue } from 'type-fest';
|
|
2
|
+
import { Identity } from '../../identity/domain';
|
|
3
|
+
import type { AppService } from '../domain';
|
|
4
|
+
export declare abstract class AbstractAppService<TRequest extends AppService.Request = AppService.Request> implements AppService<TRequest> {
|
|
5
|
+
readonly id: TRequest['id'];
|
|
6
|
+
readonly name: string;
|
|
7
|
+
protected constructor(args: AbstractAppService.ConstructorArgs<TRequest>);
|
|
8
|
+
get authenticated(): boolean;
|
|
9
|
+
execute(request: TRequest, identity?: Identity): Promise<JsonValue>;
|
|
10
|
+
abstract onExecute(request: TRequest, identity?: Identity): Promise<JsonValue>;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace AbstractAppService {
|
|
13
|
+
type ConstructorArgs<TRequest extends AppService.Request> = {
|
|
14
|
+
id: TRequest['id'];
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractAppService = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
// class
|
|
6
|
+
class AbstractAppService {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
// initialize instance variables
|
|
9
|
+
this.id = args.id;
|
|
10
|
+
this.name = args.name;
|
|
11
|
+
}
|
|
12
|
+
get authenticated() {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
async execute(request, identity) {
|
|
16
|
+
// authenticate (if required)
|
|
17
|
+
if (this.authenticated && !identity) {
|
|
18
|
+
throw new funnel_core_1.NotAuthenticatedError();
|
|
19
|
+
}
|
|
20
|
+
// or forward
|
|
21
|
+
return this.onExecute(request, identity);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.AbstractAppService = AbstractAppService;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import type { NextRequest, NextResponse as NextResponseType } from 'next/server';
|
|
3
|
+
import { AbstractAppService } from './AbstractAppService';
|
|
4
|
+
export declare namespace AppServices {
|
|
5
|
+
function bind(...services: ReadonlyArray<AbstractAppService>): void;
|
|
6
|
+
function process(nextRequest: NextRequest, NextResponse: typeof NextResponseType): Promise<NextResponseType<{
|
|
7
|
+
data: import("type-fest").JsonValue;
|
|
8
|
+
}> | NextResponseType<{
|
|
9
|
+
error: import("@nascentdigital/funnel-core").SerializedIsometricError;
|
|
10
|
+
}>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppServices = void 0;
|
|
4
|
+
require("server-only");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const ContentAppService_1 = require("../../content/server/ContentAppService");
|
|
7
|
+
const server_1 = require("../../identity/server");
|
|
8
|
+
const IdentityAppService_1 = require("../../identity/server/IdentityAppService");
|
|
9
|
+
const IdentityService_1 = require("../../identity/server/IdentityService");
|
|
10
|
+
const SpecService_1 = require("../../nav/server/SpecService");
|
|
11
|
+
const ProfileAppService_1 = require("../../profile/server/ProfileAppService");
|
|
12
|
+
const ProfileServices_1 = require("../../profile/server/ProfileServices");
|
|
13
|
+
const domain_1 = require("../domain");
|
|
14
|
+
// namespace
|
|
15
|
+
var AppServices;
|
|
16
|
+
(function (AppServices) {
|
|
17
|
+
const _services = [];
|
|
18
|
+
function bind(...services) {
|
|
19
|
+
// throw if already bound
|
|
20
|
+
if (_services.length > 0) {
|
|
21
|
+
throw new funnel_core_1.InvalidOperationError(`AppServices already bound`);
|
|
22
|
+
}
|
|
23
|
+
// register service
|
|
24
|
+
_services.push(...services);
|
|
25
|
+
// add spec service
|
|
26
|
+
const specService = new SpecService_1.SpecService();
|
|
27
|
+
if (_services.some(service => service.id === specService.id)) {
|
|
28
|
+
throw new funnel_core_1.IllegalStateError(`${specService.name} is already registered`);
|
|
29
|
+
}
|
|
30
|
+
_services.push(specService);
|
|
31
|
+
// add identity service
|
|
32
|
+
const identityService = new IdentityAppService_1.IdentityAppService(IdentityService_1.IdentityService.get());
|
|
33
|
+
if (_services.some(service => service.id === identityService.id)) {
|
|
34
|
+
throw new funnel_core_1.IllegalStateError(`${identityService.name} is already registered`);
|
|
35
|
+
}
|
|
36
|
+
_services.push(identityService);
|
|
37
|
+
// add profile service
|
|
38
|
+
const profileService = new ProfileAppService_1.ProfileAppService(ProfileServices_1.ProfileServices.get().getUserService());
|
|
39
|
+
if (_services.some(service => service.id === profileService.id)) {
|
|
40
|
+
throw new funnel_core_1.IllegalStateError(`${profileService.name} is already registered`);
|
|
41
|
+
}
|
|
42
|
+
_services.push(profileService);
|
|
43
|
+
// add content service
|
|
44
|
+
const contentService = new ContentAppService_1.ContentAppService();
|
|
45
|
+
if (_services.some(service => service.id === contentService.id)) {
|
|
46
|
+
throw new funnel_core_1.IllegalStateError(`${contentService.name} is already registered`);
|
|
47
|
+
}
|
|
48
|
+
_services.push(contentService);
|
|
49
|
+
}
|
|
50
|
+
AppServices.bind = bind;
|
|
51
|
+
async function process(nextRequest, NextResponse) {
|
|
52
|
+
// process request
|
|
53
|
+
try {
|
|
54
|
+
// extract payload
|
|
55
|
+
const request = await nextRequest.json();
|
|
56
|
+
if (!domain_1.AppService.Request.filter(request)) {
|
|
57
|
+
throw new funnel_core_1.InvalidOperationError();
|
|
58
|
+
}
|
|
59
|
+
// find service (or throw)
|
|
60
|
+
const service = _services.find(({ id }) => request.id === id);
|
|
61
|
+
if (!service) {
|
|
62
|
+
throw new funnel_core_1.NotFoundError(`Unrecognized AppService "${request.id}"`);
|
|
63
|
+
}
|
|
64
|
+
// resolve identity (if required)
|
|
65
|
+
const identity = await IdentityService_1.IdentityService.get().current(nextRequest);
|
|
66
|
+
if (service.authenticated && !(identity instanceof server_1.AuthenticatedIdentity)) {
|
|
67
|
+
throw new funnel_core_1.NotAuthenticatedError();
|
|
68
|
+
}
|
|
69
|
+
// handle request with service
|
|
70
|
+
const result = await service.execute(request, identity);
|
|
71
|
+
// return result
|
|
72
|
+
return NextResponse.json({ data: result }, { status: 200 });
|
|
73
|
+
}
|
|
74
|
+
// or return error on failure
|
|
75
|
+
catch (e) {
|
|
76
|
+
console.error('[AppServices] caught error processing request', e);
|
|
77
|
+
// handle API error
|
|
78
|
+
if (e instanceof funnel_core_1.ApiError) {
|
|
79
|
+
return NextResponse.json({ error: e.serialize() }, { status: e.status });
|
|
80
|
+
}
|
|
81
|
+
// or handle other isometric errors
|
|
82
|
+
else {
|
|
83
|
+
return NextResponse.json({
|
|
84
|
+
error: e instanceof funnel_core_1.IsometricError
|
|
85
|
+
? e.serialize()
|
|
86
|
+
: new funnel_core_1.ServerError().serialize()
|
|
87
|
+
}, { status: 500 });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
AppServices.process = process;
|
|
92
|
+
})(AppServices || (exports.AppServices = AppServices = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("server-only");
|
|
18
|
+
__exportStar(require("../domain"), exports);
|
|
19
|
+
__exportStar(require("./AppServices"), exports);
|
|
20
|
+
__exportStar(require("./AbstractAppService"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventBus, IsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { AuthenticatedIdentity, Identity } from '../../identity/web';
|
|
3
|
+
import { Profile } from '../../profile/web';
|
|
4
|
+
import { AppState } from '../domain';
|
|
5
|
+
export declare class App {
|
|
6
|
+
private readonly _eventBus;
|
|
7
|
+
private readonly _state$;
|
|
8
|
+
private _identity?;
|
|
9
|
+
private _profile?;
|
|
10
|
+
private _profileError?;
|
|
11
|
+
private _identityError?;
|
|
12
|
+
constructor(_eventBus: EventBus);
|
|
13
|
+
get event$(): import("rxjs").Observable<App.Event>;
|
|
14
|
+
get state$(): import("rxjs").Observable<AppState>;
|
|
15
|
+
get state(): AppState;
|
|
16
|
+
set state(state: AppState);
|
|
17
|
+
get ready(): boolean;
|
|
18
|
+
get identity(): Identity | undefined;
|
|
19
|
+
get authenticatedIdentity(): AuthenticatedIdentity | undefined;
|
|
20
|
+
get identityError(): IsometricError | undefined;
|
|
21
|
+
get profile(): Profile<Profile.Stores> | undefined;
|
|
22
|
+
get profileError(): IsometricError | undefined;
|
|
23
|
+
onIdentityChanged(newIdentity: Identity): void;
|
|
24
|
+
onIdentityError(error: IsometricError): void;
|
|
25
|
+
onProfileChanged(newProfile: Profile): void;
|
|
26
|
+
onProfileError(error: IsometricError): void;
|
|
27
|
+
private raiseEvent;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace App {
|
|
30
|
+
interface Event extends EventBus.Event<'App', Event.Type> {
|
|
31
|
+
app: App;
|
|
32
|
+
}
|
|
33
|
+
namespace Event {
|
|
34
|
+
type Type = 'changed';
|
|
35
|
+
function filter(event: EventBus.Event): event is Event;
|
|
36
|
+
function create(event: EventBus.Args<Event>): Event;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
6
|
+
const web_1 = require("../../identity/web");
|
|
7
|
+
// class
|
|
8
|
+
class App {
|
|
9
|
+
constructor(_eventBus) {
|
|
10
|
+
this._eventBus = _eventBus;
|
|
11
|
+
// initialize instance variables
|
|
12
|
+
this._state$ = new rxjs_1.BehaviorSubject('initializing');
|
|
13
|
+
console.debug('[App/new] created new App');
|
|
14
|
+
}
|
|
15
|
+
get event$() {
|
|
16
|
+
return this._eventBus.events$.pipe((0, rxjs_1.filter)(App.Event.filter));
|
|
17
|
+
}
|
|
18
|
+
get state$() {
|
|
19
|
+
return this._state$.asObservable();
|
|
20
|
+
}
|
|
21
|
+
get state() {
|
|
22
|
+
return this._state$.getValue();
|
|
23
|
+
}
|
|
24
|
+
set state(state) {
|
|
25
|
+
console.debug(`[App/state] updating state from "${this.state}" to "${state}"`);
|
|
26
|
+
this._state$.next(state);
|
|
27
|
+
this.raiseEvent('changed');
|
|
28
|
+
}
|
|
29
|
+
get ready() {
|
|
30
|
+
return this.state === 'authenticated';
|
|
31
|
+
}
|
|
32
|
+
get identity() {
|
|
33
|
+
return this._identity;
|
|
34
|
+
}
|
|
35
|
+
get authenticatedIdentity() {
|
|
36
|
+
const { _identity } = this;
|
|
37
|
+
return _identity instanceof web_1.AuthenticatedIdentity
|
|
38
|
+
? _identity
|
|
39
|
+
: undefined;
|
|
40
|
+
}
|
|
41
|
+
get identityError() {
|
|
42
|
+
return this._identityError;
|
|
43
|
+
}
|
|
44
|
+
get profile() {
|
|
45
|
+
return this._profile;
|
|
46
|
+
}
|
|
47
|
+
get profileError() {
|
|
48
|
+
return this._profileError;
|
|
49
|
+
}
|
|
50
|
+
onIdentityChanged(newIdentity) {
|
|
51
|
+
// capture identity
|
|
52
|
+
const previousIdentity = this._identity;
|
|
53
|
+
this._identity = newIdentity;
|
|
54
|
+
console.debug('[App/onIdentityChanged] updating identity', { from: previousIdentity, to: newIdentity });
|
|
55
|
+
// FIXME: think through the workflow
|
|
56
|
+
// update based on current state
|
|
57
|
+
switch (this.state) {
|
|
58
|
+
case 'initializing':
|
|
59
|
+
if (!newIdentity.authenticated) {
|
|
60
|
+
this.state = 'unauthenticated';
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
console.debug(`[App/onIdentityChanged] deferring state update while ${this.state}`);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
onIdentityError(error) {
|
|
69
|
+
// capture error
|
|
70
|
+
this._identityError = error;
|
|
71
|
+
console.error('[App] identity error', error);
|
|
72
|
+
// update state
|
|
73
|
+
this.state = 'error.identity';
|
|
74
|
+
}
|
|
75
|
+
onProfileChanged(newProfile) {
|
|
76
|
+
// capture profile
|
|
77
|
+
const previousProfile = this._profile;
|
|
78
|
+
this._profile = newProfile;
|
|
79
|
+
console.debug('[App/onProfileChanged] updating profile', { from: previousProfile, to: newProfile });
|
|
80
|
+
switch (this.state) {
|
|
81
|
+
case 'initializing':
|
|
82
|
+
case 'unauthenticated':
|
|
83
|
+
this.state = 'authenticated';
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
console.debug(`[App/onProfileChanged] deferring state update while ${this.state}`);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
onProfileError(error) {
|
|
91
|
+
// capture error
|
|
92
|
+
this._profileError = error;
|
|
93
|
+
console.error('[App] profile error', error);
|
|
94
|
+
// update state
|
|
95
|
+
this.state = 'error.profile';
|
|
96
|
+
}
|
|
97
|
+
raiseEvent(type) {
|
|
98
|
+
this._eventBus.publish(App.Event.create({ type, app: this }));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.App = App;
|
|
102
|
+
// extension
|
|
103
|
+
(function (App) {
|
|
104
|
+
let Event;
|
|
105
|
+
(function (Event) {
|
|
106
|
+
// methods
|
|
107
|
+
function filter(event) {
|
|
108
|
+
return event.domain === 'App';
|
|
109
|
+
}
|
|
110
|
+
Event.filter = filter;
|
|
111
|
+
function create(event) {
|
|
112
|
+
return funnel_core_1.EventBus.createEvent(Object.assign({ domain: 'App' }, event));
|
|
113
|
+
}
|
|
114
|
+
Event.create = create;
|
|
115
|
+
})(Event = App.Event || (App.Event = {}));
|
|
116
|
+
})(App || (exports.App = App = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventBus, IsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
3
|
+
export declare function AppContainer({ eventBus, SplashScreen, LoginScreen, ErrorScreen, children }: AppContainer.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace AppContainer {
|
|
5
|
+
type ScreenProps = {
|
|
6
|
+
SplashScreen: FunctionComponent<PropsWithChildren>;
|
|
7
|
+
LoginScreen: FunctionComponent<PropsWithChildren>;
|
|
8
|
+
ErrorScreen: FunctionComponent<PropsWithChildren & {
|
|
9
|
+
identityError?: IsometricError;
|
|
10
|
+
profileError?: IsometricError;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
type Props = PropsWithChildren & ScreenProps & {
|
|
14
|
+
eventBus: EventBus;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AppContainer = AppContainer;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const react_1 = require("motion/react");
|
|
10
|
+
const head_1 = __importDefault(require("next/head"));
|
|
11
|
+
const router_1 = require("next/router");
|
|
12
|
+
const react_2 = require("react");
|
|
13
|
+
const rxjs_1 = require("rxjs");
|
|
14
|
+
const web_1 = require("../../bridge/web");
|
|
15
|
+
const web_2 = require("../../identity/web");
|
|
16
|
+
const web_3 = require("../../profile/web");
|
|
17
|
+
const App_1 = require("./App");
|
|
18
|
+
const AppContext_1 = require("./AppContext");
|
|
19
|
+
const useApp_1 = require("./useApp");
|
|
20
|
+
// container
|
|
21
|
+
function AppContainer({ eventBus, SplashScreen, LoginScreen, ErrorScreen, children }) {
|
|
22
|
+
// bind memos + hooks
|
|
23
|
+
const [splashing, setSplashing] = (0, react_2.useState)(true);
|
|
24
|
+
const router = (0, router_1.useRouter)();
|
|
25
|
+
const app = (0, react_2.useMemo)(() => new App_1.App(eventBus), [eventBus]);
|
|
26
|
+
const context = (0, react_2.useMemo)(() => ({ app }), [app]);
|
|
27
|
+
const { identity, error: identityError } = (0, web_2.useIdentity)();
|
|
28
|
+
const { profile, error: profileError } = (0, web_3.useProfile)();
|
|
29
|
+
const bridge = (0, web_1.useBridge)();
|
|
30
|
+
const initializing = app.state === 'initializing';
|
|
31
|
+
// watch app
|
|
32
|
+
(0, useApp_1.useApp)(app);
|
|
33
|
+
// bind identity when active
|
|
34
|
+
(0, react_2.useEffect)(() => {
|
|
35
|
+
if (identity) {
|
|
36
|
+
console.debug('[AppContainer] binding identity:', identity.toData());
|
|
37
|
+
app.onIdentityChanged(identity);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.debug('[AppContainer] waiting for identity to sync');
|
|
41
|
+
}
|
|
42
|
+
}, [app, identity]);
|
|
43
|
+
// bind identity error
|
|
44
|
+
(0, react_2.useEffect)(() => {
|
|
45
|
+
if (identityError) {
|
|
46
|
+
console.debug('[AppContainer] identity error:', identityError.serialize());
|
|
47
|
+
app.onIdentityError(identityError);
|
|
48
|
+
}
|
|
49
|
+
}, [app, identityError]);
|
|
50
|
+
// bind profile
|
|
51
|
+
(0, react_2.useEffect)(() => {
|
|
52
|
+
if (profile) {
|
|
53
|
+
console.debug('[AppContainer] binding identity:', profile.toData());
|
|
54
|
+
app.onProfileChanged(profile);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.debug('[AppContainer] waiting for profile to sync');
|
|
58
|
+
}
|
|
59
|
+
}, [app, profile]);
|
|
60
|
+
// bind profile error
|
|
61
|
+
(0, react_2.useEffect)(() => {
|
|
62
|
+
if (profileError) {
|
|
63
|
+
console.debug('[AppContainer] profile error:', profileError.serialize());
|
|
64
|
+
app.onProfileError(profileError);
|
|
65
|
+
}
|
|
66
|
+
}, [app, profileError]);
|
|
67
|
+
// hide splash when it's done initializing
|
|
68
|
+
(0, react_2.useEffect)(() => {
|
|
69
|
+
if (!initializing) {
|
|
70
|
+
console.debug('[AppContainer] initialization complete');
|
|
71
|
+
(0, rxjs_1.firstValueFrom)((0, rxjs_1.timer)(1000))
|
|
72
|
+
.then(() => setSplashing(false));
|
|
73
|
+
}
|
|
74
|
+
}, [initializing]);
|
|
75
|
+
// show splash if still initializing app
|
|
76
|
+
let contentKey = undefined;
|
|
77
|
+
let content;
|
|
78
|
+
const isNative = bridge.isNative;
|
|
79
|
+
if (isNative) {
|
|
80
|
+
content = identity ? children : null;
|
|
81
|
+
}
|
|
82
|
+
// or render error
|
|
83
|
+
else if (app.identityError || app.profileError) {
|
|
84
|
+
content = (0, jsx_runtime_1.jsx)(ErrorScreen, { identityError: app.identityError, profileError: app.profileError });
|
|
85
|
+
}
|
|
86
|
+
// or render splash if web app is still authenticating
|
|
87
|
+
else if (!identity || splashing) {
|
|
88
|
+
contentKey = 'splash';
|
|
89
|
+
content = (0, jsx_runtime_1.jsx)(SplashScreen, {});
|
|
90
|
+
}
|
|
91
|
+
// or render login if anonymous
|
|
92
|
+
else if (!identity.authenticated) {
|
|
93
|
+
contentKey = 'login';
|
|
94
|
+
content = (0, jsx_runtime_1.jsx)(LoginScreen, {});
|
|
95
|
+
}
|
|
96
|
+
// or render page
|
|
97
|
+
else {
|
|
98
|
+
content = children;
|
|
99
|
+
}
|
|
100
|
+
// render
|
|
101
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(head_1.default, { children: (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: "/manifest/favicon.svg" }) }), (0, jsx_runtime_1.jsx)(AppContext_1.AppContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { mode: "wait", children: (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: (0, classnames_1.default)('nd-App will-change-[opacity,filter]', {
|
|
102
|
+
'nd-App-web': !bridge.isNative,
|
|
103
|
+
'nd-App-native': bridge.isNative
|
|
104
|
+
}), initial: "initial", animate: "animate", exit: "exit", variants: {
|
|
105
|
+
initial: { opacity: 0, filter: 'blur(3px)' },
|
|
106
|
+
animate: { opacity: 1, filter: 'blur(0px)' },
|
|
107
|
+
exit: { opacity: 0, filter: 'blur(3px)' }
|
|
108
|
+
}, transition: { duration: 0.2 }, children: content }, contentKey !== null && contentKey !== void 0 ? contentKey : router.pathname) }) })] }));
|
|
109
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BridgeProvider, BridgeState } from '../../bridge/web';
|
|
2
|
+
import { AppContainer } from './AppContainer';
|
|
3
|
+
export declare function AppLayout<TCustom extends BridgeState.Custom = BridgeState.Custom>({ SplashScreen, LoginScreen, ErrorScreen, children, ...bridgeProps }: AppLayout.Props<TCustom>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace AppLayout {
|
|
5
|
+
type ScreenProps = AppContainer.ScreenProps;
|
|
6
|
+
type Props<TCustom extends BridgeState.Custom = BridgeState.Custom> = BridgeProvider.Props<TCustom> & ScreenProps;
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.AppLayout = AppLayout;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
17
|
+
const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
|
|
18
|
+
const react_1 = require("react");
|
|
19
|
+
const web_1 = require("../../bridge/web");
|
|
20
|
+
const web_2 = require("../../content/web");
|
|
21
|
+
const web_3 = require("../../cookies/web");
|
|
22
|
+
const web_4 = require("../../identity/web");
|
|
23
|
+
const web_5 = require("../../profile/web");
|
|
24
|
+
const web_6 = require("../../nav/web");
|
|
25
|
+
const web_7 = require("../../push/web");
|
|
26
|
+
const AppContainer_1 = require("./AppContainer");
|
|
27
|
+
// container
|
|
28
|
+
function AppLayout(_a) {
|
|
29
|
+
var { SplashScreen, LoginScreen, ErrorScreen, children } = _a, bridgeProps = __rest(_a, ["SplashScreen", "LoginScreen", "ErrorScreen", "children"]);
|
|
30
|
+
// bind data + hooks
|
|
31
|
+
const eventBus = (0, react_1.useMemo)(() => new funnel_core_1.EventBus(), []);
|
|
32
|
+
// render
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(web_3.CookieServiceProvider, { eventBus: eventBus, children: (0, jsx_runtime_1.jsx)(web_1.BridgeProvider, Object.assign({}, bridgeProps, { children: (0, jsx_runtime_1.jsx)(web_4.WebIdentityProvider, { children: (0, jsx_runtime_1.jsx)(web_5.WebProfileProvider, { children: (0, jsx_runtime_1.jsx)(web_6.WebSpecProvider, { children: (0, jsx_runtime_1.jsx)(web_2.ContentProvider, { children: (0, jsx_runtime_1.jsx)(web_7.PushProvider, { children: (0, jsx_runtime_1.jsx)(hooks_1.BreakpointContainer, { children: (0, jsx_runtime_1.jsx)(AppContainer_1.AppContainer, { SplashScreen: SplashScreen, LoginScreen: LoginScreen, ErrorScreen: ErrorScreen, eventBus: eventBus, children: children }) }) }) }) }) }) }) })) }));
|
|
34
|
+
}
|