Skip to content

Commit f859907

Browse files
committed
Fixes for tsc
1 parent 4355f53 commit f859907

19 files changed

+45
-46
lines changed

desktop/crud.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class GenericCrud<T extends { id: string }> {
6262
this.entity
6363
}" WHERE id = ${stubMaker()}`
6464
);
65-
const row = stmt.get(id);
65+
const row = stmt.get(id) as { data_json: string, position: number };
6666
if (!row) {
6767
return [null, -1];
6868
}
@@ -130,7 +130,7 @@ export const exportDestination = {};
130130
export const metadataCrud = {
131131
get(db: sqlite3.Database) {
132132
const stmt = db.prepare('SELECT * FROM ds_metadata');
133-
const rows = stmt.all();
133+
const rows = stmt.all() as Array<{key: string; value: string}>;
134134
const metadata: Record<string, string> = {};
135135
for (const row of rows) {
136136
metadata[row.key] = row.value;

desktop/secret.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
encodeBase64,
77
encodeUTF8,
88
} from 'tweetnacl-util';
9-
import { doOnEncryptFields, Encrypt } from '../shared/state';
9+
import { Encrypt, doOnEncryptFields } from '../shared/state';
1010
import { ensureFile } from './fs';
1111

1212
function getSigningKeyPath(signingKeyPath?: string) {

desktop/store.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
ConnectorInfo,
1111
DatabaseConnectorInfo,
1212
DatabasePanelInfo,
13-
doOnEncryptFields,
1413
Encrypt,
1514
FilePanelInfo,
1615
FilterAggregatePanelInfo,
@@ -25,11 +24,12 @@ import {
2524
ProjectState,
2625
ServerInfo,
2726
TablePanelInfo,
27+
doOnEncryptFields,
2828
} from '../shared/state';
2929
import { CODE_ROOT, DISK_ROOT, PROJECT_EXTENSION } from './constants';
3030
import {
31-
connectorCrud,
3231
GenericCrud,
32+
connectorCrud,
3333
metadataCrud,
3434
pageCrud,
3535
panelCrud,
@@ -147,7 +147,7 @@ export class Store {
147147
validateSQLiteDriver() {
148148
const memdb = new sqlite3.default(':memory:');
149149
const stmt = memdb.prepare('SELECT sqlite_version() AS version');
150-
const row = stmt.get();
150+
const row = stmt.get() as {version: string};
151151
if (!minSemver(row.version, '3.38.1')) {
152152
throw new Error(
153153
'Unsupported SQLite driver version: ' + JSON.stringify(row)
@@ -361,7 +361,7 @@ SELECT
361361
FROM ds_result o
362362
GROUP BY panel_id
363363
`);
364-
const results = stmt.all();
364+
const results = stmt.all() as Array<{panel_id: string; data_json: string}>;
365365

366366
const resultPanelMap: Record<string, PanelResult> = {};
367367
for (const result of results) {
@@ -587,7 +587,7 @@ GROUP BY panel_id
587587
const getStmt = db.prepare(
588588
`SELECT id FROM ${panelCrud.entity} WHERE page_id = ?`
589589
);
590-
const allExisting: Array<{ id: string }> = getStmt.all(data.pageId);
590+
const allExisting = getStmt.all(data.pageId) as Array<{ id: string }>;
591591

592592
// Then sort the existing ones based on the positions passed in
593593
allExisting.sort((a, b) => {

server/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import express from 'express';
22
import session from 'express-session';
33
import {
4-
Client as OpenIDClient,
5-
generators,
64
Issuer,
5+
Client as OpenIDClient,
76
TokenSet,
7+
generators,
88
} from 'openid-client';
99
import passport from 'passport';
1010
import { App } from './app';

shared/state.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export type SQLConnectorType =
180180
| 'postgres'
181181
| 'mysql'
182182
| 'sqlite'
183-
| 'oracle'
184-
| 'sqlserver'
183+
//| 'oracle'
184+
//| 'sqlserver'
185185
| 'presto'
186186
| 'clickhouse'
187187
| 'snowflake'
@@ -200,7 +200,7 @@ export type DatabaseConnectorInfoType =
200200
| SQLConnectorType
201201
| 'google-sheets'
202202
| 'airtable'
203-
| 'mongo'
203+
//| 'mongo'
204204
| 'elasticsearch'
205205
| 'splunk'
206206
| 'prometheus'

ui/Connector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { IconTrash } from '@tabler/icons';
22
import * as React from 'react';
33
import { ConnectorInfo, DatabaseConnectorInfo } from '../shared/state';
4+
import { DatabaseConnector } from './DatabaseConnector';
45
import { Button } from './components/Button';
56
import { Confirm } from './components/Confirm';
67
import { Input } from './components/Input';
7-
import { DatabaseConnector } from './DatabaseConnector';
88

99
export function Connector({
1010
connector,

ui/ConnectorList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
DatabaseConnectorInfoType,
66
ProjectState,
77
} from '../shared/state';
8+
import { Connector } from './Connector';
89
import { Button } from './components/Button';
910
import { Dropdown } from './components/Dropdown';
10-
import { Connector } from './Connector';
1111
import { VENDORS, VENDOR_GROUPS } from './connectors';
1212

1313
function NewConnector({

ui/Editor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as React from 'react';
22
import { MODE_FEATURES } from '../shared/constants';
33
import '../shared/polyfill';
4-
import { ErrorBoundary } from './components/ErrorBoundary';
54
import { ConnectorList } from './ConnectorList';
65
import { Footer } from './Footer';
76
import { PageList } from './PageList';
87
import { ServerList } from './ServerList';
98
import { Sidebar } from './Sidebar';
10-
import { ProjectContext } from './state';
119
import { Updates } from './Updates';
10+
import { ErrorBoundary } from './components/ErrorBoundary';
11+
import { ProjectContext } from './state';
1212
import { UrlStateContext } from './urlState';
1313

1414
export function Editor() {

ui/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import * as React from 'react';
22
import { APP_NAME, MODE } from '../shared/constants';
33
import '../shared/polyfill';
44
import { DEFAULT_PROJECT } from '../shared/state';
5-
import { Link } from './components/Link';
65
import { LocalStorageStore } from './ProjectStore';
6+
import { Link } from './components/Link';
77
import { UrlStateContext } from './urlState';
88

99
export function loadDefaultProject() {

ui/MakeSelectProject.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {
88
MakeProjectResponse,
99
} from '../shared/rpc';
1010
import { ProjectState } from '../shared/state';
11+
import { Footer } from './Footer';
1112
import { asyncRPC } from './asyncRPC';
1213
import { Alert } from './components/Alert';
1314
import { Button } from './components/Button';
1415
import { Input } from './components/Input';
1516
import { Loading } from './components/Loading';
1617
import { Select } from './components/Select';
17-
import { Footer } from './Footer';
1818
import { SAMPLES } from './samples';
1919

2020
export function MakeSelectProject() {

0 commit comments

Comments
 (0)