@databiosphere/findable-ui 50.8.0 → 51.0.1
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/lib/auth/constants/auth.d.ts +5 -0
- package/lib/{providers/authentication/auth/constants.js → auth/constants/auth.js} +4 -1
- package/lib/auth/constants/authentication.d.ts +5 -0
- package/lib/{providers/authentication/authentication/constants.js → auth/constants/authentication.js} +4 -1
- package/lib/auth/constants/credentials.d.ts +5 -0
- package/lib/{providers/authentication/credentials/constants.js → auth/constants/credentials.js} +3 -0
- package/lib/auth/constants/token.d.ts +5 -0
- package/lib/{providers/authentication/token/constants.js → auth/constants/token.js} +3 -0
- package/lib/{providers/authentication/auth/context.d.ts → auth/contexts/auth.d.ts} +4 -1
- package/lib/{providers/authentication/auth/context.js → auth/contexts/auth.js} +4 -1
- package/lib/auth/contexts/authentication.d.ts +5 -0
- package/lib/{providers/authentication/authentication/context.js → auth/contexts/authentication.js} +4 -1
- package/lib/auth/contexts/credentials.d.ts +5 -0
- package/lib/{providers/authentication/credentials/context.js → auth/contexts/credentials.js} +4 -1
- package/lib/{providers/authentication/auth/dispatch.d.ts → auth/dispatch/auth.d.ts} +2 -2
- package/lib/{providers/authentication/auth/dispatch.js → auth/dispatch/auth.js} +2 -2
- package/lib/{providers/authentication/authentication/dispatch.d.ts → auth/dispatch/authentication.d.ts} +2 -2
- package/lib/{providers/authentication/authentication/dispatch.js → auth/dispatch/authentication.js} +2 -2
- package/lib/auth/dispatch/credentials.d.ts +12 -0
- package/lib/{providers/authentication/credentials/dispatch.js → auth/dispatch/credentials.js} +3 -3
- package/lib/{providers/authentication/token/dispatch.d.ts → auth/dispatch/token.d.ts} +3 -3
- package/lib/{providers/authentication/token/dispatch.js → auth/dispatch/token.js} +3 -3
- package/lib/{providers/authentication/auth/hook.d.ts → auth/hooks/useAuth.d.ts} +1 -1
- package/lib/{providers/authentication/auth/hook.js → auth/hooks/useAuth.js} +1 -1
- package/lib/auth/hooks/useAuthReducer.d.ts +7 -0
- package/lib/auth/hooks/useAuthReducer.js +13 -0
- package/lib/{providers/authentication/authentication/hook.d.ts → auth/hooks/useAuthentication.d.ts} +1 -1
- package/lib/{providers/authentication/authentication/hook.js → auth/hooks/useAuthentication.js} +1 -1
- package/lib/auth/hooks/useAuthenticationReducer.d.ts +7 -0
- package/lib/auth/hooks/useAuthenticationReducer.js +13 -0
- package/lib/{providers/authentication/credentials/hook.d.ts → auth/hooks/useCredentials.d.ts} +1 -1
- package/lib/{providers/authentication/credentials/hook.js → auth/hooks/useCredentials.js} +1 -1
- package/lib/auth/hooks/useCredentialsReducer.d.ts +6 -0
- package/lib/{hooks/authentication/credentials → auth/hooks}/useCredentialsReducer.js +6 -2
- package/lib/{providers/authentication/auth/reducer.d.ts → auth/reducers/auth.d.ts} +1 -1
- package/lib/{providers/authentication/auth/reducer.js → auth/reducers/auth.js} +13 -2
- package/lib/{providers/authentication/authentication/reducer.d.ts → auth/reducers/authentication.d.ts} +1 -1
- package/lib/{providers/authentication/authentication/reducer.js → auth/reducers/authentication.js} +13 -2
- package/lib/{providers/authentication/credentials/reducer.d.ts → auth/reducers/credentials.d.ts} +1 -1
- package/lib/{providers/authentication/credentials/reducer.js → auth/reducers/credentials.js} +14 -3
- package/lib/{providers/authentication/token/reducer.d.ts → auth/reducers/token.d.ts} +1 -1
- package/lib/{providers/authentication/token/reducer.js → auth/reducers/token.js} +2 -2
- package/lib/{providers/authentication/auth/types.d.ts → auth/types/auth.d.ts} +41 -5
- package/lib/{providers/authentication/auth/types.js → auth/types/auth.js} +6 -0
- package/lib/{providers/authentication/authentication/types.d.ts → auth/types/authentication.d.ts} +46 -4
- package/lib/{providers/authentication/authentication/types.js → auth/types/authentication.js} +6 -0
- package/lib/auth/types/common.d.ts +4 -0
- package/lib/{providers/authentication/credentials/types.d.ts → auth/types/credentials.d.ts} +31 -4
- package/lib/{providers/authentication/credentials/types.js → auth/types/credentials.js} +3 -0
- package/lib/auth/types/loginProvider.d.ts +11 -0
- package/lib/{providers/authentication/token/types.d.ts → auth/types/token.d.ts} +29 -5
- package/lib/{providers/authentication/token/types.js → auth/types/token.js} +3 -0
- package/lib/common/chart/sort/utils.d.ts +1 -1
- package/lib/components/ComponentCreator/ComponentCreator.js +1 -1
- package/lib/components/ComponentCreator/components/RenderComponent/renderComponent.d.ts +1 -1
- package/lib/components/ErrorBoundary/errorBoundary.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandForm/downloadCurlCommandForm.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandNotStarted/downloadCurlCommandNotStarted.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandReady/downloadCurlCommandReady.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/components/ExportButton/exportButton.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/components/ExportExecutionEnvironmentForm/exportExecutionEnvironmentForm.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/exportForm.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraNotStarted/exportToTerraNotStarted.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.js +1 -1
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/terraSetUpForm.js +2 -2
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadNotStarted/manifestDownloadNotStarted.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadReady/manifestDownloadReady.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.d.ts +1 -1
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.js +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/search.d.ts +1 -1
- package/lib/components/Login/components/Buttons/buttons.d.ts +1 -1
- package/lib/components/Login/components/Buttons/buttons.js +1 -1
- package/lib/components/Login/components/Buttons/types.d.ts +5 -5
- package/lib/components/Login/hooks/useUserLogin/types.d.ts +1 -1
- package/lib/components/Login/hooks/useUserLogin/useUserLogin.js +1 -1
- package/lib/components/Login/login.d.ts +1 -1
- package/lib/components/Login/login.js +1 -1
- package/lib/components/Login/types.d.ts +3 -4
- package/lib/components/MarkdownRenderer/components/Anchor/anchor.d.ts +1 -1
- package/lib/components/MarkdownRenderer/components/Table/table.d.ts +1 -1
- package/lib/components/MarkdownRenderer/markdownRenderer.js +2 -2
- package/lib/components/MarkdownRenderer/types.d.ts +1 -1
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.d.ts +1 -1
- package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.d.ts +1 -1
- package/lib/components/common/Button/components/CallToActionButton/callToActionButton.d.ts +1 -1
- package/lib/components/common/Chip/components/Beta/beta.styles.js +1 -1
- package/lib/components/common/IconBadge/iconBadge.d.ts +1 -1
- package/lib/components/common/IconButton/iconButton.d.ts +1 -1
- package/lib/components/common/Input/input.d.ts +1 -1
- package/lib/components/common/KeyValuePairs/keyValuePairs.d.ts +1 -1
- package/lib/components/common/Progress/components/CircularProgress/circularProgress.d.ts +1 -1
- package/lib/components/common/Stack/components/Divider/divider.d.ts +1 -1
- package/lib/components/common/StatusIcon/statusIcon.d.ts +1 -1
- package/lib/config/entities.d.ts +4 -4
- package/lib/google/config.d.ts +7 -0
- package/lib/google/config.js +14 -0
- package/lib/google/constants.d.ts +16 -0
- package/lib/google/constants.js +24 -0
- package/lib/google/hooks/useGoogleSignInService.d.ts +8 -0
- package/lib/{providers/googleSignInAuthentication → google}/hooks/useGoogleSignInService.js +7 -2
- package/lib/{hooks/authentication/token → google/hooks}/useTokenReducer.d.ts +2 -1
- package/lib/{hooks/authentication/token → google/hooks}/useTokenReducer.js +3 -2
- package/lib/google/provider.d.ts +11 -0
- package/lib/{providers/googleSignInAuthentication → google}/provider.js +19 -11
- package/lib/google/service.d.ts +18 -0
- package/lib/{providers/googleSignInAuthentication/service → google}/service.js +20 -9
- package/lib/google/session-controller.d.ts +11 -0
- package/lib/{components/Authentication/components/SessionController/components/GoogleSessionController/SessionController.js → google/session-controller.js} +14 -6
- package/lib/google/types.d.ts +58 -0
- package/lib/{providers/authentication/authentication/utils.d.ts → google/utils/auth.d.ts} +6 -0
- package/lib/{providers/authentication/authentication/utils.js → google/utils/auth.js} +10 -0
- package/lib/{providers/googleSignInAuthentication/profile/utils.d.ts → google/utils/profile.d.ts} +2 -2
- package/lib/{providers/googleSignInAuthentication/profile/utils.js → google/utils/profile.js} +1 -1
- package/lib/hooks/authentication/profile/types.d.ts +1 -1
- package/lib/hooks/authentication/profile/useProfile.js +3 -3
- package/lib/hooks/authentication/providers/types.d.ts +1 -1
- package/lib/hooks/authentication/session/useSessionActive.d.ts +2 -2
- package/lib/hooks/authentication/session/useSessionActive.js +2 -2
- package/lib/hooks/authentication/terra/useAuthenticationForm.js +1 -1
- package/lib/hooks/authentication/terra/useAuthenticationNIHExpiry.js +2 -2
- package/lib/hooks/authentication/token/types.d.ts +1 -1
- package/lib/hooks/authentication/token/useToken.js +1 -1
- package/lib/hooks/useEntityList.js +10 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/constants.d.ts +8 -2
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/constants.js +8 -2
- package/lib/nextauth/hooks/useNextAuthService.d.ts +6 -0
- package/lib/{providers/nextAuthAuthentication → nextauth}/hooks/useNextAuthService.js +7 -3
- package/lib/nextauth/provider.d.ts +12 -0
- package/lib/{providers/nextAuthAuthentication → nextauth}/provider.js +16 -7
- package/lib/nextauth/service.d.ts +20 -0
- package/lib/{providers/nextAuthAuthentication/service → nextauth}/service.js +14 -0
- package/lib/nextauth/session-controller.d.ts +10 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController/SessionController.js → nextauth/session-controller.js} +11 -4
- package/lib/{providers/nextAuthAuthentication → nextauth}/types.d.ts +9 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/utils.d.ts +2 -2
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/utils.js +2 -2
- package/lib/providers/exploreState.js +1 -10
- package/lib/providers/loginGuard/provider.js +1 -1
- package/lib/terra/constants.d.ts +28 -0
- package/lib/{providers/authentication/terra/hooks/common → terra}/constants.js +16 -1
- package/lib/terra/context.d.ts +5 -0
- package/lib/{providers/authentication/terra → terra}/context.js +4 -1
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchProfiles.d.ts +12 -4
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchProfiles.js +9 -4
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraNIHProfile.d.ts +2 -6
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraNIHProfile.js +4 -5
- package/lib/terra/hooks/useFetchTerraProfile.d.ts +10 -0
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraProfile.js +4 -5
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraTermsOfService.d.ts +2 -7
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraTermsOfService.js +4 -5
- package/lib/{providers/authentication/terra/hook.d.ts → terra/hooks/useTerraProfile.d.ts} +1 -1
- package/lib/{providers/authentication/terra/hook.js → terra/hooks/useTerraProfile.js} +1 -1
- package/lib/terra/provider.d.ts +10 -0
- package/lib/{providers/authentication/terra → terra}/provider.js +13 -6
- package/lib/terra/types/common.d.ts +50 -0
- package/lib/terra/types/common.js +19 -0
- package/lib/terra/types/context.d.ts +12 -0
- package/lib/terra/types/terra-nih.d.ts +8 -0
- package/lib/{providers/authentication/terra/hooks/useFetchTerraProfile.d.ts → terra/types/terra-profile.d.ts} +9 -8
- package/lib/terra/types/terra-tos.d.ts +9 -0
- package/lib/terra/types/terra-tos.js +1 -0
- package/lib/terra/utils.d.ts +47 -0
- package/lib/{providers/authentication/terra → terra}/utils.js +45 -2
- package/lib/utils/mdx/plugins/rehypeSlug.d.ts +1 -1
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.js +2 -3
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.js +1 -1
- package/lib/views/ExploreView/exploreView.js +2 -2
- package/lib/views/LoginView/loginView.d.ts +2 -2
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.js +2 -2
- package/lib/views/ResearchView/assistant/components/Input/input.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/messages.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.js +2 -2
- package/lib/views/ResearchView/assistant/stories/assistant.stories.js +1 -1
- package/lib/views/ResearchView/state/query/hooks/UseSubmit/hook.js +2 -2
- package/package.json +15 -1
- package/types/data-explorer-ui.d.ts +12 -12
- package/lib/components/Authentication/components/SessionController/components/GoogleSessionController/SessionController.d.ts +0 -3
- package/lib/components/Authentication/components/SessionController/components/GoogleSessionController/types.d.ts +0 -6
- package/lib/components/Authentication/components/SessionController/components/NextSessionController/SessionController.d.ts +0 -3
- package/lib/components/Authentication/components/SessionController/components/NextSessionController/types.d.ts +0 -4
- package/lib/hooks/authentication/auth/useAuthReducer.d.ts +0 -2
- package/lib/hooks/authentication/auth/useAuthReducer.js +0 -8
- package/lib/hooks/authentication/authentication/useAuthenticationReducer.d.ts +0 -2
- package/lib/hooks/authentication/authentication/useAuthenticationReducer.js +0 -8
- package/lib/hooks/authentication/credentials/useCredentialsReducer.d.ts +0 -2
- package/lib/providers/authentication/auth/actions.d.ts +0 -8
- package/lib/providers/authentication/auth/actions.js +0 -12
- package/lib/providers/authentication/auth/constants.d.ts +0 -2
- package/lib/providers/authentication/authentication/actions.d.ts +0 -8
- package/lib/providers/authentication/authentication/actions.js +0 -12
- package/lib/providers/authentication/authentication/constants.d.ts +0 -2
- package/lib/providers/authentication/authentication/context.d.ts +0 -2
- package/lib/providers/authentication/common/types.d.ts +0 -1
- package/lib/providers/authentication/credentials/actions.d.ts +0 -8
- package/lib/providers/authentication/credentials/actions.js +0 -12
- package/lib/providers/authentication/credentials/constants.d.ts +0 -2
- package/lib/providers/authentication/credentials/context.d.ts +0 -2
- package/lib/providers/authentication/credentials/dispatch.d.ts +0 -12
- package/lib/providers/authentication/terra/context.d.ts +0 -2
- package/lib/providers/authentication/terra/hooks/common/constants.d.ts +0 -6
- package/lib/providers/authentication/terra/hooks/common/entities.d.ts +0 -21
- package/lib/providers/authentication/terra/hooks/common/entities.js +0 -7
- package/lib/providers/authentication/terra/hooks/common/utils.d.ts +0 -15
- package/lib/providers/authentication/terra/hooks/common/utils.js +0 -25
- package/lib/providers/authentication/terra/hooks/utils.d.ts +0 -16
- package/lib/providers/authentication/terra/hooks/utils.js +0 -19
- package/lib/providers/authentication/terra/provider.d.ts +0 -3
- package/lib/providers/authentication/terra/types.d.ts +0 -20
- package/lib/providers/authentication/terra/types.js +0 -6
- package/lib/providers/authentication/terra/utils.d.ts +0 -19
- package/lib/providers/authentication/token/constants.d.ts +0 -2
- package/lib/providers/googleSignInAuthentication/common/types.d.ts +0 -17
- package/lib/providers/googleSignInAuthentication/constants.d.ts +0 -4
- package/lib/providers/googleSignInAuthentication/constants.js +0 -12
- package/lib/providers/googleSignInAuthentication/hooks/useGoogleSignInService.d.ts +0 -3
- package/lib/providers/googleSignInAuthentication/profile/types.d.ts +0 -14
- package/lib/providers/googleSignInAuthentication/provider.d.ts +0 -3
- package/lib/providers/googleSignInAuthentication/service/constants.d.ts +0 -4
- package/lib/providers/googleSignInAuthentication/service/constants.js +0 -9
- package/lib/providers/googleSignInAuthentication/service/service.d.ts +0 -6
- package/lib/providers/googleSignInAuthentication/types.d.ts +0 -6
- package/lib/providers/nextAuthAuthentication/hooks/useNextAuthService.d.ts +0 -2
- package/lib/providers/nextAuthAuthentication/provider.d.ts +0 -3
- package/lib/providers/nextAuthAuthentication/service/service.d.ts +0 -6
- /package/lib/{hooks/authentication/session → auth/hooks}/useSessionIdleTimer.d.ts +0 -0
- /package/lib/{hooks/authentication/session → auth/hooks}/useSessionIdleTimer.js +0 -0
- /package/lib/{components/Authentication/components/SessionController/components/GoogleSessionController/types.js → auth/types/common.js} +0 -0
- /package/lib/{components/Authentication/components/SessionController/components/NextSessionController/types.js → auth/types/loginProvider.js} +0 -0
- /package/lib/{providers/authentication/common/utils.d.ts → auth/utils/initializer.d.ts} +0 -0
- /package/lib/{providers/authentication/common/utils.js → auth/utils/initializer.js} +0 -0
- /package/lib/{providers/authentication/common → google}/types.js +0 -0
- /package/lib/{providers/googleSignInAuthentication/common → nextauth}/types.js +0 -0
- /package/lib/{providers/googleSignInAuthentication/profile/types.js → terra/types/context.js} +0 -0
- /package/lib/{providers/googleSignInAuthentication/types.js → terra/types/terra-nih.js} +0 -0
- /package/lib/{providers/nextAuthAuthentication/types.js → terra/types/terra-profile.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AuthService, LoginStatus, TERRA_PROFILE_STATUS } from "./types/common";
|
|
2
|
+
import { TerraNIHResponse } from "./types/terra-nih";
|
|
3
|
+
import { TerraResponse } from "./types/terra-profile";
|
|
4
|
+
import { TerraTermsOfServiceResponse } from "./types/terra-tos";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the options for an authentication request.
|
|
7
|
+
* @param token - Token.
|
|
8
|
+
* @returns request options.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAuthenticationRequestOptions(token: string): RequestInit;
|
|
11
|
+
/**
|
|
12
|
+
* Returns login status.
|
|
13
|
+
* An undefined endpoint will return a not supported login status,
|
|
14
|
+
* otherwise a not started login status is returned.
|
|
15
|
+
* @param endpoint - Endpoint.
|
|
16
|
+
* @returns initial login status.
|
|
17
|
+
*/
|
|
18
|
+
export declare function initLoginStatus<T>(endpoint?: string): LoginStatus<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns service endpoint.
|
|
21
|
+
* @param services - Services.
|
|
22
|
+
* @param serviceId - Service ID.
|
|
23
|
+
* @param endpointId - Endpoint ID.
|
|
24
|
+
* @returns Service endpoint.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getServiceEndpoint(services: AuthService[] | undefined, serviceId: string, endpointId: string): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Find a service by service ID.
|
|
29
|
+
* @param services - Services.
|
|
30
|
+
* @param serviceId - Service ID.
|
|
31
|
+
* @returns Service.
|
|
32
|
+
*/
|
|
33
|
+
export declare function findService(services: AuthService[] | undefined, serviceId: string): AuthService | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Determines the status of a user based on authentication and Terra service statuses.
|
|
36
|
+
* **Logic:**
|
|
37
|
+
* - **Pending** if the user is not authenticated.
|
|
38
|
+
* - **Pending** if any supported Terra service request is not started or pending.
|
|
39
|
+
* - **Unauthenticated** if the Terra profile is supported but the Terms of Service have not been accepted.
|
|
40
|
+
* - **Authenticated** in all other cases.
|
|
41
|
+
* @param isUserAuthenticated - User authentication status.
|
|
42
|
+
* @param terraNIHProfileLoginStatus - Terra NIH profile login status.
|
|
43
|
+
* @param terraProfileLoginStatus - Terra profile login status.
|
|
44
|
+
* @param terraTOSLoginStatus - Terra terms of service login status.
|
|
45
|
+
* @returns Terra profile status.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getProfileStatus(isUserAuthenticated: boolean, terraNIHProfileLoginStatus: LoginStatus<TerraNIHResponse>, terraProfileLoginStatus: LoginStatus<TerraResponse>, terraTOSLoginStatus: LoginStatus<TerraTermsOfServiceResponse>): TERRA_PROFILE_STATUS;
|
|
@@ -1,5 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TERRA_PROFILE_STATUS } from "./types";
|
|
1
|
+
import { LOGIN_STATUS_NOT_STARTED, LOGIN_STATUS_NOT_SUPPORTED, } from "./constants";
|
|
2
|
+
import { REQUEST_STATUS, TERRA_PROFILE_STATUS, } from "./types/common";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the options for an authentication request.
|
|
5
|
+
* @param token - Token.
|
|
6
|
+
* @returns request options.
|
|
7
|
+
*/
|
|
8
|
+
export function getAuthenticationRequestOptions(token) {
|
|
9
|
+
const headers = new Headers();
|
|
10
|
+
headers.append("authorization", "Bearer " + token);
|
|
11
|
+
return { headers };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns login status.
|
|
15
|
+
* An undefined endpoint will return a not supported login status,
|
|
16
|
+
* otherwise a not started login status is returned.
|
|
17
|
+
* @param endpoint - Endpoint.
|
|
18
|
+
* @returns initial login status.
|
|
19
|
+
*/
|
|
20
|
+
export function initLoginStatus(endpoint) {
|
|
21
|
+
if (!endpoint) {
|
|
22
|
+
// Endpoint not supported.
|
|
23
|
+
return LOGIN_STATUS_NOT_SUPPORTED;
|
|
24
|
+
}
|
|
25
|
+
return LOGIN_STATUS_NOT_STARTED;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns service endpoint.
|
|
29
|
+
* @param services - Services.
|
|
30
|
+
* @param serviceId - Service ID.
|
|
31
|
+
* @param endpointId - Endpoint ID.
|
|
32
|
+
* @returns Service endpoint.
|
|
33
|
+
*/
|
|
34
|
+
export function getServiceEndpoint(services, serviceId, endpointId) {
|
|
35
|
+
return findService(services, serviceId)?.endpoint[endpointId];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Find a service by service ID.
|
|
39
|
+
* @param services - Services.
|
|
40
|
+
* @param serviceId - Service ID.
|
|
41
|
+
* @returns Service.
|
|
42
|
+
*/
|
|
43
|
+
export function findService(services, serviceId) {
|
|
44
|
+
return services?.find(({ id }) => id === serviceId);
|
|
45
|
+
}
|
|
3
46
|
/**
|
|
4
47
|
* Determines the status of a user based on authentication and Terra service statuses.
|
|
5
48
|
* **Logic:**
|
package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ToggleButton } from "@mui/material";
|
|
3
|
-
import { StyledBox } from "./toggleButtonGroup.styles";
|
|
4
3
|
import Link from "next/link";
|
|
5
|
-
import { useAiRoutes } from "../../../../../../hooks/ai/useAiRoutes/hook";
|
|
6
|
-
import { StyledToggleButtonGroup } from "./toggleButtonGroup.styles";
|
|
7
4
|
import { Beta } from "../../../../../../components/common/Chip/components/Beta/beta";
|
|
5
|
+
import { useAiRoutes } from "../../../../../../hooks/ai/useAiRoutes/hook";
|
|
6
|
+
import { StyledBox, StyledToggleButtonGroup } from "./toggleButtonGroup.styles";
|
|
8
7
|
/**
|
|
9
8
|
* ToggleButtonGroup component for navigating between ExploreView and ResearchView.
|
|
10
9
|
* @returns ToggleButtonGroup JSX element, or null if routes are not configured.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Box, ToggleButtonGroup } from "@mui/material";
|
|
3
|
-
import { bpDownMd } from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
3
|
import { PALETTE } from "../../../../../../styles/common/constants/palette";
|
|
4
|
+
import { bpDownMd } from "../../../../../../styles/common/mixins/breakpoints";
|
|
5
5
|
export const StyledBox = styled(Box) `
|
|
6
6
|
margin-bottom: -16px;
|
|
7
7
|
padding: 16px;
|
|
@@ -23,10 +23,10 @@ import { stateToUrl } from "../../providers/exploreState/actions/stateToUrl/disp
|
|
|
23
23
|
import { urlToState } from "../../providers/exploreState/actions/urlToState/dispatch";
|
|
24
24
|
import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
|
|
25
25
|
import { TEST_IDS } from "../../tests/testIds";
|
|
26
|
+
import { ToggleButtonGroup } from "./entityList/filters/components/ToggleButtonGroup/toggleButtonGroup";
|
|
27
|
+
import { StyledGrid, StyledStack } from "./entityList/filters/filters.styles";
|
|
26
28
|
import { useUpdateFilterSort } from "./hooks/UseUpdateFilterSort/hook";
|
|
27
29
|
import { buildStateSyncManagerContext } from "./utils";
|
|
28
|
-
import { StyledGrid, StyledStack } from "./entityList/filters/filters.styles";
|
|
29
|
-
import { ToggleButtonGroup } from "./entityList/filters/components/ToggleButtonGroup/toggleButtonGroup";
|
|
30
30
|
export const ExploreView = (props) => {
|
|
31
31
|
const { mdDown } = useBreakpoint();
|
|
32
32
|
const { config, entityConfig } = useConfig(); // Get app level config.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClientSafeProvider } from "next-auth/react";
|
|
2
1
|
import { JSX } from "react";
|
|
2
|
+
import { LoginProvider } from "../../auth/types/loginProvider";
|
|
3
3
|
export interface LoginViewProps {
|
|
4
|
-
providers?:
|
|
4
|
+
providers?: LoginProvider[];
|
|
5
5
|
}
|
|
6
6
|
export declare const LoginView: ({ providers, }: LoginViewProps) => JSX.Element | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TEST_IDS } from "../../../../../tests/testIds";
|
|
3
|
-
import { StyledDrawer } from "./drawer.styles";
|
|
4
2
|
import { useLayoutSpacing } from "../../../../../hooks/UseLayoutSpacing/hook";
|
|
5
3
|
import { DRAWER_PROPS } from "../../../../../styles/common/mui/drawer";
|
|
4
|
+
import { TEST_IDS } from "../../../../../tests/testIds";
|
|
5
|
+
import { StyledDrawer } from "./drawer.styles";
|
|
6
6
|
/**
|
|
7
7
|
* Renders the drawer component for the research assistant.
|
|
8
8
|
* @param props - Component props.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import { RoundedPaper } from "../../../../../components/common/Paper/components/RoundedPaper/roundedPaper";
|
|
3
2
|
import { Box } from "@mui/material";
|
|
3
|
+
import { RoundedPaper } from "../../../../../components/common/Paper/components/RoundedPaper/roundedPaper";
|
|
4
4
|
export const StyledBox = styled(Box) `
|
|
5
5
|
padding: 16px;
|
|
6
6
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Stack } from "@mui/material";
|
|
2
1
|
import styled from "@emotion/styled";
|
|
2
|
+
import { Stack } from "@mui/material";
|
|
3
3
|
import { PALETTE } from "../../../../../../../../../styles/common/constants/palette";
|
|
4
4
|
export const StyledStack = styled(Stack) `
|
|
5
5
|
align-items: flex-start;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useScroll } from "./hooks/UseScroll/hook";
|
|
2
3
|
import { StyledStack } from "./messages.styles";
|
|
3
4
|
import { MessageSelector } from "./selector/messageSelector";
|
|
4
|
-
import { useScroll } from "./hooks/UseScroll/hook";
|
|
5
5
|
/**
|
|
6
6
|
* Renders chat messages, delegating each to the message selector.
|
|
7
7
|
* @param props - Component props.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ToggleButtonGroup } from "../toggleButtonGroup";
|
|
3
2
|
import { ConfigProvider } from "../../../../../../providers/config";
|
|
4
3
|
import { INITIAL_CONFIG } from "../../../stories/args";
|
|
4
|
+
import { ToggleButtonGroup } from "../toggleButtonGroup";
|
|
5
5
|
const meta = {
|
|
6
6
|
component: ToggleButtonGroup,
|
|
7
7
|
decorators: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ToggleButton } from "@mui/material";
|
|
3
|
-
import { StyledBox, StyledToggleButtonGroup } from "./toggleButtonGroup.styles";
|
|
4
3
|
import Link from "next/link";
|
|
5
|
-
import { useAiRoutes } from "../../../../../hooks/ai/useAiRoutes/hook";
|
|
6
4
|
import { Beta } from "../../../../../components/common/Chip/components/Beta/beta";
|
|
5
|
+
import { useAiRoutes } from "../../../../../hooks/ai/useAiRoutes/hook";
|
|
6
|
+
import { StyledBox, StyledToggleButtonGroup } from "./toggleButtonGroup.styles";
|
|
7
7
|
/**
|
|
8
8
|
* ToggleButtonGroup component for navigating between ResearchView and ExploreView.
|
|
9
9
|
* @returns ToggleButtonGroup JSX element, or null if routes are not configured.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
|
+
import { ConfigProvider } from "../../../../providers/config";
|
|
3
4
|
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
4
5
|
import { ChatProvider } from "../../state/provider";
|
|
5
6
|
import { Assistant } from "../assistant";
|
|
6
7
|
import { INITIAL_ARGS, INITIAL_CONFIG } from "./args";
|
|
7
|
-
import { ConfigProvider } from "../../../../providers/config";
|
|
8
8
|
const meta = {
|
|
9
9
|
component: Assistant,
|
|
10
10
|
decorators: [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback, useRef } from "react";
|
|
2
|
-
import { fetchResponse } from "../../../../query/fetch";
|
|
3
|
-
import { useChatDispatch } from "../../../hooks/UseChatDispatch/hook";
|
|
4
2
|
import { track } from "../../../../../../common/analytics/analytics";
|
|
5
3
|
import { EVENT_NAME } from "../../../../../../common/analytics/entities";
|
|
4
|
+
import { fetchResponse } from "../../../../query/fetch";
|
|
5
|
+
import { useChatDispatch } from "../../../hooks/UseChatDispatch/hook";
|
|
6
6
|
/**
|
|
7
7
|
* Hook that manages query submission and abort lifecycle.
|
|
8
8
|
* @param url - The API URL to send queries to.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databiosphere/findable-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "51.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
@@ -25,6 +25,14 @@
|
|
|
25
25
|
"lib",
|
|
26
26
|
"types"
|
|
27
27
|
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": "./lib/index.js",
|
|
30
|
+
"./lib/*": "./lib/*",
|
|
31
|
+
"./nextauth/*": "./lib/nextauth/*",
|
|
32
|
+
"./google/*": "./lib/google/*",
|
|
33
|
+
"./terra/*": "./lib/terra/*",
|
|
34
|
+
"./auth/*": "./lib/auth/*"
|
|
35
|
+
},
|
|
28
36
|
"devDependencies": {
|
|
29
37
|
"@commitlint/cli": "^20.2.0",
|
|
30
38
|
"@commitlint/config-conventional": "^20.2.0",
|
|
@@ -54,6 +62,7 @@
|
|
|
54
62
|
"jest": "^29.7.0",
|
|
55
63
|
"jest-environment-jsdom": "^29.7.0",
|
|
56
64
|
"jest-fetch-mock": "^3.0.3",
|
|
65
|
+
"next-auth": "^4.24.13",
|
|
57
66
|
"prettier": "^3.7.4",
|
|
58
67
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
59
68
|
"storybook": "^10.3.3",
|
|
@@ -93,6 +102,11 @@
|
|
|
93
102
|
"uuid": "^13.0.0",
|
|
94
103
|
"yup": "^1.7.1"
|
|
95
104
|
},
|
|
105
|
+
"peerDependenciesMeta": {
|
|
106
|
+
"next-auth": {
|
|
107
|
+
"optional": true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
96
110
|
"overrides": {
|
|
97
111
|
"glob": "^11.0.4"
|
|
98
112
|
},
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { DataLayer } from "@databiosphere/findable-ui/lib/common/analytics/entities";
|
|
2
|
+
import { DataDictionaryAnnotation } from "@databiosphere/findable-ui/lib/common/entities";
|
|
3
|
+
import {
|
|
4
|
+
CustomFeatureColumn,
|
|
5
|
+
CustomFeatureInitialTableState,
|
|
6
|
+
CustomFeatureInstance,
|
|
7
|
+
CustomFeatureOptions,
|
|
8
|
+
CustomFeatureRow,
|
|
9
|
+
CustomFeatureTableState,
|
|
10
|
+
} from "@databiosphere/findable-ui/lib/components/Table/features/entities";
|
|
11
|
+
import { GridTrackSize } from "@databiosphere/findable-ui/lib/config/entities";
|
|
12
|
+
import { SIZE } from "@databiosphere/findable-ui/lib/styles/common/constants/size";
|
|
1
13
|
import {
|
|
2
14
|
Theme as MTheme,
|
|
3
15
|
PaletteColorOptions,
|
|
@@ -19,18 +31,6 @@ import type {} from "@mui/material/Toolbar";
|
|
|
19
31
|
import type {} from "@mui/material/Typography";
|
|
20
32
|
import type { RowData } from "@tanstack/react-table";
|
|
21
33
|
import { Components } from "rehype-react";
|
|
22
|
-
import { DataLayer } from "@databiosphere/findable-ui/lib/common/analytics/entities";
|
|
23
|
-
import { DataDictionaryAnnotation } from "@databiosphere/findable-ui/lib/common/entities";
|
|
24
|
-
import {
|
|
25
|
-
CustomFeatureColumn,
|
|
26
|
-
CustomFeatureInitialTableState,
|
|
27
|
-
CustomFeatureInstance,
|
|
28
|
-
CustomFeatureOptions,
|
|
29
|
-
CustomFeatureRow,
|
|
30
|
-
CustomFeatureTableState,
|
|
31
|
-
} from "@databiosphere/findable-ui/lib/components/Table/features/entities";
|
|
32
|
-
import { GridTrackSize } from "@databiosphere/findable-ui/lib/config/entities";
|
|
33
|
-
import { SIZE } from "@databiosphere/findable-ui/lib/styles/common/constants/size";
|
|
34
34
|
|
|
35
35
|
declare module "@mui/material/Alert" {
|
|
36
36
|
interface AlertProps {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useReducer } from "react";
|
|
2
|
-
import { DEFAULT_AUTH_STATE } from "../../../providers/authentication/auth/constants";
|
|
3
|
-
import { authReducer } from "../../../providers/authentication/auth/reducer";
|
|
4
|
-
import { initializer } from "../../../providers/authentication/common/utils";
|
|
5
|
-
export const useAuthReducer = (initialState = DEFAULT_AUTH_STATE) => {
|
|
6
|
-
const [authState, authDispatch] = useReducer(authReducer, initialState, initializer);
|
|
7
|
-
return { authDispatch, authState };
|
|
8
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { AuthenticationContextProps } from "../../../providers/authentication/authentication/types";
|
|
2
|
-
export declare const useAuthenticationReducer: (initialState?: import("../../../providers/authentication/authentication/types").AuthenticationState) => AuthenticationContextProps;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useReducer } from "react";
|
|
2
|
-
import { DEFAULT_AUTHENTICATION_STATE } from "../../../providers/authentication/authentication/constants";
|
|
3
|
-
import { authenticationReducer } from "../../../providers/authentication/authentication/reducer";
|
|
4
|
-
import { initializer } from "../../../providers/authentication/common/utils";
|
|
5
|
-
export const useAuthenticationReducer = (initialState = DEFAULT_AUTHENTICATION_STATE) => {
|
|
6
|
-
const [authenticationState, authenticationDispatch] = useReducer(authenticationReducer, initialState, initializer);
|
|
7
|
-
return { authenticationDispatch, authenticationState };
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthState, UpdateAuthStatePayload } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Update auth state.
|
|
4
|
-
* @param state - State.
|
|
5
|
-
* @param payload - Payload.
|
|
6
|
-
* @returns state.
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateAuthState(state: AuthState, payload: UpdateAuthStatePayload): AuthState;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthenticationState, UpdateAuthenticationPayload } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Update authentication action.
|
|
4
|
-
* @param state - State.
|
|
5
|
-
* @param payload - Payload.
|
|
6
|
-
* @returns state.
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateAuthenticationAction(state: AuthenticationState, payload: UpdateAuthenticationPayload): AuthenticationState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ProviderId = string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CredentialsState, UpdateCredentialsPayload } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Update credentials action.
|
|
4
|
-
* @param state - State.
|
|
5
|
-
* @param payload - Payload.
|
|
6
|
-
* @returns state.
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateCredentialsAction(state: CredentialsState, payload: UpdateCredentialsPayload): CredentialsState;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ResetStateAction, UpdateCredentialsAction, UpdateCredentialsPayload } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Update credentials action.
|
|
4
|
-
* @returns Action.
|
|
5
|
-
*/
|
|
6
|
-
export declare function resetState(): ResetStateAction;
|
|
7
|
-
/**
|
|
8
|
-
* Update credentials action.
|
|
9
|
-
* @param payload - Payload.
|
|
10
|
-
* @returns Action.
|
|
11
|
-
*/
|
|
12
|
-
export declare function updateCredentials(payload: UpdateCredentialsPayload): UpdateCredentialsAction;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { LoginResponse, LoginStatus } from "./entities";
|
|
2
|
-
export declare const LOGIN_STATUS_FAILED: LoginStatus<LoginResponse>;
|
|
3
|
-
export declare const LOGIN_STATUS_NOT_STARTED: LoginStatus<LoginResponse>;
|
|
4
|
-
export declare const LOGIN_STATUS_NOT_SUPPORTED: LoginStatus<LoginResponse>;
|
|
5
|
-
export declare const LOGIN_STATUS_PENDING: LoginStatus<LoginResponse>;
|
|
6
|
-
export declare const TERRA_SERVICE_ID = "terra";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TerraNIHResponse } from "../useFetchTerraNIHProfile";
|
|
2
|
-
import { TerraResponse } from "../useFetchTerraProfile";
|
|
3
|
-
import { TerraTermsOfServiceResponse } from "../useFetchTerraTermsOfService";
|
|
4
|
-
export type LoginResponse = TerraResponse | TerraNIHResponse | TerraTermsOfServiceResponse;
|
|
5
|
-
export interface LoginResponseError {
|
|
6
|
-
message: string;
|
|
7
|
-
source: string;
|
|
8
|
-
statusCode: number;
|
|
9
|
-
}
|
|
10
|
-
export interface LoginStatus<T> {
|
|
11
|
-
isSuccess: boolean;
|
|
12
|
-
isSupported: boolean;
|
|
13
|
-
requestStatus: REQUEST_STATUS;
|
|
14
|
-
response: T | undefined;
|
|
15
|
-
}
|
|
16
|
-
export declare enum REQUEST_STATUS {
|
|
17
|
-
COMPLETED = "COMPLETED",
|
|
18
|
-
FAILED = "FAILED",
|
|
19
|
-
NOT_STARTED = "NOT_STARTED",
|
|
20
|
-
PENDING = "PENDING"
|
|
21
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export var REQUEST_STATUS;
|
|
2
|
-
(function (REQUEST_STATUS) {
|
|
3
|
-
REQUEST_STATUS["COMPLETED"] = "COMPLETED";
|
|
4
|
-
REQUEST_STATUS["FAILED"] = "FAILED";
|
|
5
|
-
REQUEST_STATUS["NOT_STARTED"] = "NOT_STARTED";
|
|
6
|
-
REQUEST_STATUS["PENDING"] = "PENDING";
|
|
7
|
-
})(REQUEST_STATUS || (REQUEST_STATUS = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LoginResponse, LoginStatus } from "./entities";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the options for an authentication request.
|
|
4
|
-
* @param token - Token.
|
|
5
|
-
* @returns request options.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getAuthenticationRequestOptions(token: string): RequestInit;
|
|
8
|
-
/**
|
|
9
|
-
* Returns login status.
|
|
10
|
-
* An undefined endpoint will return a not supported login status,
|
|
11
|
-
* otherwise a not started login status is returned.
|
|
12
|
-
* @param endpoint - Endpoint.
|
|
13
|
-
* @returns initial login status.
|
|
14
|
-
*/
|
|
15
|
-
export declare function initLoginStatus(endpoint?: string): LoginStatus<LoginResponse>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { LOGIN_STATUS_NOT_STARTED, LOGIN_STATUS_NOT_SUPPORTED, } from "./constants";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the options for an authentication request.
|
|
4
|
-
* @param token - Token.
|
|
5
|
-
* @returns request options.
|
|
6
|
-
*/
|
|
7
|
-
export function getAuthenticationRequestOptions(token) {
|
|
8
|
-
const headers = new Headers();
|
|
9
|
-
headers.append("authorization", "Bearer " + token);
|
|
10
|
-
return { headers };
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Returns login status.
|
|
14
|
-
* An undefined endpoint will return a not supported login status,
|
|
15
|
-
* otherwise a not started login status is returned.
|
|
16
|
-
* @param endpoint - Endpoint.
|
|
17
|
-
* @returns initial login status.
|
|
18
|
-
*/
|
|
19
|
-
export function initLoginStatus(endpoint) {
|
|
20
|
-
if (!endpoint) {
|
|
21
|
-
// Endpoint not supported.
|
|
22
|
-
return LOGIN_STATUS_NOT_SUPPORTED;
|
|
23
|
-
}
|
|
24
|
-
return LOGIN_STATUS_NOT_STARTED;
|
|
25
|
-
}
|