Skip to content

Commit 3106144

Browse files
authored
Merge branch 'main' into WebsiteOct
2 parents 0602179 + ae13d84 commit 3106144

File tree

111 files changed

+4037
-2149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+4037
-2149
lines changed

blog/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"@mdx-js/loader": "^2.3.0",
1414
"@mdx-js/react": "^2.3.0",
15-
"@next/mdx": "^13.2.4",
15+
"@next/mdx": "^13.5.4",
1616
"autoprefixer": "^10.4.7",
1717
"dd-trace": "^3.16.0",
1818
"clsx": "^1.2.0",
@@ -21,7 +21,7 @@
2121
"mdast-util-to-string": "^3.2.0",
2222
"mdx-annotations": "^0.1.3",
2323
"motion": "^10.15.5",
24-
"next": "13.4.2",
24+
"next": "13.5.4",
2525
"next-themes": "^0.2.1",
2626
"postcss-focus-visible": "^6.0.4",
2727
"react": "18.2.0",

connectors/package-lock.json

Lines changed: 112 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

connectors/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@types/lodash.memoize": "^4.1.7",
2626
"@types/minimist": "^1.2.2",
2727
"@types/uuid": "^9.0.2",
28+
"axios": "^1.5.1",
2829
"body-parser": "^1.20.2",
2930
"dd-trace": "^3.16.0",
3031
"eventsource-parser": "^1.0.0",
@@ -47,6 +48,7 @@
4748
"pg-hstore": "^2.3.4",
4849
"pino": "^8.11.0",
4950
"pino-pretty": "^10.0.0",
51+
"redis": "^4.6.10",
5052
"sequelize": "^6.31.0",
5153
"uuid": "^9.0.0"
5254
},

connectors/src/api/bot_enabled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const _setBotEnabled = async (
108108
return apiError(req, res, {
109109
api_error: {
110110
type: "internal_server_error",
111-
message: `An error occurred while enabling the bot: ${toggleRes.error}`,
111+
message: `An error occurred while toggling the bot: ${toggleRes.error.message}`,
112112
},
113113
status_code: 500,
114114
});

connectors/src/api/get_connector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const _getConnector = async (
7878
firstSuccessfulSyncTime: connector.firstSuccessfulSyncTime?.getTime(),
7979
firstSyncProgress,
8080
defaultNewResourcePermission: connector.defaultNewResourcePermission,
81+
errorType: connector.errorType || undefined,
8182
});
8283
};
8384

connectors/src/connectors/google_drive/temporal/activities.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { literal, Op } from "sequelize";
2323

2424
import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config";
2525
import { dpdf2text } from "@connectors/lib/dpdf2text";
26+
import { ExternalOauthTokenError } from "@connectors/lib/error";
2627
import {
2728
Connector,
2829
GoogleDriveFiles,
@@ -861,6 +862,19 @@ export async function renewOneWebhook(webhookId: ModelId) {
861862
});
862863
}
863864
} catch (e) {
865+
if (e instanceof ExternalOauthTokenError) {
866+
logger.info(
867+
{
868+
error: e,
869+
connectorId: wh.connectorId,
870+
workspaceId: connector.workspaceId,
871+
id: wh.id,
872+
},
873+
`Deleting webhook because the oauth token was revoked.`
874+
);
875+
await wh.destroy();
876+
return;
877+
}
864878
logger.error({ error: e }, `Failed to renew webhook`);
865879
const tags = [
866880
`connector_id:${wh.connectorId}`,

connectors/src/connectors/google_drive/temporal/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ export async function launchGoogleDriveFullSyncWorkflow(
5353
args: [connectorIdModelId, nangoConnectionId, dataSourceConfig],
5454
taskQueue: "google-queue",
5555
workflowId: workflowId,
56+
57+
memo: {
58+
connectorId: connectorId,
59+
},
5660
});
5761
logger.info(
5862
{

connectors/src/connectors/notion/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
nango_client,
1919
nangoDeleteConnection,
2020
} from "@connectors/lib/nango_client";
21+
import { getAccessTokenFromNango } from "@connectors/lib/nango_helpers";
2122
import { Err, Ok, Result } from "@connectors/lib/result";
2223
import mainLogger from "@connectors/logger/logger";
2324
import { DataSourceConfig } from "@connectors/types/data_source_config";
@@ -44,10 +45,11 @@ export async function createNotionConnector(
4445
throw new Error("NANGO_NOTION_CONNECTOR_ID not set");
4546
}
4647

47-
const notionAccessToken = (await nango_client().getToken(
48-
NANGO_NOTION_CONNECTOR_ID,
49-
nangoConnectionId
50-
)) as string;
48+
const notionAccessToken = await getAccessTokenFromNango({
49+
connectionId: nangoConnectionId,
50+
integrationId: NANGO_NOTION_CONNECTOR_ID,
51+
useCache: false,
52+
});
5153

5254
if (!validateAccessToken(notionAccessToken)) {
5355
return new Err(new Error("Notion access token is invalid"));

connectors/src/connectors/notion/lib/notion_api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,9 @@ function parsePropertyText(
729729
? property.title.map((t) => t.plain_text).join(" ")
730730
: null;
731731
case "rich_text":
732-
return property.rich_text.map((t) => t.plain_text).join(" ");
732+
return property.rich_text && property.rich_text.map
733+
? property.rich_text.map((t) => t.plain_text).join(" ")
734+
: null;
733735
case "people":
734736
return property.people.length > 0
735737
? property.people.map((p) => ("name" in p ? p.name : p.id)).join(", ")

0 commit comments

Comments
 (0)