From 716e642d08d0582599149a8cdda4a908e84a8d91 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Feb 2024 15:30:38 +0100 Subject: [PATCH] Types --- packages/server/src/threads/definitions.ts | 4 ++-- packages/server/src/threads/query.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/server/src/threads/definitions.ts b/packages/server/src/threads/definitions.ts index 90dc136cb5..52f5576d9d 100644 --- a/packages/server/src/threads/definitions.ts +++ b/packages/server/src/threads/definitions.ts @@ -1,10 +1,10 @@ -import { QuerySchema, Row } from "@budibase/types" +import { Datasource, QuerySchema, Row } from "@budibase/types" export type WorkerCallback = (error: any, response?: any) => void export interface QueryEvent { appId?: string - datasource: any + datasource: Datasource queryVerb: string fields: { [key: string]: any } parameters: { [key: string]: any } diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index e31bc70b6a..97906317fc 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -14,13 +14,13 @@ import { context, cache, auth } from "@budibase/backend-core" import { getGlobalIDFromUserMetadataID } from "../db/utils" import sdk from "../sdk" import { cloneDeep } from "lodash/fp" -import { Query } from "@budibase/types" +import { Datasource, Query } from "@budibase/types" import { isSQL } from "../integrations/utils" import { interpolateSQL } from "../integrations/queries/sql" class QueryRunner { - datasource: any + datasource: Datasource queryVerb: string queryId: string fields: any @@ -68,7 +68,7 @@ class QueryRunner { throw "Integration type does not exist." } - if (datasourceClone.config.authConfigs) { + if (datasourceClone.config?.authConfigs) { const updatedConfigs = [] for (let config of datasourceClone.config.authConfigs) { updatedConfigs.push(await sdk.queries.enrichContext(config, this.ctx)) @@ -93,7 +93,7 @@ class QueryRunner { const enrichedContext = { ...enrichedParameters, ...this.ctx } // Parse global headers - if (datasourceClone.config.defaultHeaders) { + if (datasourceClone.config?.defaultHeaders) { datasourceClone.config.defaultHeaders = await sdk.queries.enrichContext( datasourceClone.config.defaultHeaders, enrichedContext