diff --git a/packages/server/package.json b/packages/server/package.json index 2727f17e60..8ff2c1f8c2 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -132,7 +132,7 @@ "@types/koa-send": "^4.1.6", "@types/koa__router": "12.0.4", "@types/lodash": "4.14.200", - "@types/mssql": "9.1.4", + "@types/mssql": "9.1.5", "@types/node-fetch": "2.6.4", "@types/oracledb": "6.5.1", "@types/pg": "8.6.6", diff --git a/packages/server/src/api/controllers/query/import/sources/curl.ts b/packages/server/src/api/controllers/query/import/sources/curl.ts index f1747c9fc7..3e0ea1bcd7 100644 --- a/packages/server/src/api/controllers/query/import/sources/curl.ts +++ b/packages/server/src/api/controllers/query/import/sources/curl.ts @@ -2,7 +2,7 @@ import { ImportSource, ImportInfo } from "./base" import { Query } from "../../../../../definitions/common" import { URL } from "url" -const parseCurl = async (data: string): any => { +const parseCurl = async (data: string): Promise => { const curlconverter = await import("curlconverter") const curlJson = curlconverter.toJsonString(data) return JSON.parse(curlJson) diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 0a07371cd3..48d7c15f42 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -281,6 +281,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { case MSSQLConfigAuthType.NTLM: { const { domain, trustServerCertificate } = this.config.ntlmConfig || {} + clientCfg.authentication = { type: "ntlm", options: { diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index 6b3c79ed52..00c5ec6d38 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -74,14 +74,14 @@ const SCHEMA: Integration = { class SnowflakePromise { config: SnowflakeConfig - client: snowflakeSdk + client?: snowflakeSdk.Connection constructor(config: SnowflakeConfig) { this.config = config } async connect() { - if (this.client?.isConnected()) return + if (this.client?.isUp()) return this.client = snowflakeSdk.createConnection(this.config) const connectAsync = promisify(this.client.connect.bind(this.client)) @@ -89,6 +89,10 @@ class SnowflakePromise { } async execute(sql: string) { + if (!this.client) { + throw Error("No snowflake client present to execute query. Run connect() first to initialise.") + } + return new Promise((resolve, reject) => { this.client.execute({ sqlText: sql, diff --git a/packages/server/src/utilities/fileSystem/processor.ts b/packages/server/src/utilities/fileSystem/processor.ts index a32a7568f4..03fbf4ad0a 100644 --- a/packages/server/src/utilities/fileSystem/processor.ts +++ b/packages/server/src/utilities/fileSystem/processor.ts @@ -1,4 +1,4 @@ -import jimp from "jimp" +import { Jimp } from "jimp" const FORMATS = { IMAGES: ["png", "jpg", "jpeg", "gif", "bmp", "tiff"], @@ -6,8 +6,8 @@ const FORMATS = { function processImage(file: { path: string }) { // this will overwrite the temp file - return jimp.read(file.path).then(img => { - return img.resize(300, jimp.AUTO).write(file.path) + return Jimp.read(file.path).then(img => { + return img.resize({ w: 256 }).write(file.path as `${string}.${string}`) }) } diff --git a/yarn.lock b/yarn.lock index a7b13c751e..b3cb15f423 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5575,10 +5575,10 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== -"@types/mssql@9.1.4": - version "9.1.4" - resolved "https://registry.yarnpkg.com/@types/mssql/-/mssql-9.1.4.tgz#d485b06494a76d15b957e0952305c55053bac366" - integrity sha512-st2ryK+viraRuptxcGs+66J0RrABytxhGxUlpWcOniNPzpnxIaeNhPJVM3lZn1r+s/6lQARYID6Z+MBoseSD8g== +"@types/mssql@9.1.5": + version "9.1.5" + resolved "https://registry.yarnpkg.com/@types/mssql/-/mssql-9.1.5.tgz#1574a5870aeb029c6d787861af101161b9b8d3b6" + integrity sha512-Q9EsgXwuRoX5wvUSu24YfbKMbFChv7pZ/jeCzPkj47ehcuXYsBcfogwrtVFosSjinD4Q/MY2YPGk9Yy1cM2Ywg== dependencies: "@types/node" "*" "@types/tedious" "*"