@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,65 @@
|
|
|
1
|
+
import { EventBus } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { JsonValue, StringKeyOf } from 'type-fest';
|
|
4
|
+
import { Identity } from '../../identity/domain';
|
|
5
|
+
export declare abstract class ProfileStore<TData extends ProfileStore.Data = ProfileStore.Data> {
|
|
6
|
+
protected readonly _eventBus: EventBus;
|
|
7
|
+
protected readonly identity: Identity;
|
|
8
|
+
protected _data: TData;
|
|
9
|
+
protected readonly _edits: Map<ProfileStore.Data.Key<TData>, TData[keyof TData]>;
|
|
10
|
+
protected readonly _deletes: Set<ProfileStore.Data.Key<TData>>;
|
|
11
|
+
protected constructor(args: ProfileStore.ConstructorArgs<TData>);
|
|
12
|
+
get events$(): Observable<ProfileStore.Event>;
|
|
13
|
+
get modified(): boolean;
|
|
14
|
+
get id(): string;
|
|
15
|
+
get profileId(): string;
|
|
16
|
+
get data(): Partial<Omit<TData, ProfileStore.Data.ExcludedProps>>;
|
|
17
|
+
get<K extends ProfileStore.Data.Key<TData>>(key: K): TData[K] | undefined;
|
|
18
|
+
set<K extends ProfileStore.Data.Key<TData>>(key: K, value: TData[K]): this;
|
|
19
|
+
delete<K extends ProfileStore.Data.Key<TData>>(key: K): this;
|
|
20
|
+
clear(): this;
|
|
21
|
+
importChanges({ id, profileId, updates, deletes }: ProfileStore.Data.Changes<TData>): void;
|
|
22
|
+
exportChanges(): ProfileStore.Data.Changes<TData>;
|
|
23
|
+
reset(data?: TData): void;
|
|
24
|
+
abstract save(): Promise<void>;
|
|
25
|
+
toData(): TData;
|
|
26
|
+
toJSON(): any;
|
|
27
|
+
toString(): string;
|
|
28
|
+
protected raiseEvent(type: ProfileStore.Event.Type): void;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace ProfileStore {
|
|
31
|
+
type Data<TId extends string = string, TCustomData extends Data.CustomData = Data.CustomData> = Partial<TCustomData> & {
|
|
32
|
+
__internals?: JsonValue;
|
|
33
|
+
id: TId;
|
|
34
|
+
profileId: string;
|
|
35
|
+
};
|
|
36
|
+
namespace Data {
|
|
37
|
+
type CustomData = Omit<Record<string, JsonValue>, ExcludedProps>;
|
|
38
|
+
type Key<TData extends Data> = StringKeyOf<Omit<TData, ExcludedProps>>;
|
|
39
|
+
type ExcludedProps = '__internals' | 'id' | 'profileId';
|
|
40
|
+
type Changes<TData extends Data = Data> = {
|
|
41
|
+
id: string;
|
|
42
|
+
profileId: string;
|
|
43
|
+
updates: Partial<Omit<TData, ExcludedProps>>;
|
|
44
|
+
deletes: Key<TData>[];
|
|
45
|
+
};
|
|
46
|
+
type Spec<TId extends string = string, TData extends CustomData = CustomData> = {
|
|
47
|
+
id: TId;
|
|
48
|
+
} & TData;
|
|
49
|
+
type For<TSpec extends Spec> = Data<Spec['id'], Omit<TSpec, 'id'>>;
|
|
50
|
+
}
|
|
51
|
+
type For<TSpec extends Data.Spec> = ProfileStore<Data.For<TSpec>>;
|
|
52
|
+
type ConstructorArgs<TData extends Data> = {
|
|
53
|
+
eventBus: EventBus;
|
|
54
|
+
identity: Identity;
|
|
55
|
+
data: TData;
|
|
56
|
+
};
|
|
57
|
+
interface Event extends EventBus.Event<'ProfileStore', Event.Type> {
|
|
58
|
+
store: ProfileStore;
|
|
59
|
+
}
|
|
60
|
+
namespace Event {
|
|
61
|
+
type Type = 'modified' | 'saved' | 'reset';
|
|
62
|
+
function filter(event: EventBus.Event): event is Event;
|
|
63
|
+
function create(event: EventBus.Args<Event>): Event;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
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.ProfileStore = void 0;
|
|
15
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
16
|
+
const rxjs_1 = require("rxjs");
|
|
17
|
+
// class
|
|
18
|
+
class ProfileStore {
|
|
19
|
+
constructor(args) {
|
|
20
|
+
// initialize instance variables
|
|
21
|
+
this._eventBus = args.eventBus;
|
|
22
|
+
this.identity = args.identity;
|
|
23
|
+
this._data = args.data;
|
|
24
|
+
this._edits = new Map();
|
|
25
|
+
this._deletes = new Set();
|
|
26
|
+
}
|
|
27
|
+
get events$() {
|
|
28
|
+
return this._eventBus.events$.pipe((0, rxjs_1.filter)(e => ProfileStore.Event.filter(e)), (0, rxjs_1.filter)(e => e.store === this));
|
|
29
|
+
}
|
|
30
|
+
get modified() {
|
|
31
|
+
return this._edits.size > 0 || this._deletes.size > 0;
|
|
32
|
+
}
|
|
33
|
+
get id() {
|
|
34
|
+
return this._data.id;
|
|
35
|
+
}
|
|
36
|
+
get profileId() {
|
|
37
|
+
return this._data.profileId;
|
|
38
|
+
}
|
|
39
|
+
get data() {
|
|
40
|
+
const _a = this._data, { __internals, id, profileId } = _a, data = __rest(_a, ["__internals", "id", "profileId"]);
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
get(key) {
|
|
44
|
+
const { _edits, _deletes, _data } = this;
|
|
45
|
+
return _deletes.has(key)
|
|
46
|
+
? undefined
|
|
47
|
+
: _edits.has(key)
|
|
48
|
+
? _edits.get(key)
|
|
49
|
+
: _data[key];
|
|
50
|
+
}
|
|
51
|
+
set(key, value) {
|
|
52
|
+
// update
|
|
53
|
+
this._edits.set(key, value);
|
|
54
|
+
this._deletes.delete(key);
|
|
55
|
+
// raise event
|
|
56
|
+
this.raiseEvent('modified');
|
|
57
|
+
// chain
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
delete(key) {
|
|
61
|
+
// or delete it
|
|
62
|
+
this._edits.delete(key);
|
|
63
|
+
this._deletes.add(key);
|
|
64
|
+
// raise event
|
|
65
|
+
this.raiseEvent('modified');
|
|
66
|
+
// chain
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
clear() {
|
|
70
|
+
// clear current edits and deletes
|
|
71
|
+
this._edits.clear();
|
|
72
|
+
this._deletes.clear();
|
|
73
|
+
// loop over data and remove each custom key
|
|
74
|
+
for (const key in this._data) {
|
|
75
|
+
// skip if preserved key
|
|
76
|
+
if (key === 'id' || key === 'profileId') {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
// add to deletes and remove data
|
|
80
|
+
this._deletes.add(key);
|
|
81
|
+
delete this._data[key];
|
|
82
|
+
}
|
|
83
|
+
// raise event
|
|
84
|
+
this.raiseEvent('modified');
|
|
85
|
+
// chain
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
importChanges({ id, profileId, updates, deletes }) {
|
|
89
|
+
// ensure we aren't updating the wrong profile
|
|
90
|
+
const { _edits, _deletes, modified } = this;
|
|
91
|
+
if (this.id !== id || this.profileId !== profileId) {
|
|
92
|
+
throw new funnel_core_1.InvalidOperationError(`Cannot import cross-store changes (received ${profileId}/${id}, expected ${this.profileId}/${this.id})`);
|
|
93
|
+
}
|
|
94
|
+
// throw if there are already changes
|
|
95
|
+
if (modified) {
|
|
96
|
+
throw new funnel_core_1.InvalidOperationError('Cannot import to an already modified store');
|
|
97
|
+
}
|
|
98
|
+
// apply edits
|
|
99
|
+
Object.entries(updates).forEach(([key, value]) => _edits.set(key, value));
|
|
100
|
+
// apply deletes
|
|
101
|
+
deletes.forEach(key => _deletes.add(key));
|
|
102
|
+
// raise event
|
|
103
|
+
this.raiseEvent('modified');
|
|
104
|
+
}
|
|
105
|
+
exportChanges() {
|
|
106
|
+
// create base
|
|
107
|
+
const { id, profileId, _edits, _deletes } = this;
|
|
108
|
+
const changes = {
|
|
109
|
+
id,
|
|
110
|
+
profileId,
|
|
111
|
+
updates: {},
|
|
112
|
+
deletes: []
|
|
113
|
+
};
|
|
114
|
+
// apply updates
|
|
115
|
+
_edits.forEach((value, key) => {
|
|
116
|
+
changes.updates[key] = value;
|
|
117
|
+
});
|
|
118
|
+
// apply deletes
|
|
119
|
+
_deletes.forEach(key => {
|
|
120
|
+
changes.deletes.push(key);
|
|
121
|
+
});
|
|
122
|
+
// return changes
|
|
123
|
+
return changes;
|
|
124
|
+
}
|
|
125
|
+
reset(data) {
|
|
126
|
+
// reset fields
|
|
127
|
+
this._edits.clear();
|
|
128
|
+
this._deletes.clear();
|
|
129
|
+
// replace data (if required)
|
|
130
|
+
if (data) {
|
|
131
|
+
this._data = data;
|
|
132
|
+
}
|
|
133
|
+
// raise event
|
|
134
|
+
this.raiseEvent('reset');
|
|
135
|
+
}
|
|
136
|
+
toData() {
|
|
137
|
+
// just return data if modified
|
|
138
|
+
const { modified, _data, _edits, _deletes } = this;
|
|
139
|
+
if (!modified) {
|
|
140
|
+
return _data;
|
|
141
|
+
}
|
|
142
|
+
// serialize data with changes
|
|
143
|
+
const data = Object.assign({}, _data);
|
|
144
|
+
// override any edits
|
|
145
|
+
_edits.forEach((value, key) => {
|
|
146
|
+
data[key] = value;
|
|
147
|
+
});
|
|
148
|
+
// clear any deletes
|
|
149
|
+
_deletes.forEach((key) => {
|
|
150
|
+
delete data[key];
|
|
151
|
+
});
|
|
152
|
+
// return data
|
|
153
|
+
return data;
|
|
154
|
+
}
|
|
155
|
+
toJSON() {
|
|
156
|
+
return JSON.parse(JSON.stringify(this.toData()));
|
|
157
|
+
}
|
|
158
|
+
toString() {
|
|
159
|
+
return `${this.constructor.name}: ${this.profileId}/${this.id}`;
|
|
160
|
+
}
|
|
161
|
+
raiseEvent(type) {
|
|
162
|
+
this._eventBus.publish(ProfileStore.Event.create({ type, store: this }));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.ProfileStore = ProfileStore;
|
|
166
|
+
// extension
|
|
167
|
+
(function (ProfileStore) {
|
|
168
|
+
let Event;
|
|
169
|
+
(function (Event) {
|
|
170
|
+
// methods
|
|
171
|
+
function filter(event) {
|
|
172
|
+
return event.domain === 'ProfileStore';
|
|
173
|
+
}
|
|
174
|
+
Event.filter = filter;
|
|
175
|
+
function create(event) {
|
|
176
|
+
return funnel_core_1.EventBus.createEvent(Object.assign({ domain: 'ProfileStore' }, event));
|
|
177
|
+
}
|
|
178
|
+
Event.create = create;
|
|
179
|
+
})(Event = ProfileStore.Event || (ProfileStore.Event = {}));
|
|
180
|
+
})(ProfileStore || (exports.ProfileStore = ProfileStore = {}));
|
|
@@ -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("./Profile"), exports);
|
|
18
|
+
__exportStar(require("./ProfileAppRequest"), exports);
|
|
19
|
+
__exportStar(require("./ProfileStore"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import { JsonValue } from 'type-fest';
|
|
3
|
+
import { AbstractAppService } from '../../app/server/AbstractAppService';
|
|
4
|
+
import { Identity } from '../../identity/domain';
|
|
5
|
+
import { ProfileAppRequest } from '../domain';
|
|
6
|
+
import { ProfileUserService } from './ProfileUserService';
|
|
7
|
+
export declare class ProfileAppService extends AbstractAppService<ProfileAppRequest> {
|
|
8
|
+
private readonly _userService;
|
|
9
|
+
constructor(_userService: ProfileUserService);
|
|
10
|
+
onExecute(request: ProfileAppRequest, identity?: Identity): Promise<JsonValue>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfileAppService = void 0;
|
|
4
|
+
require("server-only");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const AbstractAppService_1 = require("../../app/server/AbstractAppService");
|
|
7
|
+
// service
|
|
8
|
+
class ProfileAppService extends AbstractAppService_1.AbstractAppService {
|
|
9
|
+
constructor(_userService) {
|
|
10
|
+
// construct base
|
|
11
|
+
super({
|
|
12
|
+
id: '_nd-profile',
|
|
13
|
+
name: 'Profile Service'
|
|
14
|
+
});
|
|
15
|
+
this._userService = _userService;
|
|
16
|
+
}
|
|
17
|
+
async onExecute(request, identity) {
|
|
18
|
+
// throw if not authenticated
|
|
19
|
+
if (!identity) {
|
|
20
|
+
throw new funnel_core_1.NotAuthenticatedError();
|
|
21
|
+
}
|
|
22
|
+
// fetch profile
|
|
23
|
+
const profile = await this._userService.getProfile(identity);
|
|
24
|
+
// handle methods
|
|
25
|
+
switch (request.method) {
|
|
26
|
+
case 'profile.get': {
|
|
27
|
+
console.debug('[ProfileAppService] getting data', request);
|
|
28
|
+
return profile.toData();
|
|
29
|
+
}
|
|
30
|
+
case 'profile.update': {
|
|
31
|
+
console.debug('[ProfileAppService] setting data key value', request);
|
|
32
|
+
profile.importChanges(request.data);
|
|
33
|
+
await profile.save();
|
|
34
|
+
return profile.toData();
|
|
35
|
+
}
|
|
36
|
+
case 'store.update': {
|
|
37
|
+
console.debug('[ProfileAppService] delete data key value', request);
|
|
38
|
+
const changes = request.data;
|
|
39
|
+
const store = profile.getStore(changes.id);
|
|
40
|
+
store.importChanges(changes);
|
|
41
|
+
await store.save();
|
|
42
|
+
return store.toData();
|
|
43
|
+
}
|
|
44
|
+
default:
|
|
45
|
+
throw new funnel_core_1.InvalidOperationError(`Unrecognized ${this.name} method`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.ProfileAppService = ProfileAppService;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import type { Pagination } from '@nascentdigital/funnel-cms';
|
|
3
|
+
import type { Profile } from '../domain';
|
|
4
|
+
export interface ProfileManagementService {
|
|
5
|
+
get(args: ProfileManagementService.Get.Args): Promise<ProfileManagementService.Get.Result>;
|
|
6
|
+
find(args?: ProfileManagementService.Find.Args): Promise<ProfileManagementService.Find.Result>;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace ProfileManagementService {
|
|
9
|
+
type WithPagination = {
|
|
10
|
+
pagination: Pagination.Paging;
|
|
11
|
+
};
|
|
12
|
+
export namespace Get {
|
|
13
|
+
type Args = {
|
|
14
|
+
id?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
};
|
|
17
|
+
type Result = Profile | undefined;
|
|
18
|
+
}
|
|
19
|
+
export namespace Find {
|
|
20
|
+
type Args = Partial<WithPagination> & Partial<Profile.Data.Core>;
|
|
21
|
+
interface PaginatedIterator<T> extends Pagination.Paginated<T> {
|
|
22
|
+
nextPage(): Promise<void>;
|
|
23
|
+
hasNextPage: boolean;
|
|
24
|
+
}
|
|
25
|
+
type Result = PaginatedIterator<Profile>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import { ProfileManagementService } from './ProfileManagementService';
|
|
3
|
+
import { ProfileUserService } from './ProfileUserService';
|
|
4
|
+
export interface ProfileServices {
|
|
5
|
+
/**
|
|
6
|
+
* Returns an authenticated {@link ProfileManagementService} for usage as a service account.
|
|
7
|
+
* This account should never be used for handling user requests, since it has full
|
|
8
|
+
* access and privileges.
|
|
9
|
+
*
|
|
10
|
+
* This instance is typically shared.
|
|
11
|
+
*/
|
|
12
|
+
getManagementService(): ProfileManagementService;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a new {@link ProfileUserService} that will be exposed as an {@link AppService} for proxying actions on
|
|
15
|
+
* behalf of a user. This client should be stateless, since it will be used for handling multiple user requests.
|
|
16
|
+
*/
|
|
17
|
+
getUserService(): ProfileUserService;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace ProfileServices {
|
|
20
|
+
function get(): ProfileServices;
|
|
21
|
+
function set(factory: ProfileServices): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfileServices = void 0;
|
|
4
|
+
require("server-only");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
// extension
|
|
7
|
+
var ProfileServices;
|
|
8
|
+
(function (ProfileServices) {
|
|
9
|
+
// methods
|
|
10
|
+
function get() {
|
|
11
|
+
// throw if config isn't bound
|
|
12
|
+
if (!_factory) {
|
|
13
|
+
throw new funnel_core_1.IllegalStateError('Attempt to access ProfileServiceFactory before first call to ProfileServiceFactory.set()');
|
|
14
|
+
}
|
|
15
|
+
return _factory;
|
|
16
|
+
}
|
|
17
|
+
ProfileServices.get = get;
|
|
18
|
+
function set(factory) {
|
|
19
|
+
_factory = factory;
|
|
20
|
+
}
|
|
21
|
+
ProfileServices.set = set;
|
|
22
|
+
})(ProfileServices || (exports.ProfileServices = ProfileServices = {}));
|
|
23
|
+
// storage
|
|
24
|
+
let _factory = undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
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("../domain"), exports);
|
|
18
|
+
__exportStar(require("./ProfileAppService"), exports);
|
|
19
|
+
__exportStar(require("./ProfileManagementService"), exports);
|
|
20
|
+
__exportStar(require("./ProfileServices"), exports);
|
|
21
|
+
__exportStar(require("./ProfileUserService"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StringKeyOf } from 'type-fest';
|
|
2
|
+
import { Profile } from '../domain';
|
|
3
|
+
import { WebProfileStore } from './WebProfileStore';
|
|
4
|
+
export declare class WebProfile<TStores extends Profile.Stores = Profile.Stores> extends Profile<TStores> {
|
|
5
|
+
constructor(args: WebProfile.ConstructorArgs<TStores>);
|
|
6
|
+
protected createStore(id: StringKeyOf<TStores>): WebProfileStore;
|
|
7
|
+
save(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace WebProfile {
|
|
10
|
+
type ConstructorArgs<TStores extends Profile.Stores> = Profile.ConstructorArgs<TStores>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebProfile = void 0;
|
|
4
|
+
const web_1 = require("../../app/web");
|
|
5
|
+
const domain_1 = require("../../identity/domain");
|
|
6
|
+
const domain_2 = require("../domain");
|
|
7
|
+
const WebProfileStore_1 = require("./WebProfileStore");
|
|
8
|
+
// class
|
|
9
|
+
class WebProfile extends domain_2.Profile {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
// construct base
|
|
12
|
+
super(args);
|
|
13
|
+
}
|
|
14
|
+
createStore(id) {
|
|
15
|
+
const { _eventBus, identity, id: profileId } = this;
|
|
16
|
+
return new WebProfileStore_1.WebProfileStore({ eventBus: _eventBus, identity, data: { id, profileId } });
|
|
17
|
+
}
|
|
18
|
+
async save() {
|
|
19
|
+
// get props
|
|
20
|
+
const { identity } = this;
|
|
21
|
+
const changes = this.exportChanges();
|
|
22
|
+
// push update
|
|
23
|
+
const update = await web_1.AppServiceClient.post({
|
|
24
|
+
apiToken: identity instanceof domain_1.AuthenticatedIdentity
|
|
25
|
+
? identity.apiToken
|
|
26
|
+
: undefined,
|
|
27
|
+
id: '_nd-profile',
|
|
28
|
+
method: 'profile.update',
|
|
29
|
+
data: JSON.parse(JSON.stringify(changes))
|
|
30
|
+
});
|
|
31
|
+
// reset to latest
|
|
32
|
+
this.reset(update);
|
|
33
|
+
// raise event
|
|
34
|
+
this.raiseEvent('saved');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.WebProfile = WebProfile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnonymousIdentity, AuthenticatedIdentity } from '../../identity/domain';
|
|
2
|
+
import { AbstractProfileClient } from '../core';
|
|
3
|
+
import type { Profile } from '../domain';
|
|
4
|
+
import { WebProfile } from './WebProfile';
|
|
5
|
+
export declare class WebProfileClient extends AbstractProfileClient {
|
|
6
|
+
constructor();
|
|
7
|
+
sync(identity: AuthenticatedIdentity | AnonymousIdentity): Promise<WebProfile | null>;
|
|
8
|
+
hydrate(identity: AuthenticatedIdentity | AnonymousIdentity, { __stores, ...data }: Profile.Data): Promise<WebProfile>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.WebProfileClient = void 0;
|
|
15
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
16
|
+
const web_1 = require("../../app/web");
|
|
17
|
+
const domain_1 = require("../../identity/domain");
|
|
18
|
+
const core_1 = require("../core");
|
|
19
|
+
const WebProfile_1 = require("./WebProfile");
|
|
20
|
+
const WebProfileStore_1 = require("./WebProfileStore");
|
|
21
|
+
// class
|
|
22
|
+
class WebProfileClient extends core_1.AbstractProfileClient {
|
|
23
|
+
constructor() {
|
|
24
|
+
// construct base
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
async sync(identity) {
|
|
28
|
+
// skip if anonymous
|
|
29
|
+
if (identity instanceof domain_1.AnonymousIdentity) {
|
|
30
|
+
this.profile = null;
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
// fetch profile data
|
|
34
|
+
try {
|
|
35
|
+
const data = await web_1.AppServiceClient.post({
|
|
36
|
+
apiToken: identity.apiToken,
|
|
37
|
+
id: '_nd-profile',
|
|
38
|
+
method: 'profile.get',
|
|
39
|
+
data: null
|
|
40
|
+
});
|
|
41
|
+
const spec = await web_1.AppServiceClient.post({
|
|
42
|
+
apiToken: identity.apiToken,
|
|
43
|
+
id: '_nd-nav',
|
|
44
|
+
method: 'getSpec',
|
|
45
|
+
data: null
|
|
46
|
+
});
|
|
47
|
+
console.debug('[WebProfileClient] fetched spec', spec);
|
|
48
|
+
// set initial profile instance
|
|
49
|
+
return this.hydrate(identity, data);
|
|
50
|
+
}
|
|
51
|
+
// logout if not authenticated
|
|
52
|
+
catch (e) {
|
|
53
|
+
console.error('[WebProfileClient] failed to get profile', e);
|
|
54
|
+
this.profile = null;
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async hydrate(identity, _a) {
|
|
59
|
+
var { __stores } = _a, data = __rest(_a, ["__stores"]);
|
|
60
|
+
// create profile
|
|
61
|
+
const eventBus = new funnel_core_1.EventBus();
|
|
62
|
+
const profile = new WebProfile_1.WebProfile(Object.assign(Object.assign({}, data), { eventBus,
|
|
63
|
+
identity, stores: (__stores !== null && __stores !== void 0 ? __stores : []).reduce((stores, data) => {
|
|
64
|
+
// transform store and bind it
|
|
65
|
+
const store = new WebProfileStore_1.WebProfileStore({ eventBus, identity, data });
|
|
66
|
+
stores[store.id] = store;
|
|
67
|
+
// keep reducing
|
|
68
|
+
return stores;
|
|
69
|
+
}, {}) }));
|
|
70
|
+
// bind it
|
|
71
|
+
this.profile = profile;
|
|
72
|
+
// and return it
|
|
73
|
+
return profile;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.WebProfileClient = WebProfileClient;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebProfileProvider = WebProfileProvider;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const web_1 = require("../../bridge/web");
|
|
8
|
+
const core_1 = require("../../identity/core");
|
|
9
|
+
const core_2 = require("../core");
|
|
10
|
+
const WebProfileClient_1 = require("./WebProfileClient");
|
|
11
|
+
// container
|
|
12
|
+
function WebProfileProvider({ children }) {
|
|
13
|
+
// bind hooks + context
|
|
14
|
+
const profileClient = (0, react_1.useMemo)(() => new WebProfileClient_1.WebProfileClient(), []);
|
|
15
|
+
const context = (0, react_1.useMemo)(() => ({ profileClient }), [profileClient]);
|
|
16
|
+
const bridge = (0, web_1.useBridge)();
|
|
17
|
+
const { isNative, connected } = bridge;
|
|
18
|
+
const { profileData } = bridge.state;
|
|
19
|
+
const { identity } = (0, core_1.useIdentity)();
|
|
20
|
+
const identityClient = (0, core_1.useIdentityClient)();
|
|
21
|
+
const identityClientRef = (0, react_1.useRef)(identityClient);
|
|
22
|
+
identityClientRef.current = identityClient;
|
|
23
|
+
// sync context when identity changes
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
// ignore if there's no identity
|
|
26
|
+
if (!identity) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// or ignore if waiting for native bridge to bind
|
|
30
|
+
else if (isNative && !connected) {
|
|
31
|
+
console.debug('[WebProfileProvider] waiting for native bridge to bind');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// leverage bridge if there's existing profile data
|
|
35
|
+
if (isNative && profileData) {
|
|
36
|
+
console.debug('[WebProfileProvider] leveraging existing profile from bridge');
|
|
37
|
+
profileClient
|
|
38
|
+
.hydrate(identity, profileData)
|
|
39
|
+
.catch(e => console.error('[WebProfileProvider] failed to hydrate profile', e));
|
|
40
|
+
}
|
|
41
|
+
// or sync directly if not native
|
|
42
|
+
else {
|
|
43
|
+
console.debug('[WebProfileProvider] fetching fresh profile for identity', identity);
|
|
44
|
+
// sync profile
|
|
45
|
+
profileClient.sync(identity)
|
|
46
|
+
// propagate profile back to native (if required)
|
|
47
|
+
.then(profile => {
|
|
48
|
+
if (isNative) {
|
|
49
|
+
bridge.setState('profileData', profile ? JSON.parse(JSON.stringify(profile.toData())) : null);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
// or handle error
|
|
53
|
+
.catch(e => {
|
|
54
|
+
if (e instanceof funnel_core_1.NotAuthenticatedError) {
|
|
55
|
+
identityClientRef.current.logout();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, [bridge, profileClient, identity, isNative, connected, profileData]);
|
|
60
|
+
// render
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(core_2.ProfileClientContext.Provider, { value: context, children: children }));
|
|
62
|
+
}
|