Skip to content

Commit

Permalink
fix(deps): update dependency knex to ^0.95.11 (#837)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency knex to ^0.95.11

* Changes

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Nathan Bierema <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2021
1 parent 503be15 commit 0400e0c
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 328 deletions.
3 changes: 1 addition & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ packageExtensions:
'apollo-server-core@^3.4.0':
dependencies:
'@types/node': '^14.17.15'
'knex@^0.19.5':
'tarn@^3.0.1':
dependencies:
'@types/node': '^14.17.15'
'sqlite3': '^5.0.2'
'@chakra-ui/switch@^1.2.10':
peerDependencies:
'framer-motion': '3.x || 4.x'
Expand Down
2 changes: 1 addition & 1 deletion packages/redux-devtools-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"express": "^4.17.1",
"getport": "^0.1.0",
"graphql": "^15.6.1",
"knex": "^0.19.5",
"knex": "^0.95.11",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"morgan": "^1.10.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/redux-devtools-cli/src/db/connector.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import path from 'path';
import knexModule, { Config } from 'knex';
import knexModule, { Knex } from 'knex';
import { SCServer } from 'socketcluster-server';

export default function connector(options: SCServer.SCServerOptions) {
const dbOptions = options.dbOptions as Config;
const dbOptions = options.dbOptions as Knex.Config;
dbOptions.useNullAsDefault = true;
if (!(dbOptions as any).migrate) {
return knexModule(dbOptions);
Expand Down
6 changes: 3 additions & 3 deletions packages/redux-devtools-cli/src/db/migrations/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type knexModule from 'knex';
import { Knex } from 'knex';

export function up(knex: knexModule) {
export function up(knex: Knex) {
return Promise.all([
knex.schema.createTable('remotedev_reports', function (table) {
table.uuid('id').primary();
Expand Down Expand Up @@ -79,7 +79,7 @@ export function up(knex: knexModule) {
]);
}

export function down(knex: knexModule) {
export function down(knex: Knex) {
return Promise.all([
knex.schema.dropTable('remotedev_reports'),
knex.schema.dropTable('remotedev_apps'),
Expand Down
4 changes: 2 additions & 2 deletions packages/redux-devtools-cli/src/db/seeds/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type knexModule from 'knex';
import { Knex } from 'knex';

export function seed(knex: knexModule) {
export function seed(knex: Knex) {
return Promise.all([knex('remotedev_apps').del()]).then(function () {
return Promise.all([
knex('remotedev_apps').insert({
Expand Down
2 changes: 1 addition & 1 deletion packages/redux-devtools-cli/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function routes(
break;
case 'list':
store
.list(req.body.query, req.body.fields as string[])
.list(req.body.query as string, req.body.fields as string[])
.then(function (r) {
res.send(r);
})
Expand Down
12 changes: 6 additions & 6 deletions packages/redux-devtools-cli/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { v4 as uuidV4 } from 'uuid';
import pick from 'lodash/pick';
import { SCServer } from 'socketcluster-server';
import knexModule from 'knex';
import { Knex } from 'knex';
import connector from './db/connector';

const reports = 'remotedev_reports';
// var payloads = 'remotedev_payloads';
let knex: knexModule;
let knex: Knex;

const baseFields = ['id', 'title', 'added'];

Expand Down Expand Up @@ -44,13 +44,13 @@ export interface ReportBaseFields {
added: string | null;
}

function list(query?: unknown, fields?: string[]): Promise<ReportBaseFields[]> {
function list(query?: string, fields?: string[]): Promise<ReportBaseFields[]> {
const r = knex.select(fields || baseFields).from(reports);
if (query) return r.where(query);
return r;
}

function listAll(query: unknown): Promise<Report[]> {
function listAll(query?: string): Promise<Report[]> {
const r = knex.select().from(reports);
if (query) return r.where(query);
return r;
Expand Down Expand Up @@ -133,8 +133,8 @@ function byBaseFields(data: Report): ReportBaseFields {
}

export interface Store {
list: (query?: unknown, fields?: string[]) => Promise<ReportBaseFields[]>;
listAll: (query?: unknown) => Promise<Report[]>;
list: (query?: string, fields?: string[]) => Promise<ReportBaseFields[]>;
listAll: (query?: string) => Promise<Report[]>;
get: (id: string) => Promise<Report | { error: string }>;
add: (data: AddData) => Promise<ReportBaseFields | { error: string }>;
}
Expand Down
Loading

0 comments on commit 0400e0c

Please sign in to comment.