@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,8 @@
|
|
|
1
|
+
import { ProfileStore } from '../domain';
|
|
2
|
+
export declare class WebProfileStore<TData extends ProfileStore.Data = ProfileStore.Data> extends ProfileStore<TData> {
|
|
3
|
+
constructor(args: WebProfileStore.ConstructorArgs<TData>);
|
|
4
|
+
save(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace WebProfileStore {
|
|
7
|
+
type ConstructorArgs<TData extends ProfileStore.Data> = ProfileStore.ConstructorArgs<TData>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebProfileStore = void 0;
|
|
4
|
+
const web_1 = require("../../app/web");
|
|
5
|
+
const domain_1 = require("../../identity/domain");
|
|
6
|
+
const domain_2 = require("../domain");
|
|
7
|
+
// class
|
|
8
|
+
class WebProfileStore extends domain_2.ProfileStore {
|
|
9
|
+
constructor(args) {
|
|
10
|
+
// construct base
|
|
11
|
+
super(args);
|
|
12
|
+
}
|
|
13
|
+
async save() {
|
|
14
|
+
// get props
|
|
15
|
+
const { identity } = this;
|
|
16
|
+
const changes = this.exportChanges();
|
|
17
|
+
// push update
|
|
18
|
+
const update = await web_1.AppServiceClient.post({
|
|
19
|
+
apiToken: identity instanceof domain_1.AuthenticatedIdentity
|
|
20
|
+
? identity.apiToken
|
|
21
|
+
: undefined,
|
|
22
|
+
id: '_nd-profile',
|
|
23
|
+
method: 'store.update',
|
|
24
|
+
data: JSON.parse(JSON.stringify(changes))
|
|
25
|
+
});
|
|
26
|
+
// reset to latest
|
|
27
|
+
this.reset(update);
|
|
28
|
+
// raise event
|
|
29
|
+
this.raiseEvent('saved');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.WebProfileStore = WebProfileStore;
|
|
@@ -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("../domain"), exports);
|
|
18
|
+
__exportStar(require("../core"), exports);
|
|
19
|
+
__exportStar(require("./WebProfileProvider"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Jsonify } from 'type-fest';
|
|
2
|
+
import type { AppService } from '../../app/domain';
|
|
3
|
+
export type PushAppRequest = PushAppRequest.SubscribeWeb | PushAppRequest.SubscribeExpo | PushAppRequest.Unsubscribe;
|
|
4
|
+
export declare namespace PushAppRequest {
|
|
5
|
+
const appId: "_nd-push";
|
|
6
|
+
type AppId = typeof appId;
|
|
7
|
+
type SubscribeWeb = AppService.Request<AppId, typeof SubscribeWebMethod, Jsonify<PushSubscriptionJSON>>;
|
|
8
|
+
const SubscribeWebMethod: "subscribe.web";
|
|
9
|
+
type SubscribeExpo = AppService.Request<AppId, typeof SubscribeExpoMethod, string>;
|
|
10
|
+
const SubscribeExpoMethod: "subscribe.expo";
|
|
11
|
+
type Unsubscribe = AppService.Request<AppId, typeof UnsubscribeMethod, null>;
|
|
12
|
+
const UnsubscribeMethod: "unsubscribe";
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushAppRequest = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var PushAppRequest;
|
|
6
|
+
(function (PushAppRequest) {
|
|
7
|
+
// app id
|
|
8
|
+
PushAppRequest.appId = '_nd-push';
|
|
9
|
+
PushAppRequest.SubscribeWebMethod = 'subscribe.web';
|
|
10
|
+
PushAppRequest.SubscribeExpoMethod = 'subscribe.expo';
|
|
11
|
+
PushAppRequest.UnsubscribeMethod = 'unsubscribe';
|
|
12
|
+
})(PushAppRequest || (exports.PushAppRequest = PushAppRequest = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./PushAppRequest"), exports);
|
|
18
|
+
__exportStar(require("./PushStore"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonValue } from 'type-fest';
|
|
2
|
+
import { AbstractAppService } from '../../app/server';
|
|
3
|
+
import { Identity } from '../../identity/domain';
|
|
4
|
+
import { PushAppRequest } from '../domain';
|
|
5
|
+
export declare class PushService extends AbstractAppService<PushAppRequest> {
|
|
6
|
+
private readonly mailto;
|
|
7
|
+
private readonly vapIdKey;
|
|
8
|
+
private readonly vapIdSecret;
|
|
9
|
+
constructor(args: PushService.ConstructorArgs);
|
|
10
|
+
onExecute(request: PushAppRequest, identity?: Identity): Promise<JsonValue>;
|
|
11
|
+
private onSubscribeWeb;
|
|
12
|
+
private onSubscribeExpo;
|
|
13
|
+
private onUnsubscribe;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace PushService {
|
|
16
|
+
const subscriptionKey = "push_subId";
|
|
17
|
+
type ConstructorArgs = {
|
|
18
|
+
mailto: string;
|
|
19
|
+
vapIdKey: string;
|
|
20
|
+
vapIdSecret: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushService = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const server_1 = require("../../app/server");
|
|
6
|
+
const domain_1 = require("../../identity/domain");
|
|
7
|
+
// service
|
|
8
|
+
class PushService extends server_1.AbstractAppService {
|
|
9
|
+
constructor(args) {
|
|
10
|
+
// construct base
|
|
11
|
+
super({
|
|
12
|
+
id: '_nd-push',
|
|
13
|
+
name: 'Push Service'
|
|
14
|
+
});
|
|
15
|
+
// initialize instance variables
|
|
16
|
+
this.mailto = args.mailto;
|
|
17
|
+
this.vapIdKey = args.vapIdKey;
|
|
18
|
+
this.vapIdSecret = args.vapIdSecret;
|
|
19
|
+
}
|
|
20
|
+
async onExecute(request, identity) {
|
|
21
|
+
// throw if not authenticated
|
|
22
|
+
if (!(identity instanceof domain_1.AuthenticatedIdentity)) {
|
|
23
|
+
throw new funnel_core_1.NotAuthenticatedError();
|
|
24
|
+
}
|
|
25
|
+
// handle subscribe
|
|
26
|
+
switch (request.method) {
|
|
27
|
+
case 'subscribe.web':
|
|
28
|
+
return this.onSubscribeWeb(identity, request);
|
|
29
|
+
case 'subscribe.expo':
|
|
30
|
+
return this.onSubscribeExpo(identity, request);
|
|
31
|
+
case 'unsubscribe':
|
|
32
|
+
return this.onUnsubscribe(identity);
|
|
33
|
+
default:
|
|
34
|
+
throw new funnel_core_1.InvalidOperationError(`Unrecognized PushService request`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async onSubscribeWeb(identity, { data }) {
|
|
38
|
+
console.debug(`[PushService/onSubscribe] registering push for "${identity.id}"`, data);
|
|
39
|
+
// TODO: set subscription
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
async onSubscribeExpo(identity, { data }) {
|
|
43
|
+
console.debug(`[PushService/onSubscribeNative] registering push for "${identity.id}"`, data);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
async onUnsubscribe(identity) {
|
|
47
|
+
console.debug(`[PushService/onUnsubscribe] unregistering push for "${identity.id}"`);
|
|
48
|
+
// TODO: delete subscription
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PushService = PushService;
|
|
53
|
+
// extension
|
|
54
|
+
(function (PushService) {
|
|
55
|
+
// constants
|
|
56
|
+
PushService.subscriptionKey = 'push_subId';
|
|
57
|
+
})(PushService || (exports.PushService = PushService = {}));
|
|
@@ -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
|
+
require("server-only");
|
|
18
|
+
__exportStar(require("../domain"), exports);
|
|
19
|
+
__exportStar(require("./PushService"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const web_push_1 = __importDefault(require("web-push"));
|
|
7
|
+
// generate a keypair
|
|
8
|
+
console.debug('[Push/keygen] generated web-push keys', web_push_1.default.generateVAPIDKeys());
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class PushClient implements PushClient.Type {
|
|
3
|
+
readonly vapIdKey: string;
|
|
4
|
+
private readonly _state$;
|
|
5
|
+
private readonly _subscription$;
|
|
6
|
+
constructor({ vapIdKey }: PushClient.Args);
|
|
7
|
+
get state$(): Observable<PushClient.State>;
|
|
8
|
+
get state(): PushClient.State;
|
|
9
|
+
private set state(value);
|
|
10
|
+
get subscription$(): Observable<PushSubscription | null | undefined>;
|
|
11
|
+
get subscription(): PushSubscription | null | undefined;
|
|
12
|
+
private set subscription(value);
|
|
13
|
+
private isBlocked;
|
|
14
|
+
initialize(): Promise<void>;
|
|
15
|
+
subscribe(): Promise<void>;
|
|
16
|
+
unsubscribe(): Promise<void>;
|
|
17
|
+
toJSON(): {
|
|
18
|
+
class: string;
|
|
19
|
+
vapIdKey: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare namespace PushClient {
|
|
23
|
+
type Args = {
|
|
24
|
+
vapIdKey: string;
|
|
25
|
+
};
|
|
26
|
+
interface Type {
|
|
27
|
+
readonly state$: Observable<State>;
|
|
28
|
+
readonly state: State;
|
|
29
|
+
readonly subscription$: Observable<PushSubscription | null | undefined>;
|
|
30
|
+
readonly subscription: PushSubscription | null | undefined;
|
|
31
|
+
subscribe(): Promise<void>;
|
|
32
|
+
unsubscribe(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
type State = 'uninitialized' | 'initializing' | 'ready' | 'updating' | 'error.unsupported' | 'error.blocked' | 'error.initialize';
|
|
35
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushClient = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
6
|
+
const AppServiceClient_1 = require("../../app/domain/AppServiceClient");
|
|
7
|
+
// client
|
|
8
|
+
class PushClient {
|
|
9
|
+
constructor({ vapIdKey }) {
|
|
10
|
+
// initialize instance variables
|
|
11
|
+
this.vapIdKey = vapIdKey;
|
|
12
|
+
this._state$ = new rxjs_1.BehaviorSubject('uninitialized');
|
|
13
|
+
this._subscription$ = new rxjs_1.BehaviorSubject(undefined);
|
|
14
|
+
}
|
|
15
|
+
get state$() {
|
|
16
|
+
return this._state$.asObservable();
|
|
17
|
+
}
|
|
18
|
+
get state() {
|
|
19
|
+
return this._state$.getValue();
|
|
20
|
+
}
|
|
21
|
+
set state(state) {
|
|
22
|
+
// update only if changed
|
|
23
|
+
if (state !== this.state) {
|
|
24
|
+
this._state$.next(state);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
get subscription$() {
|
|
28
|
+
return this._subscription$.asObservable();
|
|
29
|
+
}
|
|
30
|
+
get subscription() {
|
|
31
|
+
return this._subscription$.getValue();
|
|
32
|
+
}
|
|
33
|
+
set subscription(subscription) {
|
|
34
|
+
this._subscription$.next(subscription);
|
|
35
|
+
}
|
|
36
|
+
async isBlocked() {
|
|
37
|
+
if (!funnel_core_1.Browser.available) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
// use permissions query (best case)
|
|
41
|
+
if ('permissions' in navigator) {
|
|
42
|
+
try {
|
|
43
|
+
const query = await navigator.permissions.query({ name: 'push', userVisibleOnly: true });
|
|
44
|
+
return query.state === 'denied';
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
return Notification.permission === 'denied';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// or fallback
|
|
51
|
+
else {
|
|
52
|
+
return Notification.permission === 'denied';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async initialize() {
|
|
56
|
+
// ignore if not uninitialized
|
|
57
|
+
if (this.state !== 'uninitialized') {
|
|
58
|
+
console.warn('[PushClient] ignoring redundant initialize()');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// mark unsupported if not available in browser
|
|
62
|
+
if (!funnel_core_1.Browser.available || !('serviceWorker' in navigator) || !('PushManager' in window)) {
|
|
63
|
+
this.state = 'error.unsupported';
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// try to initialize
|
|
67
|
+
try {
|
|
68
|
+
// mark initializing
|
|
69
|
+
this.state = 'initializing';
|
|
70
|
+
// register service worker
|
|
71
|
+
const registration = await navigator.serviceWorker
|
|
72
|
+
.register('/push.js', { scope: '/', updateViaCache: 'none' });
|
|
73
|
+
console.debug(`[PushClient] registered service worker with "${registration.scope}" scope`);
|
|
74
|
+
// stop if blocked
|
|
75
|
+
const blocked = await this.isBlocked();
|
|
76
|
+
if (blocked) {
|
|
77
|
+
this.state = 'error.blocked';
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// bind subscription
|
|
81
|
+
this.subscription = await registration.pushManager.getSubscription();
|
|
82
|
+
// mark initialized
|
|
83
|
+
this.state = 'ready';
|
|
84
|
+
}
|
|
85
|
+
// handle error
|
|
86
|
+
catch (e) {
|
|
87
|
+
// mark error
|
|
88
|
+
this.state = 'error.initialize';
|
|
89
|
+
// rethrow
|
|
90
|
+
throw e;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async subscribe() {
|
|
94
|
+
// fail if not ready
|
|
95
|
+
if (this.state !== 'ready') {
|
|
96
|
+
throw new funnel_core_1.InvalidOperationError('Cannot subscribe() before being "ready"');
|
|
97
|
+
}
|
|
98
|
+
// ignore if already subscribed
|
|
99
|
+
else if (this.subscription) {
|
|
100
|
+
console.warn('[PushClient] ignoring redundant subscribe()');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// try to subscribe
|
|
104
|
+
let subscription = undefined;
|
|
105
|
+
try {
|
|
106
|
+
// update state
|
|
107
|
+
this.state = 'updating';
|
|
108
|
+
// get registration (in-case we're waiting)
|
|
109
|
+
const registration = await navigator.serviceWorker.ready;
|
|
110
|
+
// subscribe locally
|
|
111
|
+
subscription = await registration.pushManager.subscribe({
|
|
112
|
+
userVisibleOnly: true,
|
|
113
|
+
applicationServerKey: urlBase64ToUint8Array(this.vapIdKey)
|
|
114
|
+
});
|
|
115
|
+
// persist the subscription
|
|
116
|
+
await AppServiceClient_1.AppServiceClient.post({
|
|
117
|
+
id: '_nd-push',
|
|
118
|
+
method: 'subscribe.web',
|
|
119
|
+
data: subscription
|
|
120
|
+
});
|
|
121
|
+
// update subscription
|
|
122
|
+
this.subscription = subscription;
|
|
123
|
+
}
|
|
124
|
+
// forward errors
|
|
125
|
+
catch (e) {
|
|
126
|
+
// TODO: handle isometric (server) errors
|
|
127
|
+
// or something unexpected
|
|
128
|
+
console.error('[PushClient] failed to subscribe()', e);
|
|
129
|
+
// clear subscription (if any)
|
|
130
|
+
subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
|
|
131
|
+
}
|
|
132
|
+
// mark ready
|
|
133
|
+
finally {
|
|
134
|
+
// handle blocked status
|
|
135
|
+
const blocked = await this.isBlocked();
|
|
136
|
+
if (blocked) {
|
|
137
|
+
this.state = 'error.blocked';
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.state = 'ready';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async unsubscribe() {
|
|
145
|
+
// fail if not ready
|
|
146
|
+
if (this.state !== 'ready') {
|
|
147
|
+
throw new funnel_core_1.InvalidOperationError('Cannot unsubscribe() before being "ready"');
|
|
148
|
+
}
|
|
149
|
+
// ignore if already subscribed
|
|
150
|
+
const { subscription } = this;
|
|
151
|
+
if (!subscription) {
|
|
152
|
+
console.warn('[PushClient] ignoring redundant unsubscribe()');
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// clear subscription
|
|
156
|
+
try {
|
|
157
|
+
// mark updating
|
|
158
|
+
this.state = 'updating';
|
|
159
|
+
// clear the subscription
|
|
160
|
+
await AppServiceClient_1.AppServiceClient.post({
|
|
161
|
+
id: '_nd-push',
|
|
162
|
+
method: 'unsubscribe',
|
|
163
|
+
data: null
|
|
164
|
+
});
|
|
165
|
+
// clear push
|
|
166
|
+
await subscription.unsubscribe();
|
|
167
|
+
this.subscription = undefined;
|
|
168
|
+
}
|
|
169
|
+
// handle error
|
|
170
|
+
catch (e) {
|
|
171
|
+
console.error('[PushClient] failed to unsubscribe()', e);
|
|
172
|
+
// rethrow
|
|
173
|
+
throw e;
|
|
174
|
+
}
|
|
175
|
+
// mark ready
|
|
176
|
+
finally {
|
|
177
|
+
this.state = 'ready';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
toJSON() {
|
|
181
|
+
const { constructor: { name }, vapIdKey } = this;
|
|
182
|
+
return {
|
|
183
|
+
class: name,
|
|
184
|
+
vapIdKey
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.PushClient = PushClient;
|
|
189
|
+
// helpers
|
|
190
|
+
function urlBase64ToUint8Array(base64Raw) {
|
|
191
|
+
// sanitize string
|
|
192
|
+
const padding = '='.repeat((4 - (base64Raw.length % 4)) % 4);
|
|
193
|
+
const base64 = (base64Raw + padding)
|
|
194
|
+
.replace(/-/g, '+')
|
|
195
|
+
.replace(/_/g, '/');
|
|
196
|
+
// convert to array
|
|
197
|
+
const rawData = window.atob(base64);
|
|
198
|
+
const array = new Uint8Array(rawData.length);
|
|
199
|
+
for (let i = 0; i < rawData.length; ++i) {
|
|
200
|
+
array[i] = rawData.charCodeAt(i);
|
|
201
|
+
}
|
|
202
|
+
// and return it
|
|
203
|
+
return array;
|
|
204
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare function PushProvider({ children }: PushProvider.Props): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace PushProvider {
|
|
4
|
+
type Props = PropsWithChildren;
|
|
5
|
+
function setVapIdKey(vapIdKey: string): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushProvider = PushProvider;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const web_1 = require("../../bridge/web");
|
|
7
|
+
const PushClient_1 = require("./PushClient");
|
|
8
|
+
const PushContext_1 = require("./PushContext");
|
|
9
|
+
// container
|
|
10
|
+
function PushProvider({ children }) {
|
|
11
|
+
// bind context
|
|
12
|
+
const context = (0, react_1.useMemo)(() => ({ client: _vapIdKey ? new PushClient_1.PushClient({ vapIdKey: _vapIdKey }) : undefined }), []);
|
|
13
|
+
const { client } = context;
|
|
14
|
+
const { isNative } = (0, web_1.useBridge)();
|
|
15
|
+
// initialize push client on mount
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
// skip if there's no client
|
|
18
|
+
if (!client) {
|
|
19
|
+
console.debug('[PushProvider] no web PushClient configured');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// or if native
|
|
23
|
+
else if (isNative) {
|
|
24
|
+
console.debug('[PushProvider] skipping web PushClient initialization');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// initialize client
|
|
28
|
+
client.initialize()
|
|
29
|
+
.catch(console.error);
|
|
30
|
+
}, [client, isNative]);
|
|
31
|
+
// render
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(PushContext_1.PushContext.Provider, { value: context, children: children }));
|
|
33
|
+
}
|
|
34
|
+
// extension
|
|
35
|
+
(function (PushProvider) {
|
|
36
|
+
function setVapIdKey(vapIdKey) {
|
|
37
|
+
_vapIdKey = vapIdKey;
|
|
38
|
+
}
|
|
39
|
+
PushProvider.setVapIdKey = setVapIdKey;
|
|
40
|
+
})(PushProvider || (exports.PushProvider = PushProvider = {}));
|
|
41
|
+
// storage
|
|
42
|
+
let _vapIdKey = undefined;
|
|
@@ -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
|
+
__exportStar(require("../domain"), exports);
|
|
18
|
+
__exportStar(require("./PushClient"), exports);
|
|
19
|
+
__exportStar(require("./PushProvider"), exports);
|
|
20
|
+
__exportStar(require("./usePushClient"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePossiblePushClient = usePossiblePushClient;
|
|
4
|
+
exports.usePushClient = usePushClient;
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const client_1 = require("@nascentdigital/funnel-ui/client");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const PushContext_1 = require("./PushContext");
|
|
9
|
+
// hook
|
|
10
|
+
function usePossiblePushClient() {
|
|
11
|
+
// bind memos + hooks
|
|
12
|
+
const { client } = (0, react_1.useContext)(PushContext_1.PushContext);
|
|
13
|
+
const touch = (0, client_1.useTouch)();
|
|
14
|
+
// bind worker
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
// skip if there's no client
|
|
17
|
+
if (!client) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// bind client
|
|
21
|
+
const subscriptions = [
|
|
22
|
+
client.state$.subscribe(() => touch()),
|
|
23
|
+
client.subscription$.subscribe(() => touch())
|
|
24
|
+
];
|
|
25
|
+
// clear subscription on unmount
|
|
26
|
+
return () => subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
27
|
+
}, [client, touch]);
|
|
28
|
+
console.debug('[usePossiblePushClient] client:', client);
|
|
29
|
+
// return client
|
|
30
|
+
return client;
|
|
31
|
+
}
|
|
32
|
+
function usePushClient() {
|
|
33
|
+
// bind client (throw if not bound)
|
|
34
|
+
const client = usePossiblePushClient();
|
|
35
|
+
if (!client) {
|
|
36
|
+
throw new funnel_core_1.InvalidOperationError('Cannot access usePushClient() outside of PushProvider scope');
|
|
37
|
+
}
|
|
38
|
+
// return client
|
|
39
|
+
return client;
|
|
40
|
+
}
|