diff --git a/connectors/migrations/20240529_clean_gdrive_folders.ts b/connectors/migrations/20240529_clean_gdrive_folders.ts index 0854402e332c..3c0dd6ed0430 100644 --- a/connectors/migrations/20240529_clean_gdrive_folders.ts +++ b/connectors/migrations/20240529_clean_gdrive_folders.ts @@ -5,7 +5,7 @@ import { getAuthObject, getDocumentId, } from "@connectors/connectors/google_drive/temporal/utils"; -import { ExternalOauthTokenError } from "@connectors/lib/error"; +import { ExternalOAuthTokenError } from "@connectors/lib/error"; import { GoogleDriveFiles, GoogleDriveFolders, @@ -63,7 +63,7 @@ async function main() { try { return await getAuthObject(connector.connectionId); } catch (e) { - if (e instanceof ExternalOauthTokenError) { + if (e instanceof ExternalOAuthTokenError) { logger.info( { connectorId, folderId }, `Auth revoked, deleting folder (live: ${LIVE})` diff --git a/connectors/src/connectors/github/lib/github_api.ts b/connectors/src/connectors/github/lib/github_api.ts index 387336fae5d4..c7d68441de09 100644 --- a/connectors/src/connectors/github/lib/github_api.ts +++ b/connectors/src/connectors/github/lib/github_api.ts @@ -29,7 +29,7 @@ import { GetRepoDiscussionsPayloadSchema, } from "@connectors/connectors/github/lib/github_graphql"; import { apiConfig } from "@connectors/lib/api/config"; -import { ExternalOauthTokenError } from "@connectors/lib/error"; +import { ExternalOAuthTokenError } from "@connectors/lib/error"; import { getOAuthConnectionAccessTokenWithThrow } from "@connectors/lib/oauth"; import logger from "@connectors/logger/logger"; @@ -102,7 +102,7 @@ export async function installationIdFromConnectionId( export async function getReposPage( connectionId: string, page: number -): Promise> { +): Promise> { try { const octokit = await getOctokit(connectionId); @@ -128,7 +128,7 @@ export async function getReposPage( ); } catch (e) { if (isGithubRequestErrorNotFound(e)) { - return new Err(new ExternalOauthTokenError(e)); + return new Err(new ExternalOAuthTokenError(e)); } throw e; } @@ -691,7 +691,7 @@ export async function processRepository({ ).data; } catch (err) { if (isGithubRequestErrorNotFound(err)) { - return new Err(new ExternalOauthTokenError(err)); + return new Err(new ExternalOAuthTokenError(err)); } throw err; diff --git a/connectors/src/connectors/github/temporal/activities.ts b/connectors/src/connectors/github/temporal/activities.ts index b961f1cbc347..1248152b5aa0 100644 --- a/connectors/src/connectors/github/temporal/activities.ts +++ b/connectors/src/connectors/github/temporal/activities.ts @@ -28,7 +28,7 @@ import { renderMarkdownSection, upsertToDatasource, } from "@connectors/lib/data_sources"; -import { ExternalOauthTokenError } from "@connectors/lib/error"; +import { ExternalOAuthTokenError } from "@connectors/lib/error"; import { GithubCodeDirectory, GithubCodeFile, @@ -961,7 +961,7 @@ export async function githubCodeSyncActivity({ Context.current().heartbeat(); if (repoRes.isErr()) { - if (repoRes.error instanceof ExternalOauthTokenError) { + if (repoRes.error instanceof ExternalOAuthTokenError) { localLogger.info( { err: repoRes.error }, "Missing Github repository tarball: Garbage collecting repo." diff --git a/connectors/src/connectors/intercom/lib/intercom_api.ts b/connectors/src/connectors/intercom/lib/intercom_api.ts index 7785844f5809..3d5256aa6e0f 100644 --- a/connectors/src/connectors/intercom/lib/intercom_api.ts +++ b/connectors/src/connectors/intercom/lib/intercom_api.ts @@ -7,7 +7,7 @@ import type { IntercomTeamType, } from "@connectors/connectors/intercom/lib/types"; import { - ExternalOauthTokenError, + ExternalOAuthTokenError, ProviderWorkflowError, } from "@connectors/lib/error"; import logger from "@connectors/logger/logger"; @@ -69,7 +69,7 @@ async function queryIntercomAPI({ const error = response.errors[0]; // This error is thrown when we are dealing with a revoked OAuth token. if (error.code === "unauthorized") { - throw new ExternalOauthTokenError(); + throw new ExternalOAuthTokenError(); } // We return null for 404 errors. if (error.code === "not_found") { diff --git a/connectors/src/connectors/notion/lib/notion_api.ts b/connectors/src/connectors/notion/lib/notion_api.ts index a6a7f57f814f..4b867a8430ac 100644 --- a/connectors/src/connectors/notion/lib/notion_api.ts +++ b/connectors/src/connectors/notion/lib/notion_api.ts @@ -33,7 +33,7 @@ import { stringify } from "csv-stringify"; import type { Logger } from "pino"; import { cacheGet, cacheSet } from "@connectors/lib/cache"; -import { ExternalOauthTokenError } from "@connectors/lib/error"; +import { ExternalOAuthTokenError } from "@connectors/lib/error"; import mainLogger from "@connectors/logger/logger"; const logger = mainLogger.child({ provider: "notion" }); @@ -54,7 +54,7 @@ async function wrapNotionAPITokenErrors( } catch (err) { if (isNotionClientError(err)) { if (err.code === "unauthorized") { - throw new ExternalOauthTokenError(err); + throw new ExternalOAuthTokenError(err); } } diff --git a/connectors/src/connectors/slack/index.ts b/connectors/src/connectors/slack/index.ts index dbbfdd9884c9..9b186492c0a0 100644 --- a/connectors/src/connectors/slack/index.ts +++ b/connectors/src/connectors/slack/index.ts @@ -20,7 +20,7 @@ import { getSlackClient, } from "@connectors/connectors/slack/lib/slack_client"; import { launchSlackSyncWorkflow } from "@connectors/connectors/slack/temporal/client.js"; -import { ExternalOauthTokenError, NangoError } from "@connectors/lib/error"; +import { ExternalOAuthTokenError, NangoError } from "@connectors/lib/error"; import { SlackChannel } from "@connectors/lib/models/slack"; import { terminateAllWorkflowsForConnectorId } from "@connectors/lib/temporal"; import logger from "@connectors/logger/logger"; @@ -376,7 +376,7 @@ export class SlackConnectorManager extends BaseConnectorManager