This commit is contained in:
Martin McKeaveney 2024-11-19 19:02:22 +00:00
parent 795f20988a
commit 79c515e57d
6 changed files with 16 additions and 11 deletions

View File

@ -132,7 +132,7 @@
"@types/koa-send": "^4.1.6", "@types/koa-send": "^4.1.6",
"@types/koa__router": "12.0.4", "@types/koa__router": "12.0.4",
"@types/lodash": "4.14.200", "@types/lodash": "4.14.200",
"@types/mssql": "9.1.4", "@types/mssql": "9.1.5",
"@types/node-fetch": "2.6.4", "@types/node-fetch": "2.6.4",
"@types/oracledb": "6.5.1", "@types/oracledb": "6.5.1",
"@types/pg": "8.6.6", "@types/pg": "8.6.6",

View File

@ -2,7 +2,7 @@ import { ImportSource, ImportInfo } from "./base"
import { Query } from "../../../../../definitions/common" import { Query } from "../../../../../definitions/common"
import { URL } from "url" import { URL } from "url"
const parseCurl = async (data: string): any => { const parseCurl = async (data: string): Promise<any> => {
const curlconverter = await import("curlconverter") const curlconverter = await import("curlconverter")
const curlJson = curlconverter.toJsonString(data) const curlJson = curlconverter.toJsonString(data)
return JSON.parse(curlJson) return JSON.parse(curlJson)

View File

@ -281,6 +281,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
case MSSQLConfigAuthType.NTLM: { case MSSQLConfigAuthType.NTLM: {
const { domain, trustServerCertificate } = const { domain, trustServerCertificate } =
this.config.ntlmConfig || {} this.config.ntlmConfig || {}
clientCfg.authentication = { clientCfg.authentication = {
type: "ntlm", type: "ntlm",
options: { options: {

View File

@ -74,14 +74,14 @@ const SCHEMA: Integration = {
class SnowflakePromise { class SnowflakePromise {
config: SnowflakeConfig config: SnowflakeConfig
client: snowflakeSdk client?: snowflakeSdk.Connection
constructor(config: SnowflakeConfig) { constructor(config: SnowflakeConfig) {
this.config = config this.config = config
} }
async connect() { async connect() {
if (this.client?.isConnected()) return if (this.client?.isUp()) return
this.client = snowflakeSdk.createConnection(this.config) this.client = snowflakeSdk.createConnection(this.config)
const connectAsync = promisify(this.client.connect.bind(this.client)) const connectAsync = promisify(this.client.connect.bind(this.client))
@ -89,6 +89,10 @@ class SnowflakePromise {
} }
async execute(sql: string) { 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) => { return new Promise((resolve, reject) => {
this.client.execute({ this.client.execute({
sqlText: sql, sqlText: sql,

View File

@ -1,4 +1,4 @@
import jimp from "jimp" import { Jimp } from "jimp"
const FORMATS = { const FORMATS = {
IMAGES: ["png", "jpg", "jpeg", "gif", "bmp", "tiff"], IMAGES: ["png", "jpg", "jpeg", "gif", "bmp", "tiff"],
@ -6,8 +6,8 @@ const FORMATS = {
function processImage(file: { path: string }) { function processImage(file: { path: string }) {
// this will overwrite the temp file // this will overwrite the temp file
return jimp.read(file.path).then(img => { return Jimp.read(file.path).then(img => {
return img.resize(300, jimp.AUTO).write(file.path) return img.resize({ w: 256 }).write(file.path as `${string}.${string}`)
}) })
} }

View File

@ -5575,10 +5575,10 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==
"@types/mssql@9.1.4": "@types/mssql@9.1.5":
version "9.1.4" version "9.1.5"
resolved "https://registry.yarnpkg.com/@types/mssql/-/mssql-9.1.4.tgz#d485b06494a76d15b957e0952305c55053bac366" resolved "https://registry.yarnpkg.com/@types/mssql/-/mssql-9.1.5.tgz#1574a5870aeb029c6d787861af101161b9b8d3b6"
integrity sha512-st2ryK+viraRuptxcGs+66J0RrABytxhGxUlpWcOniNPzpnxIaeNhPJVM3lZn1r+s/6lQARYID6Z+MBoseSD8g== integrity sha512-Q9EsgXwuRoX5wvUSu24YfbKMbFChv7pZ/jeCzPkj47ehcuXYsBcfogwrtVFosSjinD4Q/MY2YPGk9Yy1cM2Ywg==
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/tedious" "*" "@types/tedious" "*"