From 72b942f152ce4b4065c34e4dfd52f3edf0bed958 Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Fri, 21 Jun 2024 17:08:24 +0200 Subject: [PATCH] merge connectors --- connectors/src/admin/db.ts | 4 +- connectors/src/api/configuration.ts | 3 +- connectors/src/api/create_connector.ts | 3 +- connectors/src/connectors/index.ts | 98 +++------- .../connectors/microsoft/{teams => }/index.ts | 66 +++---- .../connectors/microsoft/sharepoint/index.ts | 176 ------------------ .../microsoft/sharepoint/temporal/client.ts | 15 -- .../microsoft/sharepoint/temporal/worker.ts | 1 - .../microsoft/sharepoint/temporal/workflow.ts | 7 - .../microsoft/teams/temporal/config.ts | 2 - .../microsoft/teams/temporal/worker.ts | 1 - .../microsoft/teams/temporal/workflow.ts | 7 - .../microsoft/{teams => }/temporal/client.ts | 2 +- .../{sharepoint => }/temporal/config.ts | 0 .../connectors/microsoft/temporal/worker.ts | 1 + .../connectors/microsoft/temporal/workflow.ts | 7 + connectors/src/lib/models/microsoft.ts | 52 +----- .../src/resources/connector/microsoft.ts | 14 +- .../src/resources/connector/strategy.ts | 14 +- connectors/src/start_worker.ts | 5 +- .../components/ConnectorPermissionsModal.tsx | 3 +- front/components/ConnectorPermissionsTree.tsx | 3 +- .../AssistantBuilderDataSourceModal.tsx | 6 +- front/components/assistant_builder/shared.ts | 3 +- front/lib/connector_providers.ts | 25 +-- front/lib/data_sources.ts | 3 +- .../data_sources/[name]/configuration.ts | 3 +- .../pages/api/w/[wId]/data_sources/managed.ts | 6 +- .../builder/data-sources/[name]/index.tsx | 27 +-- .../w/[wId]/builder/data-sources/managed.tsx | 17 +- types/src/connectors/webcrawler.ts | 3 +- types/src/front/data_source.ts | 3 +- types/src/front/lib/connectors_api.ts | 3 +- 33 files changed, 127 insertions(+), 456 deletions(-) rename connectors/src/connectors/microsoft/{teams => }/index.ts (60%) delete mode 100644 connectors/src/connectors/microsoft/sharepoint/index.ts delete mode 100644 connectors/src/connectors/microsoft/sharepoint/temporal/client.ts delete mode 100644 connectors/src/connectors/microsoft/sharepoint/temporal/worker.ts delete mode 100644 connectors/src/connectors/microsoft/sharepoint/temporal/workflow.ts delete mode 100644 connectors/src/connectors/microsoft/teams/temporal/config.ts delete mode 100644 connectors/src/connectors/microsoft/teams/temporal/worker.ts delete mode 100644 connectors/src/connectors/microsoft/teams/temporal/workflow.ts rename connectors/src/connectors/microsoft/{teams => }/temporal/client.ts (87%) rename connectors/src/connectors/microsoft/{sharepoint => }/temporal/config.ts (100%) create mode 100644 connectors/src/connectors/microsoft/temporal/worker.ts create mode 100644 connectors/src/connectors/microsoft/temporal/workflow.ts diff --git a/connectors/src/admin/db.ts b/connectors/src/admin/db.ts index e9e201b8d5089..f7339796c1337 100644 --- a/connectors/src/admin/db.ts +++ b/connectors/src/admin/db.ts @@ -30,7 +30,7 @@ import { IntercomWorkspace, } from "@connectors/lib/models/intercom"; import { - MicrosoftSharepointConfiguration, + MicrosoftConfiguration, MicrosoftTeamsConfiguration, } from "@connectors/lib/models/microsoft"; import { @@ -85,7 +85,7 @@ async function main(): Promise { await GoogleDriveFiles.sync({ alter: true }); await GoogleDriveSheet.sync({ alter: true }); await GoogleDriveSyncToken.sync({ alter: true }); - await MicrosoftSharepointConfiguration.sync({ alter: true }); + await MicrosoftConfiguration.sync({ alter: true }); await MicrosoftTeamsConfiguration.sync({ alter: true }); await NotionConnectorBlockCacheEntry.sync({ alter: true }); await NotionConnectorPageCacheEntry.sync({ alter: true }); diff --git a/connectors/src/api/configuration.ts b/connectors/src/api/configuration.ts index b5b8f938c6dd2..6321ef5f7f3ce 100644 --- a/connectors/src/api/configuration.ts +++ b/connectors/src/api/configuration.ts @@ -65,8 +65,7 @@ const _patchConnectorConfiguration = async ( case "github": case "google_drive": case "intercom": - case "microsoft_teams": - case "microsoft_sharepoint": + case "microsoft": case "slack": { throw new Error( `Connector type ${connector.type} does not support configuration patching` diff --git a/connectors/src/api/create_connector.ts b/connectors/src/api/create_connector.ts index 996768635ab66..a26a413fadf05 100644 --- a/connectors/src/api/create_connector.ts +++ b/connectors/src/api/create_connector.ts @@ -95,8 +95,7 @@ const _createConnectorAPIHandler = async ( case "confluence": case "google_drive": case "intercom": - case "microsoft_teams": - case "microsoft_sharepoint": + case "microsoft": case "slack": { const connectorCreator = CREATE_CONNECTOR_BY_TYPE[req.params.connector_provider]; diff --git a/connectors/src/connectors/index.ts b/connectors/src/connectors/index.ts index 5ae00e8e5eb2b..4f897bb64542e 100644 --- a/connectors/src/connectors/index.ts +++ b/connectors/src/connectors/index.ts @@ -87,37 +87,21 @@ import type { SyncConnector, } from "@connectors/connectors/interface"; import { - cleanupMicrosoftSharepointConnector, - createMicrosoftSharepointConnector, - fullResyncMicrosoftSharepointConnector, - getMicrosoftSharepointConfig, - pauseMicrosoftSharepointConnector, - resumeMicrosoftSharepointConnector, - retrieveMicrosoftSharepointConnectorPermissions, - retrieveMicrosoftSharepointContentNodeParents, - retrieveMicrosoftSharepointContentNodes, - setMicrosoftSharepointConfig, - setMicrosoftSharepointConnectorPermissions, - stopMicrosoftSharepointConnector, - unpauseMicrosoftSharepointConnector, - updateMicrosoftSharepointConnector, -} from "@connectors/connectors/microsoft/sharepoint"; -import { - cleanupMicrosoftTeamsConnector, - createMicrosoftTeamsConnector, - fullResyncMicrosoftTeamsConnector, - getMicrosoftTeamsConfig, - pauseMicrosoftTeamsConnector, - resumeMicrosoftTeamsConnector, - retrieveMicrosoftTeamsConnectorPermissions, - retrieveMicrosoftTeamsContentNodeParents, - retrieveMicrosoftTeamsContentNodes, - setMicrosoftTeamsConfig, - setMicrosoftTeamsConnectorPermissions, - stopMicrosoftTeamsConnector, - unpauseMicrosoftTeamsConnector, - updateMicrosoftTeamsConnector, -} from "@connectors/connectors/microsoft/teams"; + cleanupMicrosoftConnector, + createMicrosoftConnector, + fullResyncMicrosoftConnector, + getMicrosoftConfig, + pauseMicrosoftConnector, + resumeMicrosoftConnector, + retrieveMicrosoftConnectorPermissions, + retrieveMicrosoftContentNodeParents, + retrieveMicrosoftContentNodes, + setMicrosoftConfig, + setMicrosoftConnectorPermissions, + stopMicrosoftConnector, + unpauseMicrosoftConnector, + updateMicrosoftConnector, +} from "@connectors/connectors/microsoft"; import { cleanupNotionConnector, createNotionConnector, @@ -166,8 +150,7 @@ export const CREATE_CONNECTOR_BY_TYPE: ConnectorProviderCreateConnectorMapping = github: createGithubConnector, google_drive: createGoogleDriveConnector, intercom: createIntercomConnector, - microsoft_sharepoint: createMicrosoftSharepointConnector, - microsoft_teams: createMicrosoftTeamsConnector, + microsoft: createMicrosoftConnector, notion: createNotionConnector, slack: createSlackConnector, webcrawler: createWebcrawlerConnector, @@ -179,8 +162,7 @@ export const UPDATE_CONNECTOR_BY_TYPE: Record< > = { confluence: updateConfluenceConnector, slack: updateSlackConnector, - microsoft_sharepoint: updateMicrosoftSharepointConnector, - microsoft_teams: updateMicrosoftTeamsConnector, + microsoft: updateMicrosoftConnector, notion: updateNotionConnector, github: updateGithubConnector, google_drive: updateGoogleDriveConnector, @@ -200,8 +182,7 @@ export const STOP_CONNECTOR_BY_TYPE: Record< return new Ok(undefined); }, github: stopGithubConnector, - microsoft_sharepoint: stopMicrosoftSharepointConnector, - microsoft_teams: stopMicrosoftTeamsConnector, + microsoft: stopMicrosoftConnector, notion: stopNotionConnector, google_drive: async (connectorId: ModelId) => { await terminateAllWorkflowsForConnectorId(connectorId); @@ -217,8 +198,7 @@ export const DELETE_CONNECTOR_BY_TYPE: Record< > = { confluence: cleanupConfluenceConnector, slack: cleanupSlackConnector, - microsoft_sharepoint: cleanupMicrosoftSharepointConnector, - microsoft_teams: cleanupMicrosoftTeamsConnector, + microsoft: cleanupMicrosoftConnector, notion: cleanupNotionConnector, github: cleanupGithubConnector, google_drive: cleanupGoogleDriveConnector, @@ -235,8 +215,7 @@ export const RESUME_CONNECTOR_BY_TYPE: Record< logger.info({ connectorId }, `Resuming Slack connector is a no-op.`); return new Ok(undefined); }, - microsoft_sharepoint: resumeMicrosoftSharepointConnector, - microsoft_teams: resumeMicrosoftTeamsConnector, + microsoft: resumeMicrosoftConnector, notion: resumeNotionConnector, github: resumeGithubConnector, google_drive: async (connectorId: ModelId) => { @@ -257,8 +236,7 @@ export const SYNC_CONNECTOR_BY_TYPE: Record = { confluence: launchConfluenceSyncWorkflow, slack: launchSlackSyncWorkflow, - microsoft_sharepoint: fullResyncMicrosoftSharepointConnector, - microsoft_teams: fullResyncMicrosoftTeamsConnector, + microsoft: fullResyncMicrosoftConnector, notion: fullResyncNotionConnector, github: fullResyncGithubConnector, google_drive: launchGoogleDriveFullSyncWorkflow, @@ -273,8 +251,7 @@ export const RETRIEVE_CONNECTOR_PERMISSIONS_BY_TYPE: Record< confluence: retrieveConfluenceConnectorPermissions, slack: retrieveSlackConnectorPermissions, github: retrieveGithubConnectorPermissions, - microsoft_sharepoint: retrieveMicrosoftSharepointConnectorPermissions, - microsoft_teams: retrieveMicrosoftTeamsConnectorPermissions, + microsoft: retrieveMicrosoftConnectorPermissions, notion: retrieveNotionConnectorPermissions, google_drive: retrieveGoogleDriveConnectorPermissions, intercom: retrieveIntercomConnectorPermissions, @@ -287,8 +264,7 @@ export const SET_CONNECTOR_PERMISSIONS_BY_TYPE: Record< > = { confluence: setConfluenceConnectorPermissions, slack: setSlackConnectorPermissions, - microsoft_sharepoint: setMicrosoftSharepointConnectorPermissions, - microsoft_teams: setMicrosoftTeamsConnectorPermissions, + microsoft: setMicrosoftConnectorPermissions, notion: async () => { return new Err( new Error(`Setting Notion connector permissions is not implemented yet.`) @@ -314,8 +290,7 @@ export const BATCH_RETRIEVE_CONTENT_NODES_BY_TYPE: Record< > = { confluence: retrieveConfluenceContentNodes, slack: retrieveSlackContentNodes, - microsoft_sharepoint: retrieveMicrosoftSharepointContentNodes, - microsoft_teams: retrieveMicrosoftTeamsContentNodes, + microsoft: retrieveMicrosoftContentNodes, notion: retrieveNotionContentNodes, github: retrieveGithubReposContentNodes, google_drive: retrieveGoogleDriveContentNodes, @@ -328,8 +303,7 @@ export const RETRIEVE_CONTENT_NODE_PARENTS_BY_TYPE: Record< ContentNodeParentsRetriever > = { confluence: retrieveConfluenceContentNodeParents, - microsoft_sharepoint: retrieveMicrosoftSharepointContentNodeParents, - microsoft_teams: retrieveMicrosoftTeamsContentNodeParents, + microsoft: retrieveMicrosoftContentNodeParents, notion: retrieveNotionContentNodeParents, google_drive: retrieveGoogleDriveContentNodeParents, slack: async () => new Ok([]), // Slack is flat @@ -347,8 +321,7 @@ export const SET_CONNECTOR_CONFIG_BY_TYPE: Record< throw new Error("Not implemented"); }, slack: setSlackConfig, - microsoft_sharepoint: setMicrosoftSharepointConfig, - microsoft_teams: setMicrosoftTeamsConfig, + microsoft: setMicrosoftConfig, notion: async () => { throw new Error("Not implemented"); }, @@ -369,8 +342,7 @@ export const GET_CONNECTOR_CONFIG_BY_TYPE: Record< throw new Error("Not implemented"); }, slack: getSlackConfig, - microsoft_sharepoint: getMicrosoftSharepointConfig, - microsoft_teams: getMicrosoftTeamsConfig, + microsoft: getMicrosoftConfig, notion: async () => { throw new Error("Not implemented"); }, @@ -394,10 +366,7 @@ export const SET_CONNECTOR_CONFIGURATION_BY_TYPE: ConnectorProviderUpdateConfigu slack: () => { throw new Error("Not implemented"); }, - microsoft_sharepoint: () => { - throw new Error("Not implemented"); - }, - microsoft_teams: () => { + microsoft: () => { throw new Error("Not implemented"); }, notion: () => { @@ -424,10 +393,7 @@ export const GARBAGE_COLLECT_BY_TYPE: Record< slack: () => { throw new Error("Not implemented"); }, - microsoft_sharepoint: async () => { - throw new Error("Not implemented"); - }, - microsoft_teams: () => { + microsoft: async () => { throw new Error("Not implemented"); }, notion: async () => { @@ -454,8 +420,7 @@ export const PAUSE_CONNECTOR_BY_TYPE: Record< > = { confluence: pauseConfluenceConnector, slack: pauseSlackConnector, - microsoft_sharepoint: pauseMicrosoftSharepointConnector, - microsoft_teams: pauseMicrosoftTeamsConnector, + microsoft: pauseMicrosoftConnector, notion: pauseNotionConnector, github: pauseGithubConnector, google_drive: pauseGoogleDriveConnector, @@ -471,8 +436,7 @@ export const UNPAUSE_CONNECTOR_BY_TYPE: Record< > = { confluence: unpauseConfluenceConnector, slack: unpauseSlackConnector, - microsoft_sharepoint: unpauseMicrosoftSharepointConnector, - microsoft_teams: unpauseMicrosoftTeamsConnector, + microsoft: unpauseMicrosoftConnector, notion: unpauseNotionConnector, github: unpauseGithubConnector, google_drive: unpauseGoogleDriveConnector, diff --git a/connectors/src/connectors/microsoft/teams/index.ts b/connectors/src/connectors/microsoft/index.ts similarity index 60% rename from connectors/src/connectors/microsoft/teams/index.ts rename to connectors/src/connectors/microsoft/index.ts index f97b2ae0d98d0..c5bd8c18842af 100644 --- a/connectors/src/connectors/microsoft/teams/index.ts +++ b/connectors/src/connectors/microsoft/index.ts @@ -9,19 +9,19 @@ import type { import { Ok } from "@dust-tt/types"; import type { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; -import { launchMicrosoftTeamsFullSyncWorkflow } from "@connectors/connectors/microsoft/teams/temporal/client"; +import { launchMicrosoftFullSyncWorkflow } from "@connectors/connectors/microsoft/temporal/client"; import { syncSucceeded } from "@connectors/lib/sync_status"; import { ConnectorResource } from "@connectors/resources/connector_resource"; import type { DataSourceConfig } from "@connectors/types/data_source_config"; -export async function createMicrosoftTeamsConnector( +export async function createMicrosoftConnector( dataSourceConfig: DataSourceConfig, connectionId: NangoConnectionId ): Promise> { - console.log("createMicrosoftTeamsConnector", dataSourceConfig, connectionId); + console.log("createMicrosoftConnector", dataSourceConfig, connectionId); const connector = await ConnectorResource.makeNew( - "microsoft_teams", + "microsoft", { connectionId, workspaceAPIKey: dataSourceConfig.workspaceAPIKey, @@ -36,7 +36,7 @@ export async function createMicrosoftTeamsConnector( return new Ok(connector.id.toString()); } -export async function updateMicrosoftTeamsConnector( +export async function updateMicrosoftConnector( connectorId: ModelId, { connectionId, @@ -44,59 +44,59 @@ export async function updateMicrosoftTeamsConnector( connectionId?: string | null; } ): Promise> { - console.log("updateMicrosoftTeamsConnector", connectorId, connectionId); + console.log("updateMicrosoftConnector", connectorId, connectionId); throw Error("Not implemented"); } -export async function stopMicrosoftTeamsConnector( +export async function stopMicrosoftConnector( connectorId: ModelId ): Promise> { - console.log("stopMicrosoftTeamsConnector", connectorId); + console.log("stopMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function deleteMicrosoftTeamsConnector(connectorId: ModelId) { - console.log("deleteMicrosoftTeamsConnector", connectorId); +export async function deleteMicrosoftConnector(connectorId: ModelId) { + console.log("deleteMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function pauseMicrosoftTeamsConnector( +export async function pauseMicrosoftConnector( connectorId: ModelId ): Promise> { - console.log("pauseMicrosoftTeamsConnector", connectorId); + console.log("pauseMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function unpauseMicrosoftTeamsConnector( +export async function unpauseMicrosoftConnector( connectorId: ModelId ): Promise> { - console.log("unpauseMicrosoftTeamsConnector", connectorId); + console.log("unpauseMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function resumeMicrosoftTeamsConnector( +export async function resumeMicrosoftConnector( connectorId: ModelId ): Promise> { - console.log("resumeMicrosoftTeamsConnector", connectorId); + console.log("resumeMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function fullResyncMicrosoftTeamsConnector( +export async function fullResyncMicrosoftConnector( connectorId: ModelId, fromTs: number | null ) { - console.log("fullResyncMicrosoftTeamsConnector", connectorId, fromTs); - return launchMicrosoftTeamsFullSyncWorkflow(connectorId); + console.log("fullResyncMicrosoftConnector", connectorId, fromTs); + return launchMicrosoftFullSyncWorkflow(connectorId); } -export async function cleanupMicrosoftTeamsConnector( +export async function cleanupMicrosoftConnector( connectorId: ModelId ): Promise> { - console.log("cleanupMicrosoftTeamsConnector", connectorId); + console.log("cleanupMicrosoftConnector", connectorId); throw Error("Not implemented"); } -export async function retrieveMicrosoftTeamsConnectorPermissions({ +export async function retrieveMicrosoftConnectorPermissions({ connectorId, parentInternalId, viewType, @@ -104,7 +104,7 @@ export async function retrieveMicrosoftTeamsConnectorPermissions({ Result > { console.log( - "retrieveMicrosoftTeamsConnectorPermissions", + "retrieveMicrosoftConnectorPermissions", connectorId, parentInternalId, viewType @@ -112,19 +112,15 @@ export async function retrieveMicrosoftTeamsConnectorPermissions({ throw Error("Not implemented"); } -export async function setMicrosoftTeamsConnectorPermissions( +export async function setMicrosoftConnectorPermissions( connectorId: ModelId, permissions: Record ): Promise> { - console.log( - "setMicrosoftTeamsConnectorPermissions", - connectorId, - permissions - ); + console.log("setMicrosoftConnectorPermissions", connectorId, permissions); throw Error("Not implemented"); } -export async function getMicrosoftTeamsConfig( +export async function getMicrosoftConfig( connectorId: ModelId, configKey: string ): Promise> { @@ -132,7 +128,7 @@ export async function getMicrosoftTeamsConfig( throw Error("Not implemented"); } -export async function setMicrosoftTeamsConfig( +export async function setMicrosoftConfig( connectorId: ModelId, configKey: string, configValue: string @@ -141,23 +137,23 @@ export async function setMicrosoftTeamsConfig( throw Error("Not implemented"); } -export async function retrieveMicrosoftTeamsContentNodeParents( +export async function retrieveMicrosoftContentNodeParents( connectorId: ModelId, internalId: string, memoizationKey?: string ): Promise> { console.log( - "retrieveMicrosoftTeamsContentNodeParents", + "retrieveMicrosoftContentNodeParents", connectorId, internalId, memoizationKey ); throw Error("Not implemented"); } -export async function retrieveMicrosoftTeamsContentNodes( +export function retrieveMicrosoftContentNodes( connectorId: ModelId, internalIds: string[] ): Promise> { - console.log("retrieveMicrosoftTeamsContentNodes", connectorId, internalIds); + console.log("retrieveMicrosoftContentNodes", connectorId, internalIds); throw Error("Not implemented"); } diff --git a/connectors/src/connectors/microsoft/sharepoint/index.ts b/connectors/src/connectors/microsoft/sharepoint/index.ts deleted file mode 100644 index 1a4d66d185697..0000000000000 --- a/connectors/src/connectors/microsoft/sharepoint/index.ts +++ /dev/null @@ -1,176 +0,0 @@ -import type { - ConnectorPermission, - ConnectorsAPIError, - ContentNode, - ModelId, - NangoConnectionId, - Result, -} from "@dust-tt/types"; -import { Ok } from "@dust-tt/types"; - -import type { ConnectorPermissionRetriever } from "@connectors/connectors/interface"; -import { launchMicrosoftSharepointFullSyncWorkflow } from "@connectors/connectors/microsoft/sharepoint/temporal/client"; -import { syncSucceeded } from "@connectors/lib/sync_status"; -import { ConnectorResource } from "@connectors/resources/connector_resource"; -import type { DataSourceConfig } from "@connectors/types/data_source_config"; - -export async function createMicrosoftSharepointConnector( - dataSourceConfig: DataSourceConfig, - connectionId: NangoConnectionId -): Promise> { - console.log( - "createMicrosoftSharepointConnector", - dataSourceConfig, - connectionId - ); - - const connector = await ConnectorResource.makeNew( - "microsoft_sharepoint", - { - connectionId, - workspaceAPIKey: dataSourceConfig.workspaceAPIKey, - workspaceId: dataSourceConfig.workspaceId, - dataSourceName: dataSourceConfig.dataSourceName, - }, - {} - ); - - await syncSucceeded(connector.id); - - return new Ok(connector.id.toString()); -} - -export async function updateMicrosoftSharepointConnector( - connectorId: ModelId, - { - connectionId, - }: { - connectionId?: string | null; - } -): Promise> { - console.log("updateMicrosoftSharepointConnector", connectorId, connectionId); - throw Error("Not implemented"); -} - -export async function stopMicrosoftSharepointConnector( - connectorId: ModelId -): Promise> { - console.log("stopMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function deleteMicrosoftSharepointConnector(connectorId: ModelId) { - console.log("deleteMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function pauseMicrosoftSharepointConnector( - connectorId: ModelId -): Promise> { - console.log("pauseMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function unpauseMicrosoftSharepointConnector( - connectorId: ModelId -): Promise> { - console.log("unpauseMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function resumeMicrosoftSharepointConnector( - connectorId: ModelId -): Promise> { - console.log("resumeMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function fullResyncMicrosoftSharepointConnector( - connectorId: ModelId, - fromTs: number | null -) { - console.log("fullResyncMicrosoftSharepointConnector", connectorId, fromTs); - return launchMicrosoftSharepointFullSyncWorkflow(connectorId); -} - -export async function cleanupMicrosoftSharepointConnector( - connectorId: ModelId -): Promise> { - console.log("cleanupMicrosoftSharepointConnector", connectorId); - throw Error("Not implemented"); -} - -export async function retrieveMicrosoftSharepointConnectorPermissions({ - connectorId, - parentInternalId, - viewType, -}: Parameters[0]): Promise< - Result -> { - console.log( - "retrieveMicrosoftSharepointConnectorPermissions", - connectorId, - parentInternalId, - viewType - ); - throw Error("Not implemented"); -} - -export async function setMicrosoftSharepointConnectorPermissions( - connectorId: ModelId, - permissions: Record -): Promise> { - console.log( - "setMicrosoftSharepointConnectorPermissions", - connectorId, - permissions - ); - throw Error("Not implemented"); -} - -export async function getMicrosoftSharepointConfig( - connectorId: ModelId, - configKey: string -): Promise> { - console.log("getMicrosoftSharepointConfig", connectorId, configKey); - throw Error("Not implemented"); -} - -export async function setMicrosoftSharepointConfig( - connectorId: ModelId, - configKey: string, - configValue: string -): Promise> { - console.log( - "setMicrosoftSharepointConfig", - connectorId, - configKey, - configValue - ); - throw Error("Not implemented"); -} - -export async function retrieveMicrosoftSharepointContentNodeParents( - connectorId: ModelId, - internalId: string, - memoizationKey?: string -): Promise> { - console.log( - "retrieveMicrosoftSharepointContentNodeParents", - connectorId, - internalId, - memoizationKey - ); - throw Error("Not implemented"); -} -export function retrieveMicrosoftSharepointContentNodes( - connectorId: ModelId, - internalIds: string[] -): Promise> { - console.log( - "retrieveMicrosoftSharepointContentNodes", - connectorId, - internalIds - ); - throw Error("Not implemented"); -} diff --git a/connectors/src/connectors/microsoft/sharepoint/temporal/client.ts b/connectors/src/connectors/microsoft/sharepoint/temporal/client.ts deleted file mode 100644 index 429b3fa1a05f4..0000000000000 --- a/connectors/src/connectors/microsoft/sharepoint/temporal/client.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ModelId, Result } from "@dust-tt/types"; -import { Err } from "@dust-tt/types"; - -import { ConnectorResource } from "@connectors/resources/connector_resource"; - -export async function launchMicrosoftSharepointFullSyncWorkflow( - connectorId: ModelId -): Promise> { - const connector = await ConnectorResource.fetchById(connectorId); - if (!connector) { - return new Err(new Error(`Connector ${connectorId} not found`)); - } - - throw Error("Not implemented"); -} diff --git a/connectors/src/connectors/microsoft/sharepoint/temporal/worker.ts b/connectors/src/connectors/microsoft/sharepoint/temporal/worker.ts deleted file mode 100644 index e7d01ac11d8ab..0000000000000 --- a/connectors/src/connectors/microsoft/sharepoint/temporal/worker.ts +++ /dev/null @@ -1 +0,0 @@ -export async function runMicrosoftSharepointWorker() {} diff --git a/connectors/src/connectors/microsoft/sharepoint/temporal/workflow.ts b/connectors/src/connectors/microsoft/sharepoint/temporal/workflow.ts deleted file mode 100644 index 8148e59a5c227..0000000000000 --- a/connectors/src/connectors/microsoft/sharepoint/temporal/workflow.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ModelId } from "@dust-tt/types"; - -export async function microsoftSharepointFullSync() {} - -export function microsoftSharepointFullSyncWorkflowId(connectorId: ModelId) { - return `microsoft-sharepoint-fullSync-${connectorId}`; -} diff --git a/connectors/src/connectors/microsoft/teams/temporal/config.ts b/connectors/src/connectors/microsoft/teams/temporal/config.ts deleted file mode 100644 index 89b5b889923d1..0000000000000 --- a/connectors/src/connectors/microsoft/teams/temporal/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const WORKFLOW_VERSION = 1; -export const QUEUE_NAME = `microsoft-teams-queue-v${WORKFLOW_VERSION}`; diff --git a/connectors/src/connectors/microsoft/teams/temporal/worker.ts b/connectors/src/connectors/microsoft/teams/temporal/worker.ts deleted file mode 100644 index 09f6693160947..0000000000000 --- a/connectors/src/connectors/microsoft/teams/temporal/worker.ts +++ /dev/null @@ -1 +0,0 @@ -export async function runMicrosoftTeamsWorker() {} diff --git a/connectors/src/connectors/microsoft/teams/temporal/workflow.ts b/connectors/src/connectors/microsoft/teams/temporal/workflow.ts deleted file mode 100644 index a0cd7af5c399c..0000000000000 --- a/connectors/src/connectors/microsoft/teams/temporal/workflow.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ModelId } from "@dust-tt/types"; - -export async function microsoftTeamsFullSync() {} - -export function microsoftTeamsFullSyncWorkflowId(connectorId: ModelId) { - return `microsoft-teams-fullSync-${connectorId}`; -} diff --git a/connectors/src/connectors/microsoft/teams/temporal/client.ts b/connectors/src/connectors/microsoft/temporal/client.ts similarity index 87% rename from connectors/src/connectors/microsoft/teams/temporal/client.ts rename to connectors/src/connectors/microsoft/temporal/client.ts index 80ecaa524badd..a98d0fc1e9d42 100644 --- a/connectors/src/connectors/microsoft/teams/temporal/client.ts +++ b/connectors/src/connectors/microsoft/temporal/client.ts @@ -3,7 +3,7 @@ import { Err } from "@dust-tt/types"; import { ConnectorResource } from "@connectors/resources/connector_resource"; -export async function launchMicrosoftTeamsFullSyncWorkflow( +export async function launchMicrosoftFullSyncWorkflow( connectorId: ModelId ): Promise> { const connector = await ConnectorResource.fetchById(connectorId); diff --git a/connectors/src/connectors/microsoft/sharepoint/temporal/config.ts b/connectors/src/connectors/microsoft/temporal/config.ts similarity index 100% rename from connectors/src/connectors/microsoft/sharepoint/temporal/config.ts rename to connectors/src/connectors/microsoft/temporal/config.ts diff --git a/connectors/src/connectors/microsoft/temporal/worker.ts b/connectors/src/connectors/microsoft/temporal/worker.ts new file mode 100644 index 0000000000000..c0133101e53f7 --- /dev/null +++ b/connectors/src/connectors/microsoft/temporal/worker.ts @@ -0,0 +1 @@ +export async function runMicrosoftWorker() {} diff --git a/connectors/src/connectors/microsoft/temporal/workflow.ts b/connectors/src/connectors/microsoft/temporal/workflow.ts new file mode 100644 index 0000000000000..fd207de78d9f8 --- /dev/null +++ b/connectors/src/connectors/microsoft/temporal/workflow.ts @@ -0,0 +1,7 @@ +import type { ModelId } from "@dust-tt/types"; + +export async function microsoftFullSync() {} + +export function microsoftFullSyncWorkflowId(connectorId: ModelId) { + return `microsoft-fullSync-${connectorId}`; +} diff --git a/connectors/src/lib/models/microsoft.ts b/connectors/src/lib/models/microsoft.ts index 684725f1231f4..236cef8930fa7 100644 --- a/connectors/src/lib/models/microsoft.ts +++ b/connectors/src/lib/models/microsoft.ts @@ -9,16 +9,16 @@ import { DataTypes, Model } from "sequelize"; import { sequelizeConnection } from "@connectors/resources/storage"; import { ConnectorModel } from "@connectors/resources/storage/models/connector_model"; -export class MicrosoftSharepointConfiguration extends Model< - InferAttributes, - InferCreationAttributes +export class MicrosoftConfiguration extends Model< + InferAttributes, + InferCreationAttributes > { declare id: CreationOptional; declare createdAt: CreationOptional; declare updatedAt: CreationOptional; declare connectorId: ForeignKey; } -MicrosoftSharepointConfiguration.init( +MicrosoftConfiguration.init( { id: { type: DataTypes.INTEGER, @@ -42,49 +42,9 @@ MicrosoftSharepointConfiguration.init( }, { sequelize: sequelizeConnection, - modelName: "microsoft_sharepoint_configurations", + modelName: "microsoft_configurations", indexes: [{ fields: ["connectorId"], unique: true }], } ); -ConnectorModel.hasOne(MicrosoftSharepointConfiguration); - -export class MicrosoftTeamsConfiguration extends Model< - InferAttributes, - InferCreationAttributes -> { - declare id: CreationOptional; - declare createdAt: CreationOptional; - declare updatedAt: CreationOptional; - declare connectorId: ForeignKey; -} -MicrosoftTeamsConfiguration.init( - { - id: { - type: DataTypes.INTEGER, - autoIncrement: true, - primaryKey: true, - }, - createdAt: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: DataTypes.NOW, - }, - updatedAt: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: DataTypes.NOW, - }, - connectorId: { - type: DataTypes.INTEGER, - allowNull: false, - }, - }, - { - sequelize: sequelizeConnection, - modelName: "microsoft_teams_configurations", - indexes: [{ fields: ["connectorId"], unique: true }], - } -); - -ConnectorModel.hasOne(MicrosoftTeamsConfiguration); +ConnectorModel.hasOne(MicrosoftConfiguration); diff --git a/connectors/src/resources/connector/microsoft.ts b/connectors/src/resources/connector/microsoft.ts index c8c61971de253..2cb0be1ef38fd 100644 --- a/connectors/src/resources/connector/microsoft.ts +++ b/connectors/src/resources/connector/microsoft.ts @@ -1,7 +1,7 @@ import type { Transaction } from "sequelize"; import { - MicrosoftSharepointConfiguration, + MicrosoftConfiguration, MicrosoftTeamsConfiguration, } from "@connectors/lib/models/microsoft"; import type { @@ -10,15 +10,13 @@ import type { } from "@connectors/resources/connector/strategy"; import type { ConnectorResource } from "@connectors/resources/connector_resource"; -export class MicrosoftSharepointConnectorStrategy - implements ConnectorProviderStrategy -{ +export class MicrosoftConnectorStrategy implements ConnectorProviderStrategy { async makeNew( connector: ConnectorResource, - blob: WithCreationAttributes, + blob: WithCreationAttributes, transaction: Transaction ): Promise { - await MicrosoftSharepointConfiguration.create( + await MicrosoftConfiguration.create( { ...blob, connectorId: connector.id, @@ -31,7 +29,7 @@ export class MicrosoftSharepointConnectorStrategy connector: ConnectorResource, transaction: Transaction ): Promise { - await MicrosoftSharepointConfiguration.destroy({ + await MicrosoftConfiguration.destroy({ where: { connectorId: connector.id, }, @@ -45,7 +43,7 @@ export class MicrosoftTeamsConnectorStrategy { async makeNew( connector: ConnectorResource, - blob: WithCreationAttributes, + blob: WithCreationAttributes, transaction: Transaction ): Promise { await MicrosoftTeamsConfiguration.create( diff --git a/connectors/src/resources/connector/strategy.ts b/connectors/src/resources/connector/strategy.ts index c5ffb6c6ef617..d2f33c0f1cf08 100644 --- a/connectors/src/resources/connector/strategy.ts +++ b/connectors/src/resources/connector/strategy.ts @@ -7,7 +7,7 @@ import type { GithubConnectorState } from "@connectors/lib/models/github"; import type { GoogleDriveConfig } from "@connectors/lib/models/google_drive"; import type { IntercomWorkspace } from "@connectors/lib/models/intercom"; import type { - MicrosoftSharepointConfiguration, + MicrosoftConfiguration, MicrosoftTeamsConfiguration, } from "@connectors/lib/models/microsoft"; import type { NotionConnectorState } from "@connectors/lib/models/notion"; @@ -18,7 +18,7 @@ import { GithubConnectorStrategy } from "@connectors/resources/connector/github" import { GoogleDriveConnectorStrategy } from "@connectors/resources/connector/google_drive"; import { IntercomConnectorStrategy } from "@connectors/resources/connector/intercom"; import { - MicrosoftSharepointConnectorStrategy, + MicrosoftConnectorStrategy as MicrosoftConnectorStrategy, MicrosoftTeamsConnectorStrategy, } from "@connectors/resources/connector/microsoft"; import { NotionConnectorStrategy } from "@connectors/resources/connector/notion"; @@ -33,8 +33,7 @@ export interface ConnectorProviderModelM { github: GithubConnectorState; google_drive: GoogleDriveConfig; intercom: IntercomWorkspace; - microsoft_sharepoint: MicrosoftSharepointConfiguration; - microsoft_teams: MicrosoftTeamsConfiguration; + microsoft: MicrosoftConfiguration; notion: NotionConnectorState; slack: SlackConfigurationModel; webcrawler: WebCrawlerConfigurationModel; @@ -73,11 +72,8 @@ export function getConnectorProviderStrategy(type: ConnectorProvider) { case "intercom": return new IntercomConnectorStrategy(); - case "microsoft_sharepoint": - return new MicrosoftSharepointConnectorStrategy(); - - case "microsoft_teams": - return new MicrosoftTeamsConnectorStrategy(); + case "microsoft": + return new MicrosoftConnectorStrategy(); case "notion": return new NotionConnectorStrategy(); diff --git a/connectors/src/start_worker.ts b/connectors/src/start_worker.ts index 1b8e2859cb7cf..bebcf92941a0d 100644 --- a/connectors/src/start_worker.ts +++ b/connectors/src/start_worker.ts @@ -4,8 +4,8 @@ import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import { runConfluenceWorker } from "@connectors/connectors/confluence/temporal/worker"; -import { runMicrosoftSharepointWorker } from "@connectors/connectors/microsoft/sharepoint/temporal/worker"; import { runMicrosoftTeamsWorker } from "@connectors/connectors/microsoft/teams/temporal/worker"; +import { runMicrosoftWorker } from "@connectors/connectors/microsoft/temporal/worker"; import { runWebCrawlerWorker } from "@connectors/connectors/webcrawler/temporal/worker"; import { runGithubWorker } from "./connectors/github/temporal/worker"; @@ -23,8 +23,7 @@ const workerFunctions: Record Promise> = { github: runGithubWorker, google_drive: runGoogleWorker, intercom: runIntercomWorker, - microsoft_sharepoint: runMicrosoftSharepointWorker, - microsoft_teams: runMicrosoftTeamsWorker, + microsoft: runMicrosoftWorker, notion: runNotionWorker, slack: runSlackWorker, webcrawler: runWebCrawlerWorker, diff --git a/front/components/ConnectorPermissionsModal.tsx b/front/components/ConnectorPermissionsModal.tsx index 1f1ba86d0a969..ef54cba06e861 100644 --- a/front/components/ConnectorPermissionsModal.tsx +++ b/front/components/ConnectorPermissionsModal.tsx @@ -17,8 +17,7 @@ const PERMISSIONS_EDITABLE_CONNECTOR_TYPES: Set = new Set([ "confluence", "slack", "google_drive", - "microsoft_sharepoint", - "microsoft_teams", + "microsoft", "intercom", ]); diff --git a/front/components/ConnectorPermissionsTree.tsx b/front/components/ConnectorPermissionsTree.tsx index acd95e6483b4b..6473f9b07dbb4 100644 --- a/front/components/ConnectorPermissionsTree.tsx +++ b/front/components/ConnectorPermissionsTree.tsx @@ -33,8 +33,7 @@ const CONNECTOR_TYPE_TO_PERMISSIONS: Record< selected: "read", unselected: "none", }, - microsoft_sharepoint: undefined, - microsoft_teams: undefined, + microsoft: undefined, notion: undefined, github: undefined, intercom: { diff --git a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx index 018846a140635..d56c6d7b6a16d 100644 --- a/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx +++ b/front/components/assistant_builder/AssistantBuilderDataSourceModal.tsx @@ -42,8 +42,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record< slack: { singular: "channel", plural: "channels" }, github: { singular: "repository", plural: "repositories" }, intercom: { singular: "article", plural: "articles" }, - microsoft_sharepoint: { singular: "folder", plural: "folders" }, - microsoft_teams: { singular: "channel", plural: "channels" }, + microsoft: { singular: "folder", plural: "folders" }, webcrawler: { singular: "page", plural: "pages" }, }; @@ -621,8 +620,7 @@ function getDisplayNameForDataSource(ds: DataSourceType) { case "google_drive": case "github": case "intercom": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": case "notion": return CONNECTOR_CONFIGURATIONS[ds.connectorProvider].name; case "webcrawler": diff --git a/front/components/assistant_builder/shared.ts b/front/components/assistant_builder/shared.ts index 42c2eadc3870e..a9930953f5cb9 100644 --- a/front/components/assistant_builder/shared.ts +++ b/front/components/assistant_builder/shared.ts @@ -23,8 +23,7 @@ export const CONNECTOR_PROVIDER_TO_RESOURCE_NAME: Record< } > = { confluence: { singular: "space", plural: "spaces" }, - microsoft_sharepoint: { singular: "folder", plural: "folders" }, - microsoft_teams: { singular: "channel", plural: "channels" }, + microsoft: { singular: "folder", plural: "folders" }, notion: { singular: "page", plural: "pages" }, google_drive: { singular: "folder", plural: "folders" }, slack: { singular: "channel", plural: "channels" }, diff --git a/front/lib/connector_providers.ts b/front/lib/connector_providers.ts index 2781939bb9329..6dccba03e4692 100644 --- a/front/lib/connector_providers.ts +++ b/front/lib/connector_providers.ts @@ -102,29 +102,16 @@ export const CONNECTOR_CONFIGURATIONS: Record< logoComponent: IntercomLogo, isNested: true, }, - microsoft_sharepoint: { - name: "Microsoft Sharepoint", - connectorProvider: "microsoft_sharepoint", + microsoft: { + name: "Microsoft", + connectorProvider: "microsoft", status: "rolling_out", rollingOutFlag: "microsoft_connector", - hide: true, + hide: false, description: - "Authorize access to Microsoft SharePoint for indexing shared documents stored in SharePoint, OneDrive, and Office365.", + "Authorize access to Microsoft for indexing shared documents stored in SharePoint, OneDrive, and Office365, and Teams discussions.", limitations: - "Dust will index the documents shared with the authorized account only.", - guideLink: "https://dust-tt.notion.site/", - logoComponent: MicrosoftLogo, - isNested: true, - }, - microsoft_teams: { - name: "Microsoft Teams", - connectorProvider: "microsoft_teams", - status: "rolling_out", - rollingOutFlag: "microsoft_connector", - hide: true, - description: - "Authorize access to Microsoft Teams for indexing discussions and resources.", - limitations: "Dust will index discussions in the public channels only", + "Dust will index the documents shared with the authorized account only. Only Teams publi cchannels will be indexed.", guideLink: "https://dust-tt.notion.site/", logoComponent: MicrosoftLogo, isNested: true, diff --git a/front/lib/data_sources.ts b/front/lib/data_sources.ts index 19d4a487ef67d..cb029b7dc095e 100644 --- a/front/lib/data_sources.ts +++ b/front/lib/data_sources.ts @@ -20,8 +20,7 @@ export function getDisplayNameForDataSource(ds: DataSourceType) { case "google_drive": case "github": case "intercom": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": case "notion": return CONNECTOR_CONFIGURATIONS[ds.connectorProvider].name; break; diff --git a/front/pages/api/w/[wId]/data_sources/[name]/configuration.ts b/front/pages/api/w/[wId]/data_sources/[name]/configuration.ts index 92862a08259f5..fa81973d10b66 100644 --- a/front/pages/api/w/[wId]/data_sources/[name]/configuration.ts +++ b/front/pages/api/w/[wId]/data_sources/[name]/configuration.ts @@ -91,8 +91,7 @@ async function handler( case "google_drive": case "intercom": case "notion": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": case "slack": if (!auth.isAdmin()) { return apiError(req, res, { diff --git a/front/pages/api/w/[wId]/data_sources/managed.ts b/front/pages/api/w/[wId]/data_sources/managed.ts index 6a8ab09d3df9e..bd91bb27acf4c 100644 --- a/front/pages/api/w/[wId]/data_sources/managed.ts +++ b/front/pages/api/w/[wId]/data_sources/managed.ts @@ -125,8 +125,7 @@ async function handler( case "google_drive": case "intercom": case "notion": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": case "slack": { if (!auth.isAdmin()) { return apiError(req, res, { @@ -229,8 +228,7 @@ async function handler( isDataSourceAllowedInPlan = plan.limits.connections.isIntercomAllowed; assistantDefaultSelected = true; break; - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": isDataSourceAllowedInPlan = true; assistantDefaultSelected = true; break; diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx index d02905d1c7c85..2f1789ccc13b7 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx @@ -63,8 +63,7 @@ const { NANGO_CONFLUENCE_CONNECTOR_ID = "", NANGO_GOOGLE_DRIVE_CONNECTOR_ID = "", NANGO_INTERCOM_CONNECTOR_ID = "", - NANGO_MICROSOFT_SHAREPOINT_CONNECTOR_ID = "", - NANGO_MICROSOFT_TEAMS_CONNECTOR_ID = "", + NANGO_MICROSOFT_CONNECTOR_ID = "", NANGO_NOTION_CONNECTOR_ID = "", NANGO_PUBLIC_KEY = "", NANGO_SLACK_CONNECTOR_ID = "", @@ -87,8 +86,7 @@ export const getServerSideProps = withDefaultUserAuthRequirements<{ notionConnectorId: string; googleDriveConnectorId: string; intercomConnectorId: string; - msSharepointConnectorId: string; - msTeamsConnectorId: string; + microsoftConnectorId: string; }; githubAppUrl: string; gaTrackingId: string; @@ -150,8 +148,7 @@ export const getServerSideProps = withDefaultUserAuthRequirements<{ notionConnectorId: NANGO_NOTION_CONNECTOR_ID, googleDriveConnectorId: NANGO_GOOGLE_DRIVE_CONNECTOR_ID, intercomConnectorId: NANGO_INTERCOM_CONNECTOR_ID, - msSharepointConnectorId: NANGO_MICROSOFT_SHAREPOINT_CONNECTOR_ID, - msTeamsConnectorId: NANGO_MICROSOFT_TEAMS_CONNECTOR_ID, + microsoftConnectorId: NANGO_MICROSOFT_CONNECTOR_ID, }, githubAppUrl: GITHUB_APP_URL, gaTrackingId: GA_TRACKING_ID, @@ -947,8 +944,7 @@ const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record = { "You cannot select another Google Drive Domain.\nPlease contact us at team@dust.tt if you initially selected a wrong shared Drive.", intercom: "You cannot select another Intercom Workspace.\nPlease contact us at team@dust.tt if you initially selected a wrong Workspace.", - microsoft_sharepoint: `Microsoft Sharepoint/ mismatch error.`, - microsoft_teams: `Microsoft Teams / mismatch error.`, + microsoft: `Microsoft / mismatch error.`, webcrawler: "You cannot change the URL. Please add a new Public URL instead.", }; @@ -973,8 +969,7 @@ function getRenderingConfigForConnectorProvider( switch (connectorProvider) { case "confluence": case "google_drive": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": return { ...commonConfig, displayDataSourceDetailsModal: true, @@ -1043,8 +1038,7 @@ function ManagedDataSourceView({ notionConnectorId: string; googleDriveConnectorId: string; intercomConnectorId: string; - msSharepointConnectorId: string; - msTeamsConnectorId: string; + microsoftConnectorId: string; }; githubAppUrl: string; plan: PlanType; @@ -1093,8 +1087,7 @@ function ManagedDataSourceView({ intercom: nangoConfig.intercomConnectorId, notion: nangoConfig.notionConnectorId, slack: nangoConfig.slackConnectorId, - microsoft_sharepoint: nangoConfig.msSharepointConnectorId, - microsoft_teams: nangoConfig.msTeamsConnectorId, + microsoft: nangoConfig.microsoftConnectorId, }[provider]; const nango = new Nango({ publicKey: nangoConfig.publicKey }); @@ -1240,8 +1233,7 @@ function ManagedDataSourceView({ case "github": case "notion": case "intercom": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": return `Manage Dust connection to ${CONNECTOR_CONFIGURATIONS[connectorProvider].name}`; case "webcrawler": return `Manage Website`; @@ -1340,8 +1332,7 @@ function ManagedDataSourceView({ case "github": case "notion": case "intercom": - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": return ( <> Selected resources will be accessible to all members diff --git a/front/pages/w/[wId]/builder/data-sources/managed.tsx b/front/pages/w/[wId]/builder/data-sources/managed.tsx index c268c4140e9b3..2814abead2458 100644 --- a/front/pages/w/[wId]/builder/data-sources/managed.tsx +++ b/front/pages/w/[wId]/builder/data-sources/managed.tsx @@ -45,8 +45,7 @@ const { NANGO_CONFLUENCE_CONNECTOR_ID = "", NANGO_GOOGLE_DRIVE_CONNECTOR_ID = "", NANGO_INTERCOM_CONNECTOR_ID = "", - NANGO_MICROSOFT_SHAREPOINT_CONNECTOR_ID = "", - NANGO_MICROSOFT_TEAMS_CONNECTOR_ID = "", + NANGO_MICROSOFT_CONNECTOR_ID = "", NANGO_NOTION_CONNECTOR_ID = "", NANGO_PUBLIC_KEY = "", NANGO_SLACK_CONNECTOR_ID = "", @@ -71,8 +70,7 @@ type DataSourceIntegration = { const REDIRECT_TO_EDIT_PERMISSIONS = [ "confluence", "google_drive", - "microsoft_sharepoint", - "microsoft_teams", + "microsoft", "slack", "intercom", ]; @@ -92,7 +90,7 @@ export const getServerSideProps = withDefaultUserAuthRequirements<{ notionConnectorId: string; googleDriveConnectorId: string; intercomConnectorId: string; - msSharepointConnectorId: string; + microsoftConnectorId: string; msTeamsConnectorId: string; }; githubAppUrl: string; @@ -244,8 +242,7 @@ export const getServerSideProps = withDefaultUserAuthRequirements<{ notionConnectorId: NANGO_NOTION_CONNECTOR_ID, googleDriveConnectorId: NANGO_GOOGLE_DRIVE_CONNECTOR_ID, intercomConnectorId: NANGO_INTERCOM_CONNECTOR_ID, - msSharepointConnectorId: NANGO_MICROSOFT_SHAREPOINT_CONNECTOR_ID, - msTeamsConnectorId: NANGO_MICROSOFT_TEAMS_CONNECTOR_ID, + microsoftConnectorId: NANGO_MICROSOFT_CONNECTOR_ID, }, githubAppUrl: GITHUB_APP_URL, }, @@ -418,8 +415,7 @@ export default function DataSourcesView({ notion: nangoConfig.notionConnectorId, google_drive: nangoConfig.googleDriveConnectorId, intercom: nangoConfig.intercomConnectorId, - microsoft_sharepoint: nangoConfig.msSharepointConnectorId, - microsoft_teams: nangoConfig.msTeamsConnectorId, + microsoft: nangoConfig.microsoftConnectorId, }[provider]; const nango = new Nango({ publicKey: nangoConfig.publicKey }); const newConnectionId = buildConnectionId(owner.sId, provider); @@ -608,8 +604,7 @@ export default function DataSourcesView({ isDataSourceAllowedInPlan = planConnectionsLimits.isIntercomAllowed; break; - case "microsoft_sharepoint": - case "microsoft_teams": + case "microsoft": isDataSourceAllowedInPlan = true; break; case "webcrawler": diff --git a/types/src/connectors/webcrawler.ts b/types/src/connectors/webcrawler.ts index 8fa86dc4a98ae..294e7adfd085a 100644 --- a/types/src/connectors/webcrawler.ts +++ b/types/src/connectors/webcrawler.ts @@ -58,8 +58,7 @@ export type ConnectorConfigurations = { google_drive: null; github: null; confluence: null; - microsoft_sharepoint: null; - microsoft_teams: null; + microsoft: null; intercom: null; }; diff --git a/types/src/front/data_source.ts b/types/src/front/data_source.ts index 7a2777a4ce924..faaaeba144fe8 100644 --- a/types/src/front/data_source.ts +++ b/types/src/front/data_source.ts @@ -8,8 +8,7 @@ export const CONNECTOR_PROVIDERS = [ "intercom", "notion", "slack", - "microsoft_sharepoint", - "microsoft_teams", + "microsoft", "webcrawler", ] as const; diff --git a/types/src/front/lib/connectors_api.ts b/types/src/front/lib/connectors_api.ts index e7e7df464a4bb..34227e49c309e 100644 --- a/types/src/front/lib/connectors_api.ts +++ b/types/src/front/lib/connectors_api.ts @@ -33,8 +33,7 @@ export function isConnectorError(val: string): val is ConnectorErrorType { export const CONNECTOR_PROVIDERS_USING_NANGO = [ "confluence", "google_drive", - "microsoft_sharepoint", - "microsoft_teams", + "microsoft", "intercom", "notion", "slack",