fix lint.

This commit is contained in:
Simon Larsen 2022-05-31 14:57:15 +01:00
parent 52294f0094
commit 354def3883
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
23 changed files with 62 additions and 34 deletions

View File

@ -4,10 +4,11 @@ import {
ExpressStatic,
} from 'CommonServer/utils/Express';
import path from 'path';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'admin';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.use(ExpressStatic(path.join(__dirname, 'build')));
app.use(`/${APP_NAME}`, ExpressStatic(path.join(__dirname, 'build')));

View File

@ -1,3 +1,5 @@
import app from 'CommonServer/Utils/StartServer';
import Express, { ExpressApplication } from 'CommonServer/Utils/Express';
const app: ExpressApplication = Express.getExpressApp();
export default app;

View File

@ -1,13 +1,14 @@
import {
import Express, {
ExpressApplication,
ExpressRequest,
ExpressResponse,
ExpressStatic,
} from 'CommonServer/Utils/Express';
import app from 'CommonServer/Utils/StartServer';
import path from 'path';
const app: ExpressApplication = Express.getExpressApp();
// Set the view engine to ejs
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

View File

@ -1,7 +1,8 @@
import App from 'CommonServer/utils/StartServer';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'application';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
import Main from './worker/main';

View File

@ -405,7 +405,7 @@ export default class BaseModel extends BaseEntity {
public getPublicCreateableColumns<T extends BaseModel>(type: {
new (): T;
}): Columns {
const obj = new type();
const obj: T = new type();
const accessControl: Dictionary<AccessControl> =
getPublicAccessControlForAllColumns(obj);
const columns: Array<string> = [];

View File

@ -39,13 +39,13 @@ export default class Hostname {
}
public toString(): string {
let hostame = this.hostname;
let hostame: string = this.hostname;
if (this.port) {
hostame += ':' + this.port.toString();
}
return this.hostname;
return hostame;
}
public static fromString(hostname: string): Hostname {

View File

@ -29,9 +29,17 @@ export default class URL extends DatabaseProperty {
this._protocol = v;
}
public constructor(protocol: Protocol, hostname: Hostname, route?: Route) {
public constructor(
protocol: Protocol,
hostname: Hostname | string,
route?: Route
) {
super();
this.hostname = hostname;
if (hostname instanceof Hostname) {
this.hostname = hostname;
} else if (typeof hostname === 'string') {
this.hostname = Hostname.fromString(hostname);
}
this.protocol = protocol;

View File

@ -4,7 +4,9 @@ import Express, { ExpressApplication } from '../Utils/Express';
const app: ExpressApplication = Express.getExpressApp();
export default (appName: string) => {
const init: Function = (appName: string): void => {
app.use([`/${appName}`, '/'], version);
app.use([`/${appName}`, '/'], status);
};
export default init;

View File

@ -1,8 +1,8 @@
import { createLogger, format, transports } from 'winston';
import { createLogger, format, Logger, transports } from 'winston';
const { combine, timestamp, errors, colorize, cli } = format;
const logger = createLogger({
const logger: Logger = createLogger({
format: combine(
colorize(),
cli({

View File

@ -1,11 +1,12 @@
import App from 'CommonServer/utils/StartServer';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import Main from './worker/main';
import cron from 'node-cron';
export const APP_NAME: string = 'container';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
const cronContainerSecurityStartTime: $TSFixMe = Math.floor(Math.random() * 50);

View File

@ -4,10 +4,11 @@ import {
ExpressRequest,
ExpressResponse,
ExpressStatic,
ExpressApplication,
} from 'CommonServer/Utils/Express';
export const APP_NAME: string = 'dashboard';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.use(ExpressStatic(path.join(__dirname, 'build')));

View File

@ -3,12 +3,13 @@ import {
ExpressResponse,
NextFunction,
ExpressStatic,
ExpressApplication,
} from 'CommonServer/Utils/Express';
import logger from 'CommonServer/Utils/Logger';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'api';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
import expressRequestId from 'express-request-id';

View File

@ -1,7 +1,8 @@
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'data-ingestor';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.use([`/${APP_NAME}/probe`, '/probe'], require('./api/probe'));

View File

@ -1,9 +1,9 @@
import { ExpressStatic } from 'CommonServer/Utils/Express';
import { ExpressStatic. ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import path from 'path';
export const APP_NAME: string = 'chart';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
// Set the view engine to ejs
app.set('views', path.join(__dirname, 'views'));

View File

@ -2,6 +2,7 @@ import {
ExpressRequest,
ExpressResponse,
ExpressStatic,
ExpressApplication,
} from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import Dictionary from 'Common/Types/Dictionary';
@ -14,7 +15,7 @@ import builder from 'xmlbuilder2';
import { XMLBuilder } from 'xmlbuilder2/lib/interfaces';
export const APP_NAME: string = 'home';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
//View engine setup
app.set('views', path.join(__dirname, 'views'));

View File

@ -4,7 +4,8 @@ import {
ExpressStatic,
} from 'CommonServer/utils/Express';
import App from 'CommonServer/utils/StartServer';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import path from 'path';
@ -13,7 +14,7 @@ import ResponseType from 'Common/Types/api/ResponseType';
import Headers from 'Common/Types/API/Headers';
export const APP_NAME: string = 'home';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

View File

@ -1,7 +1,8 @@
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'integration';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
export default app;

View File

@ -2,12 +2,13 @@ import {
ExpressRequest,
ExpressResponse,
ExpressStatic,
ExpressApplication,
} from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'licensing';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
import path from 'path';

View File

@ -1,4 +1,5 @@
import App from 'CommonServer/utils/StartServer';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import http from 'http';
http.createServer(app);
@ -8,7 +9,7 @@ import Main from './workers/main';
import cron from 'node-cron';
export const APP_NAME: string = 'licensing';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
const cronMinuteStartTime: $TSFixMe = Math.floor(Math.random() * 50);
//App Version

View File

@ -1,7 +1,8 @@
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'mail';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
// API

View File

@ -1,7 +1,8 @@
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'data-ingestor';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
// API
import ProbeAPI from './API/Probe';

View File

@ -1,7 +1,8 @@
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
export const APP_NAME: string = 'realtime';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.use('/realtime', require('./api/realtime'));

View File

@ -1,10 +1,11 @@
import App from 'CommonServer/utils/StartServer';
import { ExpressApplication } from 'CommonServer/Utils/Express';
import App from 'CommonServer/Utils/StartServer';
import cron from 'node-cron';
import main from './workers/main';
import ScriptAPI from './api/script';
export const APP_NAME: string = 'script';
const app = App(APP_NAME);
const app: ExpressApplication = App(APP_NAME);
app.use(`/${APP_NAME}`, ScriptAPI);