mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
Changes
This commit is contained in:
parent
0d8edd24ef
commit
0d26ed09b2
|
@ -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'
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
@ -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'),
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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'];
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 }>;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user