From 22b90e6464231b6579efca4e2780b70ffb2902af Mon Sep 17 00:00:00 2001 From: Richard KEMP Date: Wed, 27 Jul 2022 14:22:38 +0200 Subject: [PATCH 1/3] chore: fix npm vulnerabilities * Before: 18 vulnerabilities (10 moderate, 6 high, 2 critical) * After: 7 vulnerabilities (5 moderate, 2 high) --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a9300cd..f901c90 100644 --- a/package.json +++ b/package.json @@ -27,14 +27,14 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/sinon": "^10.0.6", - "ava": "^3.15.0", + "ava": "^4.3.1", "coveralls": "^3.1.1", "eslint": "^8.5.0", "eslint-config-canonical": "^32.48.8", - "gitdown": "^3.1.4", + "gitdown": "^3.1.5", "husky": "^4.2.3", "nyc": "^15.1.0", - "semantic-release": "^18.0.1", + "semantic-release": "^19.0.3", "sinon": "^12.0.1", "slonik": "^26.2.2", "ts-node": "^10.4.0" From 12dfcf6f0107f395ebb108afe3a64efe80b23bde Mon Sep 17 00:00:00 2001 From: Richard KEMP Date: Wed, 27 Jul 2022 14:37:11 +0200 Subject: [PATCH 2/3] feat(deps)!: bump slonik from ^26.2.2 to ^28.1.1 --- package.json | 4 ++-- src/routines/update.ts | 4 ++-- src/routines/updateDistinct.ts | 4 ++-- src/routines/upsert.ts | 8 ++++---- src/types.ts | 4 ++-- src/utilities/assignmentList.ts | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index f901c90..5d92c33 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,11 @@ "nyc": "^15.1.0", "semantic-release": "^19.0.3", "sinon": "^12.0.1", - "slonik": "^26.2.2", + "slonik": "^28.1.1", "ts-node": "^10.4.0" }, "peerDependencies": { - "slonik": "*" + "slonik": "^28.*" }, "engines": { "node": ">=8.0" diff --git a/src/routines/update.ts b/src/routines/update.ts index d7f2d96..0026ad8 100644 --- a/src/routines/update.ts +++ b/src/routines/update.ts @@ -7,7 +7,7 @@ import { sql, } from 'slonik'; import type { - DatabaseConnectionType, + DatabaseConnection, } from 'slonik'; import type { NamedAssignmentPayload, @@ -22,7 +22,7 @@ type UpdateResultType = { }; export const update = async ( - connection: DatabaseConnectionType, + connection: DatabaseConnection, tableName: string, namedAssignmentPayload: NamedAssignmentPayload, booleanExpressionValues: Record = {}, diff --git a/src/routines/updateDistinct.ts b/src/routines/updateDistinct.ts index 2399bea..674e960 100644 --- a/src/routines/updateDistinct.ts +++ b/src/routines/updateDistinct.ts @@ -2,7 +2,7 @@ import { sql, } from 'slonik'; import type { - DatabaseConnectionType, + DatabaseConnection, } from 'slonik'; import type { NamedAssignmentPayload, @@ -17,7 +17,7 @@ type UpdateDistinctResultType = { }; export const updateDistinct = async ( - connection: DatabaseConnectionType, + connection: DatabaseConnection, tableName: string, namedAssignmentPayload: NamedAssignmentPayload, booleanExpressionValues: Record = {}, diff --git a/src/routines/upsert.ts b/src/routines/upsert.ts index 1e09963..6c49d42 100644 --- a/src/routines/upsert.ts +++ b/src/routines/upsert.ts @@ -8,15 +8,15 @@ import { sql, } from 'slonik'; import type { - DatabaseConnectionType, - ValueExpressionType, + DatabaseConnection, + ValueExpression, } from 'slonik'; import { Logger, } from '../Logger'; type NamedValueBindingsType = { - readonly [key: string]: ValueExpressionType, + readonly [key: string]: ValueExpression, }; type UpsertConfigurationType = { @@ -36,7 +36,7 @@ const defaultConfiguration = { }; export const upsert = async ( - connection: DatabaseConnectionType, + connection: DatabaseConnection, tableName: string, namedValueBindings: NamedValueBindingsType, inputUniqueConstraintColumnNames: readonly string[] | null = null, diff --git a/src/types.ts b/src/types.ts index c2f4e8a..3194608 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,7 @@ import type { - ValueExpressionType, + ValueExpression, } from 'slonik'; export type NamedAssignmentPayload = { - [key: string]: ValueExpressionType, + [key: string]: ValueExpression, }; diff --git a/src/utilities/assignmentList.ts b/src/utilities/assignmentList.ts index 1840d4f..bf193e6 100644 --- a/src/utilities/assignmentList.ts +++ b/src/utilities/assignmentList.ts @@ -2,7 +2,7 @@ import { sql, } from 'slonik'; import type { - ListSqlTokenType, + ListSqlToken, } from 'slonik'; import type { NamedAssignmentPayload, @@ -13,7 +13,7 @@ import { export const assignmentList = ( namedAssignment: NamedAssignmentPayload, -): ListSqlTokenType => { +): ListSqlToken => { const values = Object.values( Object.entries(namedAssignment).map(([ column, From 64af7f5a0b6c7e5e816c6794f6a864ef0123df04 Mon Sep 17 00:00:00 2001 From: Richard KEMP Date: Tue, 2 Aug 2022 14:55:26 +0200 Subject: [PATCH 3/3] chore: fix travis pipeline * install typescript --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5b30487..4449da3 100755 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: node_js node_js: - node - 14 +before_install: + - npm install -g typescript script: - npm run build - npm run test