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() {

ui/Navigation.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TablerIcon } from '@tabler/icons';
1+
import { Icon as TablerIcon } from '@tabler/icons';
22
import React from 'react';
33
import { Button } from './components/Button';
44
import { DefaultView, UrlStateContext } from './urlState';
@@ -18,9 +18,8 @@ export function Navigation<View extends string = DefaultView>({
1818
{pages.map((page) => (
1919
<div
2020
key={page.title}
21-
className={`navigation-item ${
22-
view === page.endpoint ? 'navigation-item--active' : ''
23-
}`}
21+
className={`navigation-item ${view === page.endpoint ? 'navigation-item--active' : ''
22+
}`}
2423
title={page.title}
2524
>
2625
<Button

ui/PageList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {
99
ProjectState,
1010
TablePanelInfo,
1111
} from '../shared/state';
12-
import { Button } from './components/Button';
13-
import { Confirm } from './components/Confirm';
14-
import { Input } from './components/Input';
1512
import { loadDefaultProject } from './Header';
1613
import { VISUAL_PANELS } from './Panel';
1714
import { PanelList } from './PanelList';
18-
import { PANEL_UI_DETAILS } from './panels';
1915
import { LocalStorageStore } from './ProjectStore';
16+
import { Button } from './components/Button';
17+
import { Confirm } from './components/Confirm';
18+
import { Input } from './components/Input';
19+
import { PANEL_UI_DETAILS } from './panels';
2020

2121
export function makeReevalPanel(
2222
state: ProjectState,

ui/Panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import { EVAL_ERRORS } from '../shared/errors';
2424
import log from '../shared/log';
2525
import { PanelInfo, PanelResult, ProgramPanelInfo } from '../shared/state';
2626
import { humanSize } from '../shared/text';
27+
import { DownloadPanel } from './DownloadPanel';
2728
import { panelRPC } from './asyncRPC';
2829
import { Alert } from './components/Alert';
2930
import { Button } from './components/Button';
3031
import { Confirm } from './components/Confirm';
3132
import { ErrorBoundary } from './components/ErrorBoundary';
3233
import { Highlight } from './components/Highlight';
3334
import { Input } from './components/Input';
34-
import { DownloadPanel } from './DownloadPanel';
3535
import { PANEL_UI_DETAILS } from './panels';
3636
import { ProjectContext } from './state';
3737
import { UrlStateContext } from './urlState';

ui/PanelList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
ProjectPage,
99
TablePanelInfo,
1010
} from '../shared/state';
11+
import { Panel, VISUAL_PANELS } from './Panel';
1112
import { Button } from './components/Button';
1213
import { Dropdown } from './components/Dropdown';
1314
import { ErrorBoundary } from './components/ErrorBoundary';
@@ -16,7 +17,6 @@ import {
1617
orderedObjectFields,
1718
wellFormedGraphInput,
1819
} from './components/FieldPicker';
19-
import { Panel, VISUAL_PANELS } from './Panel';
2020
import { PANEL_GROUPS, PANEL_UI_DETAILS } from './panels';
2121
import { ProjectContext } from './state';
2222
import { UrlStateContext } from './urlState';

ui/ServerList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { ProjectState, ServerInfo } from '../shared/state';
3-
import { Button } from './components/Button';
43
import { Server } from './Server';
4+
import { Button } from './components/Button';
55

66
export function ServerList({
77
state,

ui/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import {
1010
UpdateSettingsResponse,
1111
} from '../shared/rpc';
1212
import { Settings as SettingsT } from '../shared/settings';
13+
import { Footer } from './Footer';
1314
import { asyncRPC } from './asyncRPC';
1415
import { Alert } from './components/Alert';
1516
import { Button } from './components/Button';
1617
import { FileInput } from './components/FileInput';
1718
import { FormGroup } from './components/FormGroup';
1819
import { Input } from './components/Input';
1920
import { Toggle } from './components/Toggle';
20-
import { Footer } from './Footer';
2121

2222
export const SettingsContext = React.createContext<{
2323
state: SettingsT;

ui/app.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import {
66
IconHelp,
77
IconLayoutDashboard,
88
IconSettings,
9-
TablerIcon,
9+
Icon as TablerIcon,
1010
} from '@tabler/icons';
1111
import * as React from 'react';
1212
import { MODE, MODE_FEATURES } from '../shared/constants';
1313
import { LANGUAGES } from '../shared/languages';
1414
import '../shared/polyfill';
1515
import { Settings as SettingsT } from '../shared/settings';
16-
import { Button } from './components/Button';
17-
import { ErrorBoundary } from './components/ErrorBoundary';
18-
import { Loading } from './components/Loading';
1916
import { Editor } from './Editor';
2017
import { Footer } from './Footer';
2118
import { Header, loadDefaultProject } from './Header';
@@ -24,6 +21,9 @@ import { MakeSelectProject } from './MakeSelectProject';
2421
import { Navigation } from './Navigation';
2522
import { NotFound } from './NotFound';
2623
import { Settings, SettingsContext, useSettings } from './Settings';
24+
import { Button } from './components/Button';
25+
import { ErrorBoundary } from './components/ErrorBoundary';
26+
import { Loading } from './components/Loading';
2727
import { useShortcuts } from './shortcuts';
2828
import { ProjectContext, useProjectState } from './state';
2929
import { DefaultView, UrlStateContext, useUrlState } from './urlState';
@@ -32,7 +32,7 @@ if (MODE === 'browser') {
3232
Object.values(LANGUAGES).map(function processLanguageInit(l) {
3333
if (l.inMemoryInit) {
3434
// These can be really big, so run it out of band
35-
setTimeout(function () {
35+
setTimeout(function() {
3636
l.inMemoryInit();
3737
});
3838
}
@@ -84,11 +84,11 @@ export function defaultRoutes(): Routes {
8484
},
8585
MODE === 'server'
8686
? {
87-
endpoint: 'projects',
88-
view: MakeSelectProject,
89-
title: 'Switch project',
90-
icon: IconFiles,
91-
}
87+
endpoint: 'projects',
88+
view: MakeSelectProject,
89+
title: 'Switch project',
90+
icon: IconFiles,
91+
}
9292
: null,
9393
{
9494
endpoint: 'settings',

ui/connectors/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ export const VENDOR_GROUPS: Array<{
167167
vendors: [
168168
'postgres',
169169
'mysql',
170-
'sqlserver',
171-
'oracle',
170+
//'sqlserver',
171+
//'oracle',
172172
'sqlite',
173173
'cockroach',
174174
'odbc',
@@ -184,7 +184,7 @@ export const VENDOR_GROUPS: Array<{
184184
},
185185
{
186186
group: 'Document',
187-
vendors: ['elasticsearch', 'crate', 'mongo'],
187+
vendors: ['elasticsearch', 'crate' /* , 'mongo' */],
188188
},
189189
{
190190
group: 'Time Series',

ui/panels/GraphPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ import {
1010
PanelResult,
1111
TableColumn,
1212
} from '../../shared/state';
13+
import { SettingsContext } from '../Settings';
1314
import { Button } from '../components/Button';
1415
import {
15-
allFields,
1616
FieldPicker,
17+
allFields,
1718
unusedFields,
1819
} from '../components/FieldPicker';
1920
import { FormGroup } from '../components/FormGroup';
2021
import { PanelSourcePicker } from '../components/PanelSourcePicker';
2122
import { Radio } from '../components/Radio';
2223
import { NONE, Select } from '../components/Select';
23-
import { SettingsContext } from '../Settings';
2424
import { evalColumnPanel } from './TablePanel';
2525
import { PanelBodyProps, PanelDetailsProps, PanelUIDetails } from './types';
2626

0 commit comments

Comments
 (0)