diff --git a/web/src/app/app/message/MemoizedTextComponents.tsx b/web/src/app/app/message/MemoizedTextComponents.tsx index 02a5f84397..557d64de1c 100644 --- a/web/src/app/app/message/MemoizedTextComponents.tsx +++ b/web/src/app/app/message/MemoizedTextComponents.tsx @@ -4,7 +4,7 @@ import { SourceIcon } from "@/components/SourceIcon"; import { WebResultIcon } from "@/components/WebResultIcon"; import { MinimalOnyxDocument, OnyxDocument } from "@/lib/search/types"; import { SubQuestionDetail, CitationMap } from "../interfaces"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { ProjectFile } from "@/lib/projects/types"; import { BlinkingBar } from "./BlinkingBar"; import Text from "@/refresh-components/texts/Text"; diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/fetch/FetchToolRenderer.tsx b/web/src/app/app/message/messageComponents/timeline/renderers/fetch/FetchToolRenderer.tsx index 9719c141e3..b3ae62304a 100644 --- a/web/src/app/app/message/messageComponents/timeline/renderers/fetch/FetchToolRenderer.tsx +++ b/web/src/app/app/message/messageComponents/timeline/renderers/fetch/FetchToolRenderer.tsx @@ -7,7 +7,7 @@ import { import { BlinkingBar } from "@/app/app/message/BlinkingBar"; import { OnyxDocument } from "@/lib/search/types"; import { openExternalLink } from "@/lib/search/utils"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SearchChipList, SourceInfo } from "../search/SearchChipList"; import { getMetadataTags } from "../search/searchStateUtils"; import { diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx b/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx index 01b4147382..fc32a6c4b9 100644 --- a/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx +++ b/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx @@ -7,7 +7,7 @@ import { } from "@/app/app/message/messageComponents/interfaces"; import { BlinkingBar } from "@/app/app/message/BlinkingBar"; import { OnyxDocument } from "@/lib/search/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SearchChipList, SourceInfo } from "./SearchChipList"; import { formatSearchHeader, diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/search/WebSearchToolRenderer.tsx b/web/src/app/app/message/messageComponents/timeline/renderers/search/WebSearchToolRenderer.tsx index 58abadc436..5c7fbbec9c 100644 --- a/web/src/app/app/message/messageComponents/timeline/renderers/search/WebSearchToolRenderer.tsx +++ b/web/src/app/app/message/messageComponents/timeline/renderers/search/WebSearchToolRenderer.tsx @@ -7,7 +7,7 @@ import { RenderType, } from "@/app/app/message/messageComponents/interfaces"; import { BlinkingBar } from "@/app/app/message/BlinkingBar"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SearchChipList, SourceInfo } from "./SearchChipList"; import { constructCurrentSearchState, diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts b/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts index d415e2365d..90e3e3108b 100644 --- a/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts +++ b/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts @@ -10,7 +10,7 @@ import { } from "@/app/app/services/streamingModels"; import { OnyxDocument } from "@/lib/search/types"; import { getSourceDisplayName, isValidSource } from "@/lib/sources"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; export const MAX_TITLE_LENGTH = 25; diff --git a/web/src/components/FederatedConnectorSelector.tsx b/web/src/components/FederatedConnectorSelector.tsx index 86edd0ed92..057ef9533b 100644 --- a/web/src/components/FederatedConnectorSelector.tsx +++ b/web/src/components/FederatedConnectorSelector.tsx @@ -3,8 +3,8 @@ import { useTranslations } from "next-intl"; import { FederatedConnectorDetail, FederatedConnectorConfig, - federatedSourceToRegularSource, } from "@/lib/types"; +import { federatedSourceToRegularSource } from "@/lib/connectors/types/source"; import { SourceIcon } from "@/components/SourceIcon"; import { Label } from "@opal/layouts"; import { ErrorMessage } from "formik"; diff --git a/web/src/components/SourceIcon.tsx b/web/src/components/SourceIcon.tsx index 3b4004c37c..965843210f 100644 --- a/web/src/components/SourceIcon.tsx +++ b/web/src/components/SourceIcon.tsx @@ -1,7 +1,7 @@ "use client"; import { getSourceMetadata } from "@/lib/sources"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; export interface SourceIconProps { sourceType: ValidSources; diff --git a/web/src/components/WebResultIcon.tsx b/web/src/components/WebResultIcon.tsx index 373f677482..6e4f18d298 100644 --- a/web/src/components/WebResultIcon.tsx +++ b/web/src/components/WebResultIcon.tsx @@ -1,6 +1,6 @@ "use client"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SourceIcon } from "./SourceIcon"; import { useState } from "react"; import { SvgOnyxLogo, SvgGithub } from "@opal/logos"; diff --git a/web/src/components/admin/connectors/AccessTypeForm.test.tsx b/web/src/components/admin/connectors/AccessTypeForm.test.tsx index 7d8b30930d..d10bb6fe2a 100644 --- a/web/src/components/admin/connectors/AccessTypeForm.test.tsx +++ b/web/src/components/admin/connectors/AccessTypeForm.test.tsx @@ -1,7 +1,10 @@ import { render, screen, waitFor } from "@tests/setup/test-utils"; import { Formik } from "formik"; import { AccessTypeForm } from "@/components/admin/connectors/AccessTypeForm"; -import { ConfigurableSources, ValidSources } from "@/lib/types"; +import { + ConfigurableSources, + ValidSources, +} from "@/lib/connectors/types/source"; jest.mock("@/lib/permissions/hooks", () => ({ usePermissionAuthority: jest.fn(), diff --git a/web/src/components/admin/connectors/AccessTypeForm.tsx b/web/src/components/admin/connectors/AccessTypeForm.tsx index 44bc9b261a..5948768165 100644 --- a/web/src/components/admin/connectors/AccessTypeForm.tsx +++ b/web/src/components/admin/connectors/AccessTypeForm.tsx @@ -1,10 +1,10 @@ import { DefaultDropdown } from "@/components/Dropdown"; +import { AccessType } from "@/lib/types"; import { - AccessType, ValidAutoSyncSource, ConfigurableSources, validAutoSyncSources, -} from "@/lib/types"; +} from "@/lib/connectors/types/source"; import { useField } from "formik"; import { useTranslations } from "next-intl"; import { AutoSyncOptions } from "./AutoSyncOptions"; diff --git a/web/src/components/admin/connectors/AccessTypeGroupSelector.tsx b/web/src/components/admin/connectors/AccessTypeGroupSelector.tsx index 1d64711e76..4c161cade6 100644 --- a/web/src/components/admin/connectors/AccessTypeGroupSelector.tsx +++ b/web/src/components/admin/connectors/AccessTypeGroupSelector.tsx @@ -7,12 +7,12 @@ import Text from "@/refresh-components/texts/Text"; import { Button, Divider } from "@opal/components"; import { UserGroup } from "@/lib/types"; import { useUserGroups } from "@/lib/hooks"; +import { AccessType } from "@/lib/types"; import { - AccessType, ValidAutoSyncSource, ConfigurableSources, validAutoSyncSources, -} from "@/lib/types"; +} from "@/lib/connectors/types/source"; import { usePermissionAuthority } from "@/lib/permissions/hooks"; import { Permission } from "@/lib/types"; import { SvgUsers } from "@opal/icons"; diff --git a/web/src/components/admin/connectors/AutoSyncOptions.tsx b/web/src/components/admin/connectors/AutoSyncOptions.tsx index 653f87b376..161e10cf40 100644 --- a/web/src/components/admin/connectors/AutoSyncOptions.tsx +++ b/web/src/components/admin/connectors/AutoSyncOptions.tsx @@ -1,5 +1,5 @@ import { TextFormField } from "@/components/Field"; -import { ValidAutoSyncSource } from "@/lib/types"; +import type { ValidAutoSyncSource } from "@/lib/connectors/types/source"; import { Divider, Text } from "@opal/components"; import { autoSyncConfigBySource } from "@/lib/connectors/AutoSyncOptionFields"; diff --git a/web/src/components/admin/connectors/CredentialForm.tsx b/web/src/components/admin/connectors/CredentialForm.tsx index 3a45f83740..b1435c4f96 100644 --- a/web/src/components/admin/connectors/CredentialForm.tsx +++ b/web/src/components/admin/connectors/CredentialForm.tsx @@ -3,7 +3,7 @@ import { Formik, Form } from "formik"; import * as Yup from "yup"; import { toast } from "@opal/layouts"; import { useTranslations } from "next-intl"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { createCredential, diff --git a/web/src/components/admin/federated/FederatedConnectorForm.tsx b/web/src/components/admin/federated/FederatedConnectorForm.tsx index 5da2d9edd7..e4d63d678d 100644 --- a/web/src/components/admin/federated/FederatedConnectorForm.tsx +++ b/web/src/components/admin/federated/FederatedConnectorForm.tsx @@ -4,13 +4,13 @@ import { useState, useEffect } from "react"; import { useTranslations } from "next-intl"; import { Button, InputCheckbox, Divider, Tooltip } from "@opal/components"; import { - ConfigurableSources, CredentialFieldSpec, ConfigurationFieldSpec, FederatedConnectorCreateRequest, FederatedConnectorDetail, CredentialSchemaResponse, } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import { getSourceMetadata } from "@/lib/sources"; import { SourceIcon } from "@/components/SourceIcon"; import { Card, CardContent } from "@/components/ui/card"; diff --git a/web/src/components/chat/FederatedOAuthModal.tsx b/web/src/components/chat/FederatedOAuthModal.tsx index 63d6b7abbb..8c99baa5c5 100644 --- a/web/src/components/chat/FederatedOAuthModal.tsx +++ b/web/src/components/chat/FederatedOAuthModal.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { useTranslations } from "next-intl"; import { Card, Modal } from "@opal/components"; import { Button } from "@opal/components"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { useSettings } from "@/lib/settings/hooks"; import { getSourceMetadata } from "@/lib/sources"; import useFederatedOAuthStatus from "@/hooks/useFederatedOAuthStatus"; diff --git a/web/src/components/filters/SourceSelector.tsx b/web/src/components/filters/SourceSelector.tsx index 5e39b48c3c..2a7dc097b2 100644 --- a/web/src/components/filters/SourceSelector.tsx +++ b/web/src/components/filters/SourceSelector.tsx @@ -1,5 +1,6 @@ import React, { JSX } from "react"; -import { DocumentSetSummary, Tag, ValidSources } from "@/lib/types"; +import { DocumentSetSummary, Tag } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SourceMetadata } from "@/lib/search/types"; import { FiBook, FiBookmark, FiMap, FiX } from "react-icons/fi"; import { SearchDateRangeSelector } from "@/components/dateRangeSelectors/SearchDateRangeSelector"; diff --git a/web/src/components/search/DocumentDisplay.tsx b/web/src/components/search/DocumentDisplay.tsx index 5e86f57f60..5257e145f4 100644 --- a/web/src/components/search/DocumentDisplay.tsx +++ b/web/src/components/search/DocumentDisplay.tsx @@ -8,7 +8,7 @@ import { WebResultIcon } from "../WebResultIcon"; import Text from "@/refresh-components/texts/Text"; import { openDocument } from "@/lib/search/utils"; import { SubQuestionDetail } from "@/app/app/interfaces"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { Card } from "@/components/ui/card"; export const buildDocumentSummaryDisplay = ( diff --git a/web/src/ee/sections/SearchCard.tsx b/web/src/ee/sections/SearchCard.tsx index 61e84403a2..2e8da31a64 100644 --- a/web/src/ee/sections/SearchCard.tsx +++ b/web/src/ee/sections/SearchCard.tsx @@ -6,7 +6,7 @@ import { WebResultIcon } from "@/components/WebResultIcon"; import Text from "@/refresh-components/texts/Text"; import Chip from "@/refresh-components/Chip"; import { buildDocumentSummaryDisplay } from "@/components/search/DocumentDisplay"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { MinimalOnyxDocument } from "@/lib/search/types"; import { Section } from "@/layouts/general-layouts"; import { Interactive } from "@opal/core"; diff --git a/web/src/ee/sections/SearchUI.tsx b/web/src/ee/sections/SearchUI.tsx index c949fbab45..44c898828d 100644 --- a/web/src/ee/sections/SearchUI.tsx +++ b/web/src/ee/sections/SearchUI.tsx @@ -9,7 +9,8 @@ import { EmptyMessageCard } from "@opal/components"; import { IllustrationContent, toast } from "@opal/layouts"; import SvgNoResult from "@opal/illustrations/no-result"; import { getSourceMetadata } from "@/lib/sources"; -import { Tag, ValidSources } from "@/lib/types"; +import { Tag } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { countDocumentsBySource, documentMatchesAnySource, diff --git a/web/src/lib/agents/types.ts b/web/src/lib/agents/types.ts index 3a3c1ca795..cc449be7e6 100644 --- a/web/src/lib/agents/types.ts +++ b/web/src/lib/agents/types.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { ToolSnapshot } from "@/lib/tools/types"; import { DocumentSetSummary, MinimalUserSnapshot } from "@/lib/types"; import type { PermissionsOf } from "@/lib/permissions/resource-actions"; diff --git a/web/src/lib/connector.ts b/web/src/lib/connector.ts index b261867d3f..c84d1a5028 100644 --- a/web/src/lib/connector.ts +++ b/web/src/lib/connector.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "./types"; +import { ValidSources } from "@/lib/connectors/types/source"; import type { Connector, ConnectorBase, diff --git a/web/src/lib/connectors/AutoSyncOptionFields.tsx b/web/src/lib/connectors/AutoSyncOptionFields.tsx index b81adfc9f6..4c2f5e790a 100644 --- a/web/src/lib/connectors/AutoSyncOptionFields.tsx +++ b/web/src/lib/connectors/AutoSyncOptionFields.tsx @@ -1,5 +1,5 @@ import { JSX } from "react"; -import { ValidAutoSyncSource } from "@/lib/types"; +import type { ValidAutoSyncSource } from "@/lib/connectors/types/source"; interface AutoSyncConfig { notice?: string; diff --git a/web/src/lib/connectors/components/CredentialsConfigurer.tsx b/web/src/lib/connectors/components/CredentialsConfigurer.tsx index 23035bfa7a..cfe7ca500e 100644 --- a/web/src/lib/connectors/components/CredentialsConfigurer.tsx +++ b/web/src/lib/connectors/components/CredentialsConfigurer.tsx @@ -15,7 +15,8 @@ import { CredentialCreationMethod, shouldRedirectToOAuth, } from "@/lib/credentials/credentialCreation"; -import type { AccessType, ConfigurableSources } from "@/lib/types"; +import type { AccessType } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; export interface CredentialsConfigurerProps { /** The source being set up. */ diff --git a/web/src/lib/connectors/connectors.tsx b/web/src/lib/connectors/connectors.tsx index a5f795a689..aa4c515171 100644 --- a/web/src/lib/connectors/connectors.tsx +++ b/web/src/lib/connectors/connectors.tsx @@ -1,12 +1,12 @@ -import { ConfigurableSources } from "../types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import { DOCS_ADMINS_PATH } from "@/lib/constants"; import { useTranslations } from "next-intl"; import type { BooleanOption, ConnectionConfiguration, ListOption, -} from "./types"; -import { OneDriveScope } from "./types"; +} from "@/lib/connectors/types"; +import { OneDriveScope } from "@/lib/connectors/types"; const DEFAULT_MICROSOFT_AUTHORITY_HOST = "https://login.microsoftonline.com"; const DEFAULT_MICROSOFT_GRAPH_API_HOST = "https://graph.microsoft.com"; diff --git a/web/src/lib/connectors/constants.ts b/web/src/lib/connectors/constants.ts index 633b4d834f..cafc2c09c0 100644 --- a/web/src/lib/connectors/constants.ts +++ b/web/src/lib/connectors/constants.ts @@ -1,5 +1,5 @@ import { SourceCategory } from "@/lib/search/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; /** * Message key, inside the `admin.addConnector` namespace, for each category diff --git a/web/src/lib/connectors/credentials.ts b/web/src/lib/connectors/credentials.ts index 28c34ddd36..81e425559a 100644 --- a/web/src/lib/connectors/credentials.ts +++ b/web/src/lib/connectors/credentials.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "../types"; +import { ValidSources } from "@/lib/connectors/types/source"; import type { AirtableCredentialJson, AsanaCredentialJson, @@ -53,7 +53,7 @@ import type { ZendeskCredentialJson, ZoomCredentialJson, ZulipCredentialJson, -} from "./types"; +} from "@/lib/connectors/types"; // Gmail and Google Drive use dedicated credential UIs, so their templates are partial. type CredentialTemplateMap = Record & { diff --git a/web/src/lib/connectors/fileTypes.ts b/web/src/lib/connectors/fileTypes.ts index c00f46080a..61caf35a66 100644 --- a/web/src/lib/connectors/fileTypes.ts +++ b/web/src/lib/connectors/fileTypes.ts @@ -1,5 +1,5 @@ -import { FileTypeCategory } from "./types"; -import type { FileTypeDefinition } from "./types"; +import { FileTypeCategory } from "@/lib/connectors/types"; +import type { FileTypeDefinition } from "@/lib/connectors/types"; export const FILE_TYPE_DEFINITIONS: Record< FileTypeCategory, diff --git a/web/src/lib/connectors/hooks.ts b/web/src/lib/connectors/hooks.ts index d42009693a..d138360da7 100644 --- a/web/src/lib/connectors/hooks.ts +++ b/web/src/lib/connectors/hooks.ts @@ -22,7 +22,7 @@ import { NEXT_PUBLIC_CLOUD_ENABLED, NEXT_PUBLIC_TEST_ENV, } from "@/lib/constants"; -import { oauthSupportedSources } from "@/lib/types"; +import { oauthSupportedSources } from "@/lib/connectors/types/source"; import type { AnyCredential, Credential, @@ -37,11 +37,13 @@ import type { import { errorHandlingFetcher } from "@/lib/fetcher"; import { SWR_KEYS } from "@/lib/swr-keys"; import type { - ConfigurableSources, CredentialSchemaResponse, FederatedConnectorDetail, - ValidSources, } from "@/lib/types"; +import type { + ConfigurableSources, + ValidSources, +} from "@/lib/connectors/types/source"; /** How often the credential lists re-poll, in milliseconds. */ const CREDENTIALS_REFRESH_INTERVAL_MS = 5000; diff --git a/web/src/lib/connectors/onedrive.test.ts b/web/src/lib/connectors/onedrive.test.ts index 13561d011c..f0d3a302c6 100644 --- a/web/src/lib/connectors/onedrive.test.ts +++ b/web/src/lib/connectors/onedrive.test.ts @@ -7,7 +7,10 @@ import { } from "@/lib/connectors/utils"; import { FileTypeCategory, OneDriveScope } from "@/lib/connectors/types"; import { getSourceDocLink, getSourceMetadata } from "@/lib/sources"; -import { ValidSources, validAutoSyncSources } from "@/lib/types"; +import { + ValidSources, + validAutoSyncSources, +} from "@/lib/connectors/types/source"; const ONE_DRIVE_USERS_REQUIRED = "Add at least one user for Specific scope"; diff --git a/web/src/lib/connectors/svc.oauth.test.ts b/web/src/lib/connectors/svc.oauth.test.ts index 8268f6f6fb..8c091edc74 100644 --- a/web/src/lib/connectors/svc.oauth.test.ts +++ b/web/src/lib/connectors/svc.oauth.test.ts @@ -1,5 +1,5 @@ import { getConnectorOauthRedirectUrl } from "@/lib/connectors/svc"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; const SALESFORCE_URL_ERROR = "Invalid OAuth configuration: Salesforce URL must use HTTPS"; diff --git a/web/src/lib/connectors/svc.ts b/web/src/lib/connectors/svc.ts index 0344e7fbc8..a59dbf7eea 100644 --- a/web/src/lib/connectors/svc.ts +++ b/web/src/lib/connectors/svc.ts @@ -6,7 +6,8 @@ import { parseErrorDetail, type ErrorResponseBody } from "@/lib/fetcher"; import type { FileUploadResponse } from "@/lib/fileConnector"; import { buildCCPairInfoUrl } from "@/lib/connectors/utils"; import type { FileConfig, GoogleSitesConfig } from "@/lib/connectors/types"; -import { AccessType, ValidSources } from "@/lib/types"; +import { AccessType } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; // --------------------------------------------------------------------------- // Indexing diff --git a/web/src/lib/connectors/types/ccPair.ts b/web/src/lib/connectors/types/ccPair.ts index 973325c98d..0cd5238365 100644 --- a/web/src/lib/connectors/types/ccPair.ts +++ b/web/src/lib/connectors/types/ccPair.ts @@ -6,8 +6,8 @@ import type { IndexAttemptSnapshot, ValidStatuses, } from "@/lib/types"; -import type { Connector } from "./connector"; -import type { Credential } from "./credential"; +import type { Connector } from "@/lib/connectors/types/connector"; +import type { Credential } from "@/lib/connectors/types/credential"; export enum ConnectorCredentialPairStatus { SCHEDULED = "SCHEDULED", diff --git a/web/src/lib/connectors/types/connector.ts b/web/src/lib/connectors/types/connector.ts index 9e25e2754f..fcb8f987ca 100644 --- a/web/src/lib/connectors/types/connector.ts +++ b/web/src/lib/connectors/types/connector.ts @@ -1,4 +1,5 @@ -import type { ValidInputTypes, ValidSources } from "@/lib/types"; +import type { ValidInputTypes } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; export interface ConnectorBase { name: string; diff --git a/web/src/lib/connectors/types/credential.ts b/web/src/lib/connectors/types/credential.ts index ba8da49dcd..d3dab9bc36 100644 --- a/web/src/lib/connectors/types/credential.ts +++ b/web/src/lib/connectors/types/credential.ts @@ -1,10 +1,8 @@ import type { SWRResponse } from "swr"; - import type { CredentialCreationMethod } from "@/lib/credentials/credentialCreation"; import type { CredentialFieldValues } from "@/lib/credentials/types"; - -import type { ValidSources } from "@/lib/types"; -import type { TypedFile } from "../fileTypes"; +import type { ValidSources } from "@/lib/connectors/types/source"; +import type { TypedFile } from "@/lib/connectors/fileTypes"; export interface OAuthAdditionalKwargDescription { name: string; diff --git a/web/src/lib/connectors/types/credentialJson.ts b/web/src/lib/connectors/types/credentialJson.ts index 1b89253eaf..d1a8da4763 100644 --- a/web/src/lib/connectors/types/credentialJson.ts +++ b/web/src/lib/connectors/types/credentialJson.ts @@ -1,5 +1,5 @@ /** The `credential_json` shape of each source. */ -import type { TypedFile } from "../fileTypes"; +import type { TypedFile } from "@/lib/connectors/fileTypes"; export interface GithubCredentialJson { github_access_token: string; diff --git a/web/src/lib/connectors/types/form.ts b/web/src/lib/connectors/types/form.ts index ab35c5c929..6138777bbb 100644 --- a/web/src/lib/connectors/types/form.ts +++ b/web/src/lib/connectors/types/form.ts @@ -1,5 +1,5 @@ /** The schema a connector's creation form is rendered from. */ -import type { Credential } from "./credential"; +import type { Credential } from "@/lib/connectors/types/credential"; export type InputType = | "list" diff --git a/web/src/lib/connectors/types/index.ts b/web/src/lib/connectors/types/index.ts index 91a9d646b9..e4c7f1b618 100644 --- a/web/src/lib/connectors/types/index.ts +++ b/web/src/lib/connectors/types/index.ts @@ -1,8 +1,9 @@ -export * from "./ccPair"; -export * from "./connector"; -export * from "./connectorConfig"; -export * from "./credential"; -export * from "./credentialJson"; -export * from "./fileTypes"; -export * from "./form"; -export * from "./stageMetrics"; +export * from "@/lib/connectors/types/ccPair"; +export * from "@/lib/connectors/types/connector"; +export * from "@/lib/connectors/types/connectorConfig"; +export * from "@/lib/connectors/types/credential"; +export * from "@/lib/connectors/types/credentialJson"; +export * from "@/lib/connectors/types/fileTypes"; +export * from "@/lib/connectors/types/form"; +export * from "@/lib/connectors/types/source"; +export * from "@/lib/connectors/types/stageMetrics"; diff --git a/web/src/lib/connectors/types/source.ts b/web/src/lib/connectors/types/source.ts new file mode 100644 index 0000000000..0a0b97251a --- /dev/null +++ b/web/src/lib/connectors/types/source.ts @@ -0,0 +1,123 @@ +/** + * The sources a connector can index, and the sets carved out of them. + * + * These live with the connectors library rather than in the shared types + * grab-bag: everything here is about what a connector can point at, and + * nothing outside the connector surface defines a source. + */ + +export enum ValidSources { + Web = "web", + GitHub = "github", + GitLab = "gitlab", + Slack = "slack", + GoogleDrive = "google_drive", + Gmail = "gmail", + Bookstack = "bookstack", + Outline = "outline", + Confluence = "confluence", + Jira = "jira", + Productboard = "productboard", + Slab = "slab", + Coda = "coda", + Notion = "notion", + Guru = "guru", + Gong = "gong", + Zulip = "zulip", + Linear = "linear", + Hubspot = "hubspot", + Document360 = "document360", + File = "file", + UserFile = "user_file", + GoogleSites = "google_sites", + Loopio = "loopio", + Box = "box", + Dropbox = "dropbox", + Discord = "discord", + Salesforce = "salesforce", + Sharepoint = "sharepoint", + OneDrive = "onedrive", + Teams = "teams", + Outlook = "outlook", + Zendesk = "zendesk", + Discourse = "discourse", + Axero = "axero", + Clickup = "clickup", + Wikipedia = "wikipedia", + Mediawiki = "mediawiki", + Asana = "asana", + S3 = "s3", + R2 = "r2", + GoogleCloudStorage = "google_cloud_storage", + Xenforo = "xenforo", + OciStorage = "oci_storage", + NotApplicable = "not_applicable", + IngestionApi = "ingestion_api", + Freshdesk = "freshdesk", + Fireflies = "fireflies", + Egnyte = "egnyte", + Airtable = "airtable", + Gitbook = "gitbook", + Highspot = "highspot", + DrupalWiki = "drupal_wiki", + Imap = "imap", + Bitbucket = "bitbucket", + TestRail = "testrail", + Braintrust = "braintrust", + Lumapps = "lumapps", + Canvas = "canvas", + Zoom = "zoom", + + // Craft-specific sources + CraftFile = "craft_file", + + // Federated Connectors + FederatedSlack = "federated_slack", +} + +export const federatedSourceToRegularSource = ( + maybeFederatedSource: ValidSources +): ValidSources => { + if (maybeFederatedSource === ValidSources.FederatedSlack) { + return ValidSources.Slack; + } + return maybeFederatedSource; +}; + +export const validAutoSyncSources = [ + ValidSources.Confluence, + ValidSources.Jira, + ValidSources.GoogleDrive, + ValidSources.Gmail, + ValidSources.Slack, + ValidSources.Salesforce, + ValidSources.GitHub, + ValidSources.Sharepoint, + ValidSources.Teams, + ValidSources.Outlook, + ValidSources.Canvas, + ValidSources.Box, + ValidSources.OneDrive, + ValidSources.Zoom, +] as const; + +// Create a type from the array elements +export type ValidAutoSyncSource = (typeof validAutoSyncSources)[number]; + +export type ConfigurableSources = Exclude< + ValidSources, + | ValidSources.NotApplicable + | ValidSources.IngestionApi + | ValidSources.FederatedSlack // is part of ValiedSources.Slack + | ValidSources.UserFile + | ValidSources.CraftFile // User Library - managed through dedicated UI +>; + +export const oauthSupportedSources: ConfigurableSources[] = [ + ValidSources.Slack, + // NOTE: temporarily disabled until our GDrive App is approved + // ValidSources.GoogleDrive, + ValidSources.Confluence, +]; + +export type OAuthSupportedSource = (typeof oauthSupportedSources)[number]; diff --git a/web/src/lib/connectors/utils.ts b/web/src/lib/connectors/utils.ts index c0e65b939b..70204240ff 100644 --- a/web/src/lib/connectors/utils.ts +++ b/web/src/lib/connectors/utils.ts @@ -1,12 +1,9 @@ import * as Yup from "yup"; import type { AccessTypeGroupSelectorFormType } from "@/components/admin/connectors/AccessTypeGroupSelector"; import type { ConnectorGroupRestrictionFormValues } from "@/lib/connectors/accessType"; -import { ValidSources } from "@/lib/types"; -import type { - ConfigurableSources, - IndexAttemptStage, - IndexAttemptStageMetric, -} from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; +import type { IndexAttemptStage, IndexAttemptStageMetric } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import { SWR_KEYS } from "@/lib/swr-keys"; import { connectorConfigs } from "@/lib/connectors/connectors"; import { credentialDisplayNames } from "@/lib/connectors/credentials"; diff --git a/web/src/lib/connectors/zoomConnectorConfig.test.tsx b/web/src/lib/connectors/zoomConnectorConfig.test.tsx index 2df90bc8ca..220764e9e6 100644 --- a/web/src/lib/connectors/zoomConnectorConfig.test.tsx +++ b/web/src/lib/connectors/zoomConnectorConfig.test.tsx @@ -6,7 +6,7 @@ import { createConnectorInitialValues, createConnectorValidationSchema, } from "@/lib/connectors/utils"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; function ZoomForm() { const config = connectorConfigs.zoom; diff --git a/web/src/lib/credentials/components/CreateCredential.tsx b/web/src/lib/credentials/components/CreateCredential.tsx index ef09600442..88a976faf6 100644 --- a/web/src/lib/credentials/components/CreateCredential.tsx +++ b/web/src/lib/credentials/components/CreateCredential.tsx @@ -1,7 +1,8 @@ import { useState } from "react"; import { useTranslations } from "next-intl"; import { Button as OpalButton } from "@opal/components"; -import { ValidSources, AccessType } from "@/lib/types"; +import { AccessType } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { submitCredential } from "@/components/admin/connectors/CredentialForm"; import { TextFormField } from "@/components/Field"; import { Form, Formik, FormikHelpers } from "formik"; diff --git a/web/src/lib/credentials/components/CreateStdOAuthCredential.tsx b/web/src/lib/credentials/components/CreateStdOAuthCredential.tsx index 8e8755c7ef..8a72f60cd8 100644 --- a/web/src/lib/credentials/components/CreateStdOAuthCredential.tsx +++ b/web/src/lib/credentials/components/CreateStdOAuthCredential.tsx @@ -8,7 +8,7 @@ import { useTranslations } from "next-intl"; import type { OAuthAdditionalKwargDescription } from "@/lib/connectors/types"; import { getConnectorOauthRedirectUrl } from "@/lib/connectors/svc"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { FormikField } from "@/refresh-components/form/FormikField"; type OAuthFormValues = Record; diff --git a/web/src/lib/credentials/components/CredentialSection.tsx b/web/src/lib/credentials/components/CredentialSection.tsx index 367da1cc03..bb5edc7f1c 100644 --- a/web/src/lib/credentials/components/CredentialSection.tsx +++ b/web/src/lib/credentials/components/CredentialSection.tsx @@ -1,6 +1,7 @@ "use client"; -import { AccessType, ValidSources } from "@/lib/types"; +import { AccessType } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { useTranslations } from "next-intl"; import useSWR, { mutate } from "swr"; import { errorHandlingFetcher, type ErrorResponseBody } from "@/lib/fetcher"; diff --git a/web/src/lib/credentials/components/EditCredential.tsx b/web/src/lib/credentials/components/EditCredential.tsx index 892ba6ab21..4980d7eb9d 100644 --- a/web/src/lib/credentials/components/EditCredential.tsx +++ b/web/src/lib/credentials/components/EditCredential.tsx @@ -17,7 +17,7 @@ import type { CredentialFieldValues, CredentialFormValues, } from "@/lib/credentials/types"; -import type { ValidSources } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; export interface EditCredentialProps { credential: Credential; diff --git a/web/src/lib/credentials/utils.test.ts b/web/src/lib/credentials/utils.test.ts index 5a9812dc96..b543a574d4 100644 --- a/web/src/lib/credentials/utils.test.ts +++ b/web/src/lib/credentials/utils.test.ts @@ -1,7 +1,7 @@ import { credentialTemplates } from "@/lib/connectors/credentials"; import type { Credential } from "@/lib/connectors/types"; import type { CredentialFieldValues } from "@/lib/credentials/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { canEditCredentialWithForm, diff --git a/web/src/lib/credentials/utils.ts b/web/src/lib/credentials/utils.ts index 0bf48ec035..3c946f01af 100644 --- a/web/src/lib/credentials/utils.ts +++ b/web/src/lib/credentials/utils.ts @@ -11,7 +11,7 @@ import type { CredentialFieldValues, CredentialFormValues, } from "@/lib/credentials/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; // What a credential template seeds a field with: "" for a required text // field, null for an optional one or a file, a boolean for a checkbox. diff --git a/web/src/lib/googleConnector.ts b/web/src/lib/googleConnector.ts index 7a31d1b565..d8be6856e1 100644 --- a/web/src/lib/googleConnector.ts +++ b/web/src/lib/googleConnector.ts @@ -3,7 +3,7 @@ import { toast } from "@opal/layouts"; import { FetchError, errorHandlingFetcher } from "@/lib/fetcher"; import type { Credential } from "@/lib/connectors/types"; import type { ConnectorSnapshot } from "@/lib/connectors/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { refreshSourceCredentials, useSourceCredentials, diff --git a/web/src/lib/hierarchy/svc.ts b/web/src/lib/hierarchy/svc.ts index 0bb7236374..9b0efff8db 100644 --- a/web/src/lib/hierarchy/svc.ts +++ b/web/src/lib/hierarchy/svc.ts @@ -1,11 +1,11 @@ import type { ErrorResponseBody } from "@/lib/fetcher"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { HierarchyNodesResponse, HierarchyNodeDocumentsRequest, HierarchyNodeDocumentsResponse, HierarchyNodeSearchResponse, -} from "./interfaces"; +} from "@/lib/hierarchy/types"; const HIERARCHY_NODES_PREFIX = "/api/hierarchy-nodes"; diff --git a/web/src/lib/hierarchy/interfaces.ts b/web/src/lib/hierarchy/types.ts similarity index 97% rename from web/src/lib/hierarchy/interfaces.ts rename to web/src/lib/hierarchy/types.ts index 58ff7cb6a8..f019241dd0 100644 --- a/web/src/lib/hierarchy/interfaces.ts +++ b/web/src/lib/hierarchy/types.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; // Sort options for document pagination export type DocumentSortField = "name" | "last_updated"; diff --git a/web/src/lib/hooks.ts b/web/src/lib/hooks.ts index fe65bc42fb..bb50da54a5 100644 --- a/web/src/lib/hooks.ts +++ b/web/src/lib/hooks.ts @@ -6,10 +6,10 @@ import { UserGroup, ConnectorStatus, FederatedConnectorDetail, - ValidSources, ConnectorIndexingStatusLiteResponse, IndexingStatusRequest, } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import useSWR, { mutate, useSWRConfig } from "swr"; import { errorHandlingFetcher } from "./fetcher"; import { diff --git a/web/src/lib/search/navigationSecurity.test.tsx b/web/src/lib/search/navigationSecurity.test.tsx index 071c14fe0f..126bba9854 100644 --- a/web/src/lib/search/navigationSecurity.test.tsx +++ b/web/src/lib/search/navigationSecurity.test.tsx @@ -1,5 +1,5 @@ import { openDocument } from "@/lib/search/utils"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; it.each([ "javascript:alert(1)", diff --git a/web/src/lib/search/types.ts b/web/src/lib/search/types.ts index a29af32ee8..7dbb485e2c 100644 --- a/web/src/lib/search/types.ts +++ b/web/src/lib/search/types.ts @@ -1,5 +1,6 @@ import { InputDateRangePickerValue } from "@opal/components"; -import { Tag, ValidSources } from "../types"; +import { Tag } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { Agent } from "@/lib/agents/types"; export const FlowType = { diff --git a/web/src/lib/search/utils.test.ts b/web/src/lib/search/utils.test.ts index adfe533d91..82622a1c23 100644 --- a/web/src/lib/search/utils.test.ts +++ b/web/src/lib/search/utils.test.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "../types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { OnyxDocument } from "@/lib/search/types"; import { countDocumentsBySource, diff --git a/web/src/lib/search/utils.ts b/web/src/lib/search/utils.ts index 9a51f1cfbe..38dc56f096 100644 --- a/web/src/lib/search/utils.ts +++ b/web/src/lib/search/utils.ts @@ -1,4 +1,4 @@ -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { MinimalOnyxDocument, OnyxDocument } from "@/lib/search/types"; import { transformLinkUri } from "@/lib/utils"; diff --git a/web/src/lib/searchFilters/utils.ts b/web/src/lib/searchFilters/utils.ts index 86cbcd8464..563e1144f4 100644 --- a/web/src/lib/searchFilters/utils.ts +++ b/web/src/lib/searchFilters/utils.ts @@ -1,4 +1,5 @@ -import type { Tag, ValidSources } from "@/lib/types"; +import type { Tag } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import type { MinimalAgent } from "@/lib/agents/types"; import type { ChatSearchFilters } from "@/lib/tools/types"; import { isAssistant } from "@/lib/agents/utils"; diff --git a/web/src/lib/sources.ts b/web/src/lib/sources.ts index 7b44830251..df832a0c3d 100644 --- a/web/src/lib/sources.ts +++ b/web/src/lib/sources.ts @@ -5,7 +5,7 @@ import { BraintrustIcon, BoxIcon, } from "@/components/icons/icons"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { SourceCategory, SourceMetadata } from "@/lib/search/types"; import React from "react"; import { DOCS_ADMINS_PATH, DOCS_BASE_URL } from "@/lib/constants"; diff --git a/web/src/lib/tools/providers.tsx b/web/src/lib/tools/providers.tsx index 8b16dfe744..3db431768f 100644 --- a/web/src/lib/tools/providers.tsx +++ b/web/src/lib/tools/providers.tsx @@ -11,7 +11,7 @@ import { } from "@/lib/searchFilters/utils"; import { getConfiguredSources } from "@/lib/sources"; import type { ToolConfigurationHandle } from "@/lib/tools/hooks"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; /** A source the picker can show: {@link getConfiguredSources} guarantees a key. */ type ConfiguredSource = ReturnType[number]; diff --git a/web/src/lib/tools/toolConfiguration.test.tsx b/web/src/lib/tools/toolConfiguration.test.tsx index bfc1583b56..0921869b1d 100644 --- a/web/src/lib/tools/toolConfiguration.test.tsx +++ b/web/src/lib/tools/toolConfiguration.test.tsx @@ -7,7 +7,7 @@ import { normalizeSourceSelection, } from "@/lib/searchFilters/utils"; import type { SourceMetadata } from "@/lib/search/types"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; const CHAT_KEY = "onyx:tools:chat:abc"; diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index 8a295c411c..4c4c194f34 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -5,6 +5,9 @@ import type { Credential } from "@/lib/connectors/types"; import type { Connector } from "@/lib/connectors/types"; import { ConnectorCredentialPairStatus } from "@/lib/connectors/types"; import type { PermissionsOf } from "@/lib/permissions/resource-actions"; +// Imported from the module itself, not the barrel: the barrel re-exports +// shapes that import from here, and the enum is a runtime value. +import { ValidSources } from "@/lib/connectors/types/source"; export enum ThemePreference { LIGHT = "light", @@ -599,122 +602,6 @@ export interface SecuritySettings { jwt_expected_issuer: string | null; } -export enum ValidSources { - Web = "web", - GitHub = "github", - GitLab = "gitlab", - Slack = "slack", - GoogleDrive = "google_drive", - Gmail = "gmail", - Bookstack = "bookstack", - Outline = "outline", - Confluence = "confluence", - Jira = "jira", - Productboard = "productboard", - Slab = "slab", - Coda = "coda", - Notion = "notion", - Guru = "guru", - Gong = "gong", - Zulip = "zulip", - Linear = "linear", - Hubspot = "hubspot", - Document360 = "document360", - File = "file", - UserFile = "user_file", - GoogleSites = "google_sites", - Loopio = "loopio", - Box = "box", - Dropbox = "dropbox", - Discord = "discord", - Salesforce = "salesforce", - Sharepoint = "sharepoint", - OneDrive = "onedrive", - Teams = "teams", - Outlook = "outlook", - Zendesk = "zendesk", - Discourse = "discourse", - Axero = "axero", - Clickup = "clickup", - Wikipedia = "wikipedia", - Mediawiki = "mediawiki", - Asana = "asana", - S3 = "s3", - R2 = "r2", - GoogleCloudStorage = "google_cloud_storage", - Xenforo = "xenforo", - OciStorage = "oci_storage", - NotApplicable = "not_applicable", - IngestionApi = "ingestion_api", - Freshdesk = "freshdesk", - Fireflies = "fireflies", - Egnyte = "egnyte", - Airtable = "airtable", - Gitbook = "gitbook", - Highspot = "highspot", - DrupalWiki = "drupal_wiki", - Imap = "imap", - Bitbucket = "bitbucket", - TestRail = "testrail", - Braintrust = "braintrust", - Lumapps = "lumapps", - Canvas = "canvas", - Zoom = "zoom", - - // Craft-specific sources - CraftFile = "craft_file", - - // Federated Connectors - FederatedSlack = "federated_slack", -} - -export const federatedSourceToRegularSource = ( - maybeFederatedSource: ValidSources -): ValidSources => { - if (maybeFederatedSource === ValidSources.FederatedSlack) { - return ValidSources.Slack; - } - return maybeFederatedSource; -}; - -export const validAutoSyncSources = [ - ValidSources.Confluence, - ValidSources.Jira, - ValidSources.GoogleDrive, - ValidSources.Gmail, - ValidSources.Slack, - ValidSources.Salesforce, - ValidSources.GitHub, - ValidSources.Sharepoint, - ValidSources.Teams, - ValidSources.Outlook, - ValidSources.Canvas, - ValidSources.Box, - ValidSources.OneDrive, - ValidSources.Zoom, -] as const; - -// Create a type from the array elements -export type ValidAutoSyncSource = (typeof validAutoSyncSources)[number]; - -export type ConfigurableSources = Exclude< - ValidSources, - | ValidSources.NotApplicable - | ValidSources.IngestionApi - | ValidSources.FederatedSlack // is part of ValiedSources.Slack - | ValidSources.UserFile - | ValidSources.CraftFile // User Library - managed through dedicated UI ->; - -export const oauthSupportedSources: ConfigurableSources[] = [ - ValidSources.Slack, - // NOTE: temporarily disabled until our GDrive App is approved - // ValidSources.GoogleDrive, - ValidSources.Confluence, -]; - -export type OAuthSupportedSource = (typeof oauthSupportedSources)[number]; - // Federated Connector Types export interface CredentialFieldSpec { type: string; diff --git a/web/src/refresh-components/buttons/source-tag/SourceTag.tsx b/web/src/refresh-components/buttons/source-tag/SourceTag.tsx index 4085bc3c10..0dfd758ecb 100644 --- a/web/src/refresh-components/buttons/source-tag/SourceTag.tsx +++ b/web/src/refresh-components/buttons/source-tag/SourceTag.tsx @@ -20,7 +20,7 @@ import { } from "@/components/ui/tooltip"; import { SourceIcon } from "@/components/SourceIcon"; import { WebResultIcon } from "@/components/WebResultIcon"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import SourceTagDetailsCard, { SourceInfo, } from "@/refresh-components/buttons/source-tag/SourceTagDetailsCard"; diff --git a/web/src/refresh-components/buttons/source-tag/SourceTagDetailsCard.tsx b/web/src/refresh-components/buttons/source-tag/SourceTagDetailsCard.tsx index ec0f704668..f9ee0819ea 100644 --- a/web/src/refresh-components/buttons/source-tag/SourceTagDetailsCard.tsx +++ b/web/src/refresh-components/buttons/source-tag/SourceTagDetailsCard.tsx @@ -11,7 +11,7 @@ import { } from "@opal/icons"; import { SourceIcon } from "@/components/SourceIcon"; import { WebResultIcon } from "@/components/WebResultIcon"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { timeAgo } from "@opal/time"; import { useLocale } from "next-intl"; import type { IconProps } from "@opal/types"; diff --git a/web/src/refresh-components/buttons/source-tag/sourceTagUtils.ts b/web/src/refresh-components/buttons/source-tag/sourceTagUtils.ts index d6f6a1bfce..aabd2e3fa6 100644 --- a/web/src/refresh-components/buttons/source-tag/sourceTagUtils.ts +++ b/web/src/refresh-components/buttons/source-tag/sourceTagUtils.ts @@ -1,7 +1,7 @@ import { OnyxDocument } from "@/lib/search/types"; import { SubQuestionDetail } from "@/app/app/interfaces"; import { StreamingCitation } from "@/app/app/services/streamingModels"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { getSourceDisplayName } from "@/lib/sources"; import { SourceInfo } from "./SourceTagDetailsCard"; diff --git a/web/src/sections/document-sidebar/ChatDocumentDisplay.tsx b/web/src/sections/document-sidebar/ChatDocumentDisplay.tsx index 7ecb7d90e4..273a379408 100644 --- a/web/src/sections/document-sidebar/ChatDocumentDisplay.tsx +++ b/web/src/sections/document-sidebar/ChatDocumentDisplay.tsx @@ -7,7 +7,7 @@ import { MetadataBadge } from "@/components/MetadataBadge"; import { WebResultIcon } from "@/components/WebResultIcon"; import { Dispatch, SetStateAction, useMemo } from "react"; import { openDocument } from "@/lib/search/utils"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { cn } from "@opal/utils"; import Truncated from "@/refresh-components/texts/Truncated"; import Text from "@/refresh-components/texts/Text"; diff --git a/web/src/sections/knowledge/AgentKnowledgePane.tsx b/web/src/sections/knowledge/AgentKnowledgePane.tsx index 1225037b68..c17c8a93b8 100644 --- a/web/src/sections/knowledge/AgentKnowledgePane.tsx +++ b/web/src/sections/knowledge/AgentKnowledgePane.tsx @@ -19,9 +19,10 @@ import type { import type { ConnectedSource, HierarchyNodeSearchSummary, -} from "@/lib/hierarchy/interfaces"; +} from "@/lib/hierarchy/types"; import type { ProjectFile } from "@/lib/projects/types"; -import type { DocumentSetSummary, ValidSources } from "@/lib/types"; +import type { DocumentSetSummary } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import { searchDocuments } from "@/ee/lib/search/svc"; import { Disabled } from "@opal/core"; import { Card, InputSwitch } from "@opal/components"; @@ -39,7 +40,7 @@ import type { KnowledgeNavState, KnowledgeSearchResults, KnowledgeView, -} from "@/sections/knowledge/agent-knowledge/interfaces"; +} from "@/sections/knowledge/agent-knowledge/types"; interface AgentKnowledgePaneProps { enableKnowledge: boolean; diff --git a/web/src/sections/knowledge/SourceHierarchyBrowser.tsx b/web/src/sections/knowledge/SourceHierarchyBrowser.tsx index d040b303dd..9f29544a1a 100644 --- a/web/src/sections/knowledge/SourceHierarchyBrowser.tsx +++ b/web/src/sections/knowledge/SourceHierarchyBrowser.tsx @@ -36,7 +36,7 @@ import { SvgFilter, } from "@opal/icons"; import { getSourceMetadata } from "@/lib/sources"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { HierarchyNodeSummary, DocumentSummary, @@ -46,7 +46,7 @@ import { DocumentSortField, DocumentSortDirection, FolderPosition, -} from "@/lib/hierarchy/interfaces"; +} from "@/lib/hierarchy/types"; import { fetchHierarchyNodes, fetchHierarchyNodeDocuments, diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeAddView.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeAddView.tsx index 395616bb26..bbdab0227d 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeAddView.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeAddView.tsx @@ -5,8 +5,8 @@ import { useTranslations } from "next-intl"; import * as GeneralLayouts from "@/layouts/general-layouts"; import Text from "@/refresh-components/texts/Text"; import { getSourceMetadata } from "@/lib/sources"; -import type { ConnectedSource } from "@/lib/hierarchy/interfaces"; -import type { ValidSources } from "@/lib/types"; +import type { ConnectedSource } from "@/lib/hierarchy/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import { LineItemButton } from "@opal/components"; import { SvgFiles, SvgFolder } from "@opal/icons"; diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeMainContent.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeMainContent.tsx index a3bea7e562..4ed4094c87 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeMainContent.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeMainContent.tsx @@ -4,7 +4,7 @@ import { memo } from "react"; import { useTranslations } from "next-intl"; import * as GeneralLayouts from "@/layouts/general-layouts"; import Text from "@/refresh-components/texts/Text"; -import type { ValidSources } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import { Button } from "@opal/components"; import { SvgArrowUpRight, SvgPlusCircle } from "@opal/icons"; diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeSearch.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeSearch.tsx index b2f22df6c2..779eb11b96 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeSearch.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeSearch.tsx @@ -10,9 +10,9 @@ import { getSourceMetadata } from "@/lib/sources"; import type { ConnectedSource, HierarchyNodeSearchSummary, -} from "@/lib/hierarchy/interfaces"; +} from "@/lib/hierarchy/types"; import type { SearchDocWithContent } from "@/lib/search/types"; -import type { ValidSources } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import { Button, InputCheckbox, @@ -30,7 +30,7 @@ import { SvgXCircle, } from "@opal/icons"; -import type { KnowledgeSearchResults } from "@/sections/knowledge/agent-knowledge/interfaces"; +import type { KnowledgeSearchResults } from "@/sections/knowledge/agent-knowledge/types"; interface KnowledgeSearchBarProps { query: string; diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeSidebar.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeSidebar.tsx index 66a9b23711..b4396ed4c4 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeSidebar.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeSidebar.tsx @@ -4,12 +4,12 @@ import { useTranslations } from "next-intl"; import * as TableLayouts from "@/layouts/table-layouts"; import Text from "@/refresh-components/texts/Text"; import { getSourceMetadata } from "@/lib/sources"; -import type { ConnectedSource } from "@/lib/hierarchy/interfaces"; -import type { ValidSources } from "@/lib/types"; +import type { ConnectedSource } from "@/lib/hierarchy/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import { Divider, LineItemButton } from "@opal/components"; import { SvgFiles, SvgFolder } from "@opal/icons"; -import type { KnowledgeView } from "@/sections/knowledge/agent-knowledge/interfaces"; +import type { KnowledgeView } from "@/sections/knowledge/agent-knowledge/types"; interface KnowledgeSidebarProps { activeView: KnowledgeView; diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeTableContent.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeTableContent.tsx index cceb67ba82..b6a41c62e7 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeTableContent.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeTableContent.tsx @@ -9,11 +9,8 @@ import { getSourceMetadata } from "@/lib/sources"; import { useSettings } from "@/lib/settings/hooks"; import type { AgentAttachedDocument } from "@/lib/agents/types"; import type { ProjectFile } from "@/lib/projects/types"; -import type { - CCPairSummary, - DocumentSetSummary, - ValidSources, -} from "@/lib/types"; +import type { CCPairSummary, DocumentSetSummary } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import SourceHierarchyBrowser from "@/sections/knowledge/SourceHierarchyBrowser"; import { Button } from "@opal/components"; import { Content } from "@opal/layouts"; diff --git a/web/src/sections/knowledge/agent-knowledge/KnowledgeTwoColumnView.tsx b/web/src/sections/knowledge/agent-knowledge/KnowledgeTwoColumnView.tsx index fe6c5ea4ea..b5de699b71 100644 --- a/web/src/sections/knowledge/agent-knowledge/KnowledgeTwoColumnView.tsx +++ b/web/src/sections/knowledge/agent-knowledge/KnowledgeTwoColumnView.tsx @@ -7,8 +7,9 @@ import type { AgentAttachedDocument } from "@/lib/agents/types"; import type { ConnectedSource, HierarchyNodeSearchSummary, -} from "@/lib/hierarchy/interfaces"; -import type { DocumentSetSummary, ValidSources } from "@/lib/types"; +} from "@/lib/hierarchy/types"; +import type { DocumentSetSummary } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import type { ProjectFile } from "@/lib/projects/types"; import { KnowledgeSidebar } from "@/sections/knowledge/agent-knowledge/KnowledgeSidebar"; @@ -25,7 +26,7 @@ import { import type { KnowledgeSearchResults, KnowledgeView, -} from "@/sections/knowledge/agent-knowledge/interfaces"; +} from "@/sections/knowledge/agent-knowledge/types"; interface KnowledgeTwoColumnViewProps { activeView: KnowledgeView; diff --git a/web/src/sections/knowledge/agent-knowledge/interfaces.ts b/web/src/sections/knowledge/agent-knowledge/types.ts similarity index 85% rename from web/src/sections/knowledge/agent-knowledge/interfaces.ts rename to web/src/sections/knowledge/agent-knowledge/types.ts index fc9b05644e..e70b5a1503 100644 --- a/web/src/sections/knowledge/agent-knowledge/interfaces.ts +++ b/web/src/sections/knowledge/agent-knowledge/types.ts @@ -1,5 +1,5 @@ -import type { ValidSources } from "@/lib/types"; -import type { HierarchyNodeSearchSummary } from "@/lib/hierarchy/interfaces"; +import type { ValidSources } from "@/lib/connectors/types/source"; +import type { HierarchyNodeSearchSummary } from "@/lib/hierarchy/types"; import type { SearchDocWithContent } from "@/lib/search/types"; export type KnowledgeView = diff --git a/web/src/views/AgentEditorPage.tsx b/web/src/views/AgentEditorPage.tsx index baec22ac10..2926fb9af2 100644 --- a/web/src/views/AgentEditorPage.tsx +++ b/web/src/views/AgentEditorPage.tsx @@ -98,7 +98,8 @@ import { Tier } from "@/lib/settings/types"; import { ConfirmationModalLayout } from "@opal/layouts"; import { ShareAgentModal, type ShareDraftState } from "@/lib/agents/components"; import AgentKnowledgePane from "@/sections/knowledge/AgentKnowledgePane"; -import { Permission, ValidSources } from "@/lib/types"; +import { Permission } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { useSettings } from "@/lib/settings/hooks"; import { useUser } from "@/providers/UserProvider"; import { hasPermission } from "@/lib/permissions"; diff --git a/web/src/views/AppPage.tsx b/web/src/views/AppPage.tsx index 7ed5278304..effc8ecb7a 100644 --- a/web/src/views/AppPage.tsx +++ b/web/src/views/AppPage.tsx @@ -31,7 +31,8 @@ import PreviewModal from "@/sections/modals/PreviewModal"; import { Modal } from "@opal/components"; import { useSendMessageToParent } from "@/lib/extension/hooks"; import { SourceMetadata } from "@/lib/search/types"; -import { FederatedConnectorDetail, ValidSources } from "@/lib/types"; +import { FederatedConnectorDetail } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import DocumentsSidebar from "@/sections/document-sidebar/DocumentsSidebar"; import useChatController from "@/hooks/useChatController"; import useMultiModelChat from "@/hooks/useMultiModelChat"; diff --git a/web/src/views/SettingsPage.tsx b/web/src/views/SettingsPage.tsx index 44479dd8da..9d4da904be 100644 --- a/web/src/views/SettingsPage.tsx +++ b/web/src/views/SettingsPage.tsx @@ -61,7 +61,7 @@ import { } from "@opal/components"; import useFederatedOAuthStatus from "@/hooks/useFederatedOAuthStatus"; import useCCPairs from "@/hooks/useCCPairs"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { ConnectorCredentialPairStatus } from "@/lib/connectors/types"; import { ConfirmationModalLayout } from "@opal/layouts"; import { BasicModalFooter, Modal } from "@opal/components"; diff --git a/web/src/views/admin/GroupsPage/SharedGroupResources/index.tsx b/web/src/views/admin/GroupsPage/SharedGroupResources/index.tsx index a02f5f3682..0a1ca7f29b 100644 --- a/web/src/views/admin/GroupsPage/SharedGroupResources/index.tsx +++ b/web/src/views/admin/GroupsPage/SharedGroupResources/index.tsx @@ -15,7 +15,7 @@ import { useDocumentSets } from "@/lib/hooks/useDocumentSets"; import { useAdminAgents } from "@/lib/agents/hooks"; import { getSourceMetadata } from "@/lib/sources"; import type { Agent } from "@/lib/agents/types"; -import type { ValidSources } from "@/lib/types"; +import type { ValidSources } from "@/lib/connectors/types/source"; import ResourceContent from "@/views/admin/GroupsPage/SharedGroupResources/ResourceContent"; import ResourcePopover from "@/views/admin/GroupsPage/SharedGroupResources/ResourcePopover"; import type { PopoverSection } from "@/views/admin/GroupsPage/SharedGroupResources/interfaces"; diff --git a/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx b/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx index 1072586ab2..589352e17b 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/AddConnector.tsx @@ -15,7 +15,10 @@ import { submitFiles } from "@/lib/connectors/svc"; import { submitGoogleSite } from "@/lib/connectors/svc"; import AdvancedFormPage from "@/views/admin/connectors/AddConnectorPage/form/Advanced"; import DynamicConnectionForm from "@/views/admin/connectors/AddConnectorPage/form/DynamicConnectorCreationForm"; -import { ConfigurableSources, ValidSources } from "@/lib/types"; +import { + ConfigurableSources, + ValidSources, +} from "@/lib/connectors/types/source"; import { credentialTemplates } from "@/lib/connectors/credentials"; import type { Credential } from "@/lib/connectors/types"; import { diff --git a/web/src/views/admin/connectors/AddConnectorPage/ConnectorWrapper.tsx b/web/src/views/admin/connectors/AddConnectorPage/ConnectorWrapper.tsx index f39e33c0a5..e935fb5dae 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/ConnectorWrapper.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/ConnectorWrapper.tsx @@ -1,7 +1,7 @@ "use client"; import { useTranslations } from "next-intl"; -import { ConfigurableSources } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import AddConnector from "./AddConnector"; import { Button } from "@opal/components"; import { SettingsLayouts, useToastFromQuery } from "@opal/layouts"; diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/DynamicConnectorCreationForm.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/DynamicConnectorCreationForm.tsx index 47fde0cf71..e32f4ceb98 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/DynamicConnectorCreationForm.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/DynamicConnectorCreationForm.tsx @@ -6,7 +6,7 @@ import { TextFormField } from "@/components/Field"; import { AdvancedOptionsToggle } from "@/components/AdvancedOptionsToggle"; import { AccessTypeForm } from "@/components/admin/connectors/AccessTypeForm"; import { AccessTypeGroupSelector } from "@/components/admin/connectors/AccessTypeGroupSelector"; -import { ConfigurableSources } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import type { Credential } from "@/lib/connectors/types"; import { RenderField } from "./FieldRendering"; import { useFormikContext } from "formik"; diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/FieldRendering.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/FieldRendering.tsx index 5e3fa31552..19bc702f5d 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/FieldRendering.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/FieldRendering.tsx @@ -7,7 +7,7 @@ import { TextFormField, MultiSelectField } from "@/components/Field"; import ListInput from "./inputs/ListInput"; import StringPairListInput from "./inputs/StringPairListInput"; import FileInput from "./inputs/FileInput"; -import { ConfigurableSources } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import type { Credential } from "@/lib/connectors/types"; import CollapsibleSection from "@/app/admin/agents/CollapsibleSection"; import { Tabs } from "@opal/components"; diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/Credential.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/Credential.tsx index 82c2de3399..d429e98e85 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/Credential.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/Credential.tsx @@ -15,7 +15,7 @@ import { parseOauthAppCredentialJson, refreshAllGoogleData, } from "@/lib/googleConnector"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { markdown } from "@opal/utils"; interface DriveCredentialSectionProps { diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/GoogleDrivePage.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/GoogleDrivePage.tsx index 044ff6d43b..dff6b6471b 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/GoogleDrivePage.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/gdrive/GoogleDrivePage.tsx @@ -4,7 +4,7 @@ import React from "react"; import { useTranslations } from "next-intl"; import { ErrorCallout } from "@/components/ErrorCallout"; import { LoadingAnimation } from "@/components/Loading"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { usePublicCredentials } from "@/lib/hooks"; import { DriveAuthSection } from "./Credential"; import { useUser } from "@/providers/UserProvider"; diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/gmail/Credential.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/gmail/Credential.tsx index e433dc7abc..396cc3a84f 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/gmail/Credential.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/gmail/Credential.tsx @@ -17,7 +17,7 @@ import { parseOauthAppCredentialJson, refreshAllGoogleData, } from "@/lib/googleConnector"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { markdown } from "@opal/utils"; interface GmailCredentialSectionProps { diff --git a/web/src/views/admin/connectors/AddConnectorPage/form/gmail/GmailPage.tsx b/web/src/views/admin/connectors/AddConnectorPage/form/gmail/GmailPage.tsx index 7fbd6555ec..be1a9e3d5f 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/form/gmail/GmailPage.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/form/gmail/GmailPage.tsx @@ -5,7 +5,7 @@ import { useTranslations } from "next-intl"; import { ErrorCallout } from "@/components/ErrorCallout"; import { LoadingAnimation } from "@/components/Loading"; import { toast } from "@opal/layouts"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import type { Credential, GmailCredentialJson, diff --git a/web/src/views/admin/connectors/AddConnectorPage/index.tsx b/web/src/views/admin/connectors/AddConnectorPage/index.tsx index 05a604a316..73eed0fd95 100644 --- a/web/src/views/admin/connectors/AddConnectorPage/index.tsx +++ b/web/src/views/admin/connectors/AddConnectorPage/index.tsx @@ -1,4 +1,4 @@ -import { ConfigurableSources } from "@/lib/types"; +import type { ConfigurableSources } from "@/lib/connectors/types/source"; import ConnectorWrapper from "@/views/admin/connectors/AddConnectorPage/ConnectorWrapper"; export interface PageProps { diff --git a/web/src/views/admin/connectors/CatalogPage.tsx b/web/src/views/admin/connectors/CatalogPage.tsx index 98225b6bb1..fc145d4978 100644 --- a/web/src/views/admin/connectors/CatalogPage.tsx +++ b/web/src/views/admin/connectors/CatalogPage.tsx @@ -17,10 +17,8 @@ import { } from "react"; import { InputTypeIn, Text } from "@opal/components"; import { useFederatedConnectors } from "@/lib/hooks"; -import { - FederatedConnectorDetail, - federatedSourceToRegularSource, -} from "@/lib/types"; +import { FederatedConnectorDetail } from "@/lib/types"; +import { federatedSourceToRegularSource } from "@/lib/connectors/types/source"; import { useSettings } from "@/lib/settings/hooks"; import { ConnectorSourceCard } from "@/lib/connectors/components"; import { ADMIN_ROUTES } from "@/lib/admin-routes"; diff --git a/web/src/views/admin/connectors/ConnectorDetailPage/ConfigDisplay.tsx b/web/src/views/admin/connectors/ConnectorDetailPage/ConfigDisplay.tsx index c256202610..2a13a9c799 100644 --- a/web/src/views/admin/connectors/ConnectorDetailPage/ConfigDisplay.tsx +++ b/web/src/views/admin/connectors/ConnectorDetailPage/ConfigDisplay.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { useLocale, useTranslations } from "next-intl"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { Section } from "@/layouts/general-layouts"; import Text from "@/refresh-components/texts/Text"; import { Button, Divider } from "@opal/components"; diff --git a/web/src/views/admin/connectors/IndexingStatusPage/CCPairIndexingStatusTable.tsx b/web/src/views/admin/connectors/IndexingStatusPage/CCPairIndexingStatusTable.tsx index 2895b2f048..1daf69eaa5 100644 --- a/web/src/views/admin/connectors/IndexingStatusPage/CCPairIndexingStatusTable.tsx +++ b/web/src/views/admin/connectors/IndexingStatusPage/CCPairIndexingStatusTable.tsx @@ -12,12 +12,12 @@ import { Badge } from "@/components/ui/badge"; import { CCPairStatus } from "@/components/Status"; import { timeAgo } from "@opal/time"; import { - ValidSources, ConnectorIndexingStatusLiteResponse, SourceSummary, ConnectorIndexingStatusLite, FederatedConnectorStatus, } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import { useRouter } from "next/navigation"; import Truncated from "@/refresh-components/texts/Truncated"; import { diff --git a/web/src/views/admin/connectors/IndexingStatusPage/index.tsx b/web/src/views/admin/connectors/IndexingStatusPage/index.tsx index 99fc2bd561..44e98e046f 100644 --- a/web/src/views/admin/connectors/IndexingStatusPage/index.tsx +++ b/web/src/views/admin/connectors/IndexingStatusPage/index.tsx @@ -13,7 +13,7 @@ import { useConnectorIndexingStatusWithPagination } from "@/lib/hooks"; import { useSettings } from "@/lib/settings/hooks"; import { useState, useRef, useMemo, RefObject } from "react"; import { FilterOptions } from "./FilterComponent"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import Cookies from "js-cookie"; import { TOGGLED_CONNECTORS_COOKIE_NAME } from "@/lib/constants"; import { ConnectorStaggeredSkeleton } from "./ConnectorRowSkeleton"; diff --git a/web/src/views/admin/connectors/OAuthCallbackPage/index.tsx b/web/src/views/admin/connectors/OAuthCallbackPage/index.tsx index 094337b795..6df8788a81 100644 --- a/web/src/views/admin/connectors/OAuthCallbackPage/index.tsx +++ b/web/src/views/admin/connectors/OAuthCallbackPage/index.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from "react"; import { usePathname, useSearchParams } from "next/navigation"; import { AdminPageTitle } from "@/components/admin/Title"; import { getSourceMetadata, isValidSource } from "@/lib/sources"; -import { ValidSources } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import CardSection from "@/components/admin/CardSection"; import { handleOAuthAuthorizationResponse } from "@/lib/oauth_utils"; import { SvgKey } from "@opal/icons"; diff --git a/web/src/views/admin/connectors/OAuthFinalizePage/index.tsx b/web/src/views/admin/connectors/OAuthFinalizePage/index.tsx index d3cbef3e6b..d6926a65bb 100644 --- a/web/src/views/admin/connectors/OAuthFinalizePage/index.tsx +++ b/web/src/views/admin/connectors/OAuthFinalizePage/index.tsx @@ -5,7 +5,8 @@ import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { AdminPageTitle } from "@/components/admin/Title"; import { Button } from "@opal/components"; import { getSourceMetadata, isValidSource } from "@/lib/sources"; -import { ConfluenceAccessibleResource, ValidSources } from "@/lib/types"; +import { ConfluenceAccessibleResource } from "@/lib/types"; +import { ValidSources } from "@/lib/connectors/types/source"; import CardSection from "@/components/admin/CardSection"; import { handleOAuthConfluenceFinalize,