Types
This commit is contained in:
parent
0b0b6ddb13
commit
716e642d08
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue