@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,17 @@
|
|
|
1
|
+
import { ManagementClient } from 'auth0';
|
|
2
|
+
import { ProfileStore } from '../../profile/domain';
|
|
3
|
+
export declare class Auth0ProfileStore<TData extends ProfileStore.Data = ProfileStore.Data> extends ProfileStore<TData> {
|
|
4
|
+
private readonly _managementClient;
|
|
5
|
+
private readonly _internalKeyPrefix?;
|
|
6
|
+
constructor({ managementClient, internalKeyPrefix, ...args }: Auth0ProfileStore.ConstructorArgs<TData>);
|
|
7
|
+
protected get internalStoreKey(): string;
|
|
8
|
+
save(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace Auth0ProfileStore {
|
|
11
|
+
type ConstructorArgs<TData extends ProfileStore.Data> = ProfileStore.ConstructorArgs<TData> & {
|
|
12
|
+
internalKeyPrefix?: string;
|
|
13
|
+
managementClient: ManagementClient;
|
|
14
|
+
};
|
|
15
|
+
function toInternalKey(logicalKey: string, prefix?: string): string;
|
|
16
|
+
function toExternalKey(internalKey: string, prefix?: string): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.Auth0ProfileStore = void 0;
|
|
15
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
16
|
+
const domain_1 = require("../../profile/domain");
|
|
17
|
+
// class
|
|
18
|
+
class Auth0ProfileStore extends domain_1.ProfileStore {
|
|
19
|
+
constructor(_a) {
|
|
20
|
+
var { managementClient, internalKeyPrefix } = _a, args = __rest(_a, ["managementClient", "internalKeyPrefix"]);
|
|
21
|
+
// construct base
|
|
22
|
+
super(args);
|
|
23
|
+
// initialize instance variables
|
|
24
|
+
this._managementClient = managementClient;
|
|
25
|
+
this._internalKeyPrefix = internalKeyPrefix;
|
|
26
|
+
}
|
|
27
|
+
get internalStoreKey() {
|
|
28
|
+
return Auth0ProfileStore.toInternalKey(this.id, this._internalKeyPrefix);
|
|
29
|
+
}
|
|
30
|
+
async save() {
|
|
31
|
+
var _a;
|
|
32
|
+
// bail if there is nothing to save
|
|
33
|
+
if (this._edits.size === 0 && this._deletes.size === 0) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// get store data to save
|
|
37
|
+
// NOTE: only want to store custom data & __internals, so we ignore id, profileId when saving
|
|
38
|
+
const _b = this.toData(), { id, profileId } = _b, storeData = __rest(_b, ["id", "profileId"]);
|
|
39
|
+
// try to save
|
|
40
|
+
try {
|
|
41
|
+
// execute save request
|
|
42
|
+
// NOTE: management client merges app_metadata for us
|
|
43
|
+
const updatedData = await this._managementClient.users.update(this.profileId, {
|
|
44
|
+
app_metadata: {
|
|
45
|
+
[this.internalStoreKey]: Object.entries(storeData).length === 0
|
|
46
|
+
? null
|
|
47
|
+
: storeData
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
// update store data
|
|
51
|
+
const updatedStoreData = (_a = updatedData.app_metadata) === null || _a === void 0 ? void 0 : _a[this.internalStoreKey];
|
|
52
|
+
this._data = Object.assign(Object.assign({}, updatedStoreData), { profileId,
|
|
53
|
+
id });
|
|
54
|
+
// clear changes
|
|
55
|
+
this._edits.clear();
|
|
56
|
+
this._deletes.clear();
|
|
57
|
+
// raise event
|
|
58
|
+
this.raiseEvent('saved');
|
|
59
|
+
}
|
|
60
|
+
// handle error
|
|
61
|
+
catch (e) {
|
|
62
|
+
console.error(`Error saving profile store "${this.id}"`, e);
|
|
63
|
+
throw new funnel_core_1.ServerError(`Error saving profile store "${this.id}"`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.Auth0ProfileStore = Auth0ProfileStore;
|
|
68
|
+
// extension
|
|
69
|
+
(function (Auth0ProfileStore) {
|
|
70
|
+
// helpers
|
|
71
|
+
function toInternalKey(logicalKey, prefix) {
|
|
72
|
+
prefix = prefix
|
|
73
|
+
? `${prefix}-`
|
|
74
|
+
: '';
|
|
75
|
+
return prefix + logicalKey;
|
|
76
|
+
}
|
|
77
|
+
Auth0ProfileStore.toInternalKey = toInternalKey;
|
|
78
|
+
function toExternalKey(internalKey, prefix) {
|
|
79
|
+
const start = prefix ? prefix.length + 1 : 0;
|
|
80
|
+
return internalKey.substring(start);
|
|
81
|
+
}
|
|
82
|
+
Auth0ProfileStore.toExternalKey = toExternalKey;
|
|
83
|
+
})(Auth0ProfileStore || (exports.Auth0ProfileStore = Auth0ProfileStore = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Identity } from '../../identity/server';
|
|
2
|
+
import { Profile, ProfileUserService } from '../../profile/server';
|
|
3
|
+
export declare class Auth0ProfileUserService implements ProfileUserService {
|
|
4
|
+
private readonly _managementClient;
|
|
5
|
+
private readonly _internalStoreKeyPrefix?;
|
|
6
|
+
constructor(args: Auth0ProfileUserService.ConstructorArgs);
|
|
7
|
+
getProfile(identity: Identity): Promise<Profile>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace Auth0ProfileUserService {
|
|
10
|
+
type ConstructorArgs = {
|
|
11
|
+
domain: string;
|
|
12
|
+
clientId: string;
|
|
13
|
+
clientSecret: string;
|
|
14
|
+
internalStoreKeyPrefix?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Auth0ProfileUserService = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const auth0_1 = require("auth0");
|
|
6
|
+
const Auth0ProfileFactory_1 = require("./Auth0ProfileFactory");
|
|
7
|
+
// service
|
|
8
|
+
class Auth0ProfileUserService {
|
|
9
|
+
constructor(args) {
|
|
10
|
+
this._managementClient = new auth0_1.ManagementClient({
|
|
11
|
+
domain: args.domain,
|
|
12
|
+
clientId: args.clientId,
|
|
13
|
+
clientSecret: args.clientSecret
|
|
14
|
+
});
|
|
15
|
+
this._internalStoreKeyPrefix = args.internalStoreKeyPrefix;
|
|
16
|
+
}
|
|
17
|
+
async getProfile(identity) {
|
|
18
|
+
// try to get profile
|
|
19
|
+
try {
|
|
20
|
+
// fetch user data
|
|
21
|
+
const data = await this._managementClient.users.get(identity.id);
|
|
22
|
+
// create profile
|
|
23
|
+
return Auth0ProfileFactory_1.Auth0ProfileFactory.create({
|
|
24
|
+
data,
|
|
25
|
+
identity,
|
|
26
|
+
managementClient: this._managementClient,
|
|
27
|
+
internalStoreKeyPrefix: this._internalStoreKeyPrefix
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// handle error
|
|
31
|
+
catch (e) {
|
|
32
|
+
// rethrow if ours
|
|
33
|
+
if (e instanceof funnel_core_1.IsometricError) {
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
// profile not found
|
|
37
|
+
else if (e instanceof auth0_1.Management.NotFoundError) {
|
|
38
|
+
throw new funnel_core_1.NotAuthenticatedError(`Cannot find profile with id "${identity.id}"`);
|
|
39
|
+
}
|
|
40
|
+
// some other error
|
|
41
|
+
else {
|
|
42
|
+
console.error(`Error fetching profile "${identity.id}"`, e);
|
|
43
|
+
throw new funnel_core_1.ServerError(`Error fetching profile "${identity.id}"`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Auth0ProfileUserService = Auth0ProfileUserService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("server-only");
|
|
18
|
+
__exportStar(require("./Auth0IdentityService"), exports);
|
|
19
|
+
__exportStar(require("./Auth0ProfileServices"), exports);
|
|
20
|
+
__exportStar(require("./Auth0ProfileUserService"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Auth0ContextInterface, User } from '@auth0/auth0-react';
|
|
2
|
+
import { AbstractIdentityClient, IdentityClient } from '../../identity/web';
|
|
3
|
+
export declare class Auth0IdentityClient extends AbstractIdentityClient {
|
|
4
|
+
private _auth0?;
|
|
5
|
+
private readonly _webClient;
|
|
6
|
+
private readonly _audience;
|
|
7
|
+
private readonly _redirectUri;
|
|
8
|
+
private readonly _userDb;
|
|
9
|
+
private _triedCallback;
|
|
10
|
+
private _handledCallback;
|
|
11
|
+
constructor(args: Auth0IdentityClient.ConstructorArgs);
|
|
12
|
+
get auth0(): Auth0ContextInterface;
|
|
13
|
+
set auth0(auth0: Auth0ContextInterface);
|
|
14
|
+
get availableMethods(): ReadonlyArray<IdentityClient.Method>;
|
|
15
|
+
get handledCallback(): boolean;
|
|
16
|
+
bindUser(auth0User?: User): Promise<void>;
|
|
17
|
+
login(method?: IdentityClient.Method): Promise<void>;
|
|
18
|
+
loginWithEmail(email: string, password: string): Promise<void>;
|
|
19
|
+
logout(): Promise<void>;
|
|
20
|
+
createAccount(email: string, password: string): Promise<void>;
|
|
21
|
+
resetAccount(email: string): Promise<void>;
|
|
22
|
+
deleteAccount(): Promise<void>;
|
|
23
|
+
tryHandleCallback(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace Auth0IdentityClient {
|
|
26
|
+
type ConstructorArgs = {
|
|
27
|
+
domain: string;
|
|
28
|
+
clientId: string;
|
|
29
|
+
audience: string;
|
|
30
|
+
redirectUri: string;
|
|
31
|
+
userDb: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Auth0IdentityClient = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const auth0_js_1 = require("auth0-js");
|
|
6
|
+
const web_1 = require("../../app/web");
|
|
7
|
+
const web_2 = require("../../identity/web");
|
|
8
|
+
// class
|
|
9
|
+
class Auth0IdentityClient extends web_2.AbstractIdentityClient {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
// construct base
|
|
12
|
+
super();
|
|
13
|
+
// initialize instance variables
|
|
14
|
+
this._webClient = new auth0_js_1.WebAuth({
|
|
15
|
+
domain: args.domain,
|
|
16
|
+
clientID: args.clientId,
|
|
17
|
+
redirectUri: args.redirectUri,
|
|
18
|
+
scope: args.scope,
|
|
19
|
+
responseType: 'id_token'
|
|
20
|
+
});
|
|
21
|
+
this._audience = args.audience;
|
|
22
|
+
this._redirectUri = args.redirectUri;
|
|
23
|
+
this._userDb = args.userDb;
|
|
24
|
+
this._triedCallback = false;
|
|
25
|
+
this._handledCallback = false;
|
|
26
|
+
}
|
|
27
|
+
get auth0() {
|
|
28
|
+
// throw if not bound
|
|
29
|
+
const { _auth0 } = this;
|
|
30
|
+
if (!_auth0) {
|
|
31
|
+
throw new funnel_core_1.InvalidOperationError('Attempt to access auth0 before being bount');
|
|
32
|
+
}
|
|
33
|
+
// return interface
|
|
34
|
+
return _auth0;
|
|
35
|
+
}
|
|
36
|
+
set auth0(auth0) {
|
|
37
|
+
// bind context (needed for methods)
|
|
38
|
+
this._auth0 = auth0;
|
|
39
|
+
}
|
|
40
|
+
get availableMethods() {
|
|
41
|
+
return web_2.IdentityClient.Method.all;
|
|
42
|
+
}
|
|
43
|
+
get handledCallback() {
|
|
44
|
+
return this._handledCallback;
|
|
45
|
+
}
|
|
46
|
+
async bindUser(auth0User) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
// anonymous identity if no user
|
|
49
|
+
if (!auth0User || !auth0User.sub) {
|
|
50
|
+
this.identity = new web_2.AnonymousIdentity({ id: '' });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// get api token
|
|
54
|
+
const apiToken = await this.auth0.getAccessTokenSilently({
|
|
55
|
+
authorizationParams: { audience: this._audience }
|
|
56
|
+
});
|
|
57
|
+
// create authenticated identity
|
|
58
|
+
this.identity = new web_2.AuthenticatedIdentity({
|
|
59
|
+
apiToken,
|
|
60
|
+
id: auth0User.sub,
|
|
61
|
+
email: auth0User.email,
|
|
62
|
+
verified: auth0User.email_verified || false,
|
|
63
|
+
nickname: auth0User.nickname || undefined,
|
|
64
|
+
name: auth0User.name || `${(_a = auth0User.given_name) !== null && _a !== void 0 ? _a : ''} ${(_b = auth0User.family_name) !== null && _b !== void 0 ? _b : ''}`.trim() || undefined
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async login(method) {
|
|
68
|
+
// TODO: hoist mapping from method to connection
|
|
69
|
+
let connection = undefined;
|
|
70
|
+
switch (method) {
|
|
71
|
+
case 'google':
|
|
72
|
+
connection = 'google-oauth2';
|
|
73
|
+
break;
|
|
74
|
+
case 'apple':
|
|
75
|
+
connection = 'apple';
|
|
76
|
+
break;
|
|
77
|
+
case 'facebook':
|
|
78
|
+
connection = 'facebook';
|
|
79
|
+
break;
|
|
80
|
+
case 'linkedin':
|
|
81
|
+
connection = 'linkedin';
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
// login with popup
|
|
85
|
+
await this.auth0.loginWithPopup({
|
|
86
|
+
authorizationParams: { connection, prompt: 'select_account' }
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
async loginWithEmail(email, password) {
|
|
90
|
+
return new Promise((resolve, reject) => {
|
|
91
|
+
this._webClient.login({
|
|
92
|
+
email,
|
|
93
|
+
password,
|
|
94
|
+
realm: this._userDb
|
|
95
|
+
}, error => {
|
|
96
|
+
// bail if no error
|
|
97
|
+
console.error('[Auth0IdentityClient] loginWithEmail', error);
|
|
98
|
+
if (!error) {
|
|
99
|
+
resolve();
|
|
100
|
+
}
|
|
101
|
+
// throw isometric error
|
|
102
|
+
else if (error.code === 'access_denied') {
|
|
103
|
+
reject(new funnel_core_1.NotAuthenticatedError('Invalid email or password'));
|
|
104
|
+
}
|
|
105
|
+
else if (error.code === 'too_many_attempts') {
|
|
106
|
+
reject(new funnel_core_1.TimeoutError('Too many attempts'));
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
reject(new funnel_core_1.ServerError('Something went wrong, please try again'));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
async logout() {
|
|
115
|
+
await this.auth0.logout({
|
|
116
|
+
logoutParams: { returnTo: this._redirectUri }
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async createAccount(email, password) {
|
|
120
|
+
return new Promise((resolve, reject) => {
|
|
121
|
+
this._webClient.signup({
|
|
122
|
+
email,
|
|
123
|
+
password,
|
|
124
|
+
connection: this._userDb
|
|
125
|
+
}, error => {
|
|
126
|
+
// bail if no error
|
|
127
|
+
console.error('[Auth0IdentityClient] createAccount', error);
|
|
128
|
+
if (!error) {
|
|
129
|
+
resolve();
|
|
130
|
+
}
|
|
131
|
+
// throw isometric error
|
|
132
|
+
else {
|
|
133
|
+
reject(new funnel_core_1.ServerError(error.description));
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async resetAccount(email) {
|
|
139
|
+
throw new funnel_core_1.NotImplementedError();
|
|
140
|
+
}
|
|
141
|
+
async deleteAccount() {
|
|
142
|
+
// make sure identity is authenticated
|
|
143
|
+
const { identity } = this;
|
|
144
|
+
if (!(identity instanceof web_2.AuthenticatedIdentity)) {
|
|
145
|
+
throw new funnel_core_1.NotAuthenticatedError();
|
|
146
|
+
}
|
|
147
|
+
// try to delete identity
|
|
148
|
+
try {
|
|
149
|
+
// send request to delete
|
|
150
|
+
await web_1.AppServiceClient.post({
|
|
151
|
+
apiToken: identity.apiToken,
|
|
152
|
+
id: '_nd-identity',
|
|
153
|
+
method: 'delete',
|
|
154
|
+
data: null
|
|
155
|
+
});
|
|
156
|
+
// logout
|
|
157
|
+
await this.logout();
|
|
158
|
+
}
|
|
159
|
+
// handle error
|
|
160
|
+
catch (e) {
|
|
161
|
+
console.error('[Auth0IdentityClient] error deleting identity', e);
|
|
162
|
+
throw e;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async tryHandleCallback() {
|
|
166
|
+
// only execute this once
|
|
167
|
+
if (this._triedCallback) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this._triedCallback = true;
|
|
171
|
+
// mark as handled if there is a hash with id_token
|
|
172
|
+
if (window.location.hash.includes('id_token')) {
|
|
173
|
+
this._handledCallback = true;
|
|
174
|
+
}
|
|
175
|
+
// bail if there is nothing to handle
|
|
176
|
+
else {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
// handle parsing of id_token value in window.location.hash
|
|
180
|
+
return new Promise((resolve) => {
|
|
181
|
+
this._webClient.parseHash((error, data) => {
|
|
182
|
+
// throw if error from parsing hash
|
|
183
|
+
if (error) {
|
|
184
|
+
console.error('Issue handling Auth0 callback', error);
|
|
185
|
+
throw new funnel_core_1.NotAuthenticatedError('Issue handling Auth0 callback');
|
|
186
|
+
}
|
|
187
|
+
// throw error if no token payload
|
|
188
|
+
if (!(data === null || data === void 0 ? void 0 : data.idTokenPayload)) {
|
|
189
|
+
resolve();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
// remove hash from window location
|
|
193
|
+
window.location.hash = '';
|
|
194
|
+
// bind user and resolve
|
|
195
|
+
this.bindUser(data.idTokenPayload).then(resolve);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
exports.Auth0IdentityClient = Auth0IdentityClient;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { WebIdentityClientProvider } from '../../identity/web';
|
|
3
|
+
export declare class Auth0IdentityClientProvider implements WebIdentityClientProvider {
|
|
4
|
+
private readonly _domain;
|
|
5
|
+
private readonly _clientId;
|
|
6
|
+
private readonly _audience;
|
|
7
|
+
private readonly _redirectUri;
|
|
8
|
+
private readonly _userDb;
|
|
9
|
+
private readonly _scope;
|
|
10
|
+
constructor(args: Auth0IdentityClientProvider.ConstructorArgs);
|
|
11
|
+
createProvider(): ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
readonly ProviderComponent: typeof Auth0IdentityProvider;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace Auth0IdentityClientProvider {
|
|
15
|
+
type ConstructorArgs = {
|
|
16
|
+
domain: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
audience: string;
|
|
19
|
+
redirectUri: string;
|
|
20
|
+
userDb: string;
|
|
21
|
+
scope?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare function Auth0IdentityProvider({ domain, clientId, audience, redirectUri, userDb, scope, children }: Auth0IdentityProvider.Props): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace Auth0IdentityProvider {
|
|
26
|
+
type Props = PropsWithChildren & {
|
|
27
|
+
domain: string;
|
|
28
|
+
clientId: string;
|
|
29
|
+
audience: string;
|
|
30
|
+
redirectUri: string;
|
|
31
|
+
userDb: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Auth0IdentityClientProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const auth0_react_1 = require("@auth0/auth0-react");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const web_1 = require("../../identity/web");
|
|
8
|
+
const Auth0IdentityClient_1 = require("./Auth0IdentityClient");
|
|
9
|
+
// class
|
|
10
|
+
class Auth0IdentityClientProvider {
|
|
11
|
+
constructor(args) {
|
|
12
|
+
var _a;
|
|
13
|
+
this.ProviderComponent = Auth0IdentityProvider;
|
|
14
|
+
// initialize instance variables
|
|
15
|
+
this._domain = args.domain;
|
|
16
|
+
this._clientId = args.clientId;
|
|
17
|
+
this._audience = args.audience;
|
|
18
|
+
this._redirectUri = args.redirectUri;
|
|
19
|
+
this._userDb = args.userDb;
|
|
20
|
+
this._scope = (_a = args.scope) !== null && _a !== void 0 ? _a : 'openid profile email offline_access';
|
|
21
|
+
}
|
|
22
|
+
createProvider() {
|
|
23
|
+
// bind props
|
|
24
|
+
const { _domain, _clientId, _audience, _redirectUri, _userDb, _scope } = this;
|
|
25
|
+
// return provider
|
|
26
|
+
return function Provider({ children }) {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(auth0_react_1.Auth0Provider, { domain: _domain, clientId: _clientId, authorizationParams: { redirect_uri: _redirectUri, scope: _scope }, children: (0, jsx_runtime_1.jsx)(Auth0IdentityProvider, { domain: _domain, clientId: _clientId, audience: _audience, redirectUri: _redirectUri, userDb: _userDb, scope: _scope, children: children }) }));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Auth0IdentityClientProvider = Auth0IdentityClientProvider;
|
|
32
|
+
// provider
|
|
33
|
+
function Auth0IdentityProvider({ domain, clientId, audience, redirectUri, userDb, scope, children }) {
|
|
34
|
+
// bind context
|
|
35
|
+
const auth0 = (0, auth0_react_1.useAuth0)();
|
|
36
|
+
const identityClient = (0, react_1.useMemo)(() => new Auth0IdentityClient_1.Auth0IdentityClient({ domain, clientId, audience, redirectUri, userDb, scope }), [domain, clientId, audience, redirectUri, userDb, scope]);
|
|
37
|
+
const context = (0, react_1.useMemo)(() => ({ identityClient }), [identityClient]);
|
|
38
|
+
// bind auth0
|
|
39
|
+
identityClient.auth0 = auth0;
|
|
40
|
+
// handle auth0 embedded login callback
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
// try to handle callback
|
|
43
|
+
identityClient.tryHandleCallback()
|
|
44
|
+
.catch(e => identityClient.error = e);
|
|
45
|
+
}, [identityClient]);
|
|
46
|
+
// try to bind user on mount if already logged in
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
// bail if handling auth0 callback
|
|
49
|
+
// when logging in, auth0 react context shouldn't be used
|
|
50
|
+
if (identityClient.handledCallback) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// bail if loading
|
|
54
|
+
if (auth0.isLoading) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// bind user when done loading
|
|
58
|
+
identityClient.bindUser(auth0.user)
|
|
59
|
+
.catch(e => identityClient.error = e);
|
|
60
|
+
// auth0.user is left out of dependency array on purpose.
|
|
61
|
+
// The useAuth0 hook returns new object each render for some reason.
|
|
62
|
+
// Depending on isLoading is enough: if isLoading changes then user should be changed too.
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
}, [identityClient, auth0.isLoading]);
|
|
65
|
+
// render
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(web_1.IdentityClientContext.Provider, { value: context, children: children }));
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Auth0IdentityClientProvider';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./Auth0IdentityClientProvider"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeConstants = void 0;
|
|
4
|
+
// namespace
|
|
5
|
+
var BridgeConstants;
|
|
6
|
+
(function (BridgeConstants) {
|
|
7
|
+
// internals
|
|
8
|
+
let Window;
|
|
9
|
+
(function (Window) {
|
|
10
|
+
// global variables
|
|
11
|
+
Window.initialState = '__nd_bridge_initialState';
|
|
12
|
+
Window.bridgeId = '__nd_bridgeId';
|
|
13
|
+
Window.bridge = '__nd_bridge';
|
|
14
|
+
})(Window = BridgeConstants.Window || (BridgeConstants.Window = {}));
|
|
15
|
+
})(BridgeConstants || (exports.BridgeConstants = BridgeConstants = {}));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SerializedIsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { JsonValue } from 'type-fest';
|
|
3
|
+
import { BridgeMethod } from './BridgeMethod';
|
|
4
|
+
import { BridgeState } from './BridgeState';
|
|
5
|
+
export type BridgeEvent = BridgeEvent.Log | BridgeEvent.State.Sync | BridgeEvent.State.Set | BridgeEvent.Call.Invoke | BridgeEvent.Call.Result | BridgeEvent.Call.Error;
|
|
6
|
+
export declare namespace BridgeEvent {
|
|
7
|
+
type Log = {
|
|
8
|
+
__type: 'log';
|
|
9
|
+
webViewId: string;
|
|
10
|
+
level: Log.Level;
|
|
11
|
+
args: JsonValue[];
|
|
12
|
+
};
|
|
13
|
+
namespace Log {
|
|
14
|
+
type Level = 'debug' | 'info' | 'warn' | 'error';
|
|
15
|
+
}
|
|
16
|
+
namespace State {
|
|
17
|
+
type Sync = {
|
|
18
|
+
__type: 'state.sync';
|
|
19
|
+
state: BridgeState;
|
|
20
|
+
};
|
|
21
|
+
type Set = {
|
|
22
|
+
__type: 'state.set';
|
|
23
|
+
key: string;
|
|
24
|
+
value: JsonValue;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
namespace Call {
|
|
28
|
+
type Invoke<TMethod extends BridgeMethod = BridgeMethod> = {
|
|
29
|
+
__type: 'call.invocation';
|
|
30
|
+
webViewId: string;
|
|
31
|
+
id: string;
|
|
32
|
+
method: TMethod['name'];
|
|
33
|
+
args: TMethod['args'];
|
|
34
|
+
};
|
|
35
|
+
type Result<TMethod extends BridgeMethod = BridgeMethod> = {
|
|
36
|
+
__type: 'call.result';
|
|
37
|
+
webViewId: string;
|
|
38
|
+
id: string;
|
|
39
|
+
method: TMethod['name'];
|
|
40
|
+
result: TMethod['result'];
|
|
41
|
+
};
|
|
42
|
+
type Error<TMethod extends BridgeMethod = BridgeMethod> = {
|
|
43
|
+
__type: 'call.error';
|
|
44
|
+
webViewId: string;
|
|
45
|
+
id: string;
|
|
46
|
+
method: TMethod['name'];
|
|
47
|
+
error: SerializedIsometricError;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function filter(event: any): event is BridgeEvent;
|
|
51
|
+
function parse(eventData: string): BridgeEvent | undefined;
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeEvent = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var BridgeEvent;
|
|
6
|
+
(function (BridgeEvent) {
|
|
7
|
+
// methods
|
|
8
|
+
function filter(event) {
|
|
9
|
+
return !!event
|
|
10
|
+
&& typeof event === 'object'
|
|
11
|
+
&& !Array.isArray(event)
|
|
12
|
+
&& '__type' in event && typeof event.__type === 'string';
|
|
13
|
+
}
|
|
14
|
+
BridgeEvent.filter = filter;
|
|
15
|
+
function parse(eventData) {
|
|
16
|
+
// convert event
|
|
17
|
+
try {
|
|
18
|
+
// bail if not
|
|
19
|
+
const event = JSON.parse(eventData);
|
|
20
|
+
return filter(event) ? event : undefined;
|
|
21
|
+
}
|
|
22
|
+
// handle failure
|
|
23
|
+
catch (_a) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
BridgeEvent.parse = parse;
|
|
28
|
+
})(BridgeEvent || (exports.BridgeEvent = BridgeEvent = {}));
|