From e6e1407a87b810d35840fd97648b43f57e8cd47a Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 23 May 2022 12:45:32 +0100 Subject: [PATCH] add nodemon --- Accounts/src/Pages/Register.tsx | 24 ++++-- Alert/nodemon.json | 5 ++ Alert/package.json | 2 +- Common/Models/BaseModel.ts | 12 ++- Common/Tests/Types/API/ErrorResponse.test.ts | 2 +- Common/Tests/Types/API/Response.test.ts | 2 +- Common/Types/API/ErrorResponse.ts | 3 - Common/Types/API/HTTPErrorResponse.ts | 5 ++ Common/Types/API/HTTPResponse.ts | 44 +++++++++++ Common/Types/API/Response.ts | 24 ------ Common/Utils/API.ts | 74 ++++++++++--------- .../src/Components/Basic/Button/Button.tsx | 3 +- CommonUI/src/Components/Forms/BasicForm.tsx | 2 + .../src/Components/Forms/BasicModelForm.tsx | 2 + .../Utils/API/{ApiDocs.ts => ApiDocsAPI.ts} | 0 .../{DashboardBackend.ts => DashboardAPI.ts} | 0 .../{Dashboard.ts => DashboardFrontendAPI.ts} | 0 .../src/Utils/API/{Helm.ts => HelmAPI.ts} | 0 .../Utils/API/{Identity.ts => IdentityAPI.ts} | 4 +- .../API/{Integration.ts => IntegrationAPI.ts} | 0 DashboardAPI/nodemon.json | 5 ++ DashboardAPI/package.json | 2 +- DataIngestor/nodemon.json | 5 ++ DataIngestor/package.json | 2 +- HelmChart/nodemon.json | 5 ++ HelmChart/package.json | 2 +- Home/package.json | 2 +- HttpTestServer/nodemon.json | 5 ++ HttpTestServer/package.json | 2 +- Identity/Index.ts | 3 + Identity/nodemon.json | 5 ++ Identity/package.json | 2 +- Integration/nodemon.json | 5 ++ Integration/package.json | 2 +- Licensing/nodemon.json | 5 ++ Licensing/package.json | 2 +- LighthouseRunner/nodemon.json | 5 ++ Mail/nodemon.json | 5 ++ Mail/package.json | 2 +- Probe/nodemon.json | 5 ++ ProbeAPI/nodemon.json | 5 ++ ProbeAPI/package.json | 2 +- Realtime/nodemon.json | 5 ++ Realtime/package.json | 2 +- ScriptRunner/nodemon.json | 5 ++ ScriptRunner/package.json | 2 +- Zapier/nodemon.json | 5 ++ 47 files changed, 219 insertions(+), 86 deletions(-) create mode 100644 Alert/nodemon.json delete mode 100644 Common/Types/API/ErrorResponse.ts create mode 100644 Common/Types/API/HTTPErrorResponse.ts create mode 100644 Common/Types/API/HTTPResponse.ts delete mode 100644 Common/Types/API/Response.ts rename CommonUI/src/Utils/API/{ApiDocs.ts => ApiDocsAPI.ts} (100%) rename CommonUI/src/Utils/API/{DashboardBackend.ts => DashboardAPI.ts} (100%) rename CommonUI/src/Utils/API/{Dashboard.ts => DashboardFrontendAPI.ts} (100%) rename CommonUI/src/Utils/API/{Helm.ts => HelmAPI.ts} (100%) rename CommonUI/src/Utils/API/{Identity.ts => IdentityAPI.ts} (72%) rename CommonUI/src/Utils/API/{Integration.ts => IntegrationAPI.ts} (100%) create mode 100644 DashboardAPI/nodemon.json create mode 100644 DataIngestor/nodemon.json create mode 100644 HelmChart/nodemon.json create mode 100644 HttpTestServer/nodemon.json create mode 100644 Identity/nodemon.json create mode 100644 Integration/nodemon.json create mode 100644 Licensing/nodemon.json create mode 100644 LighthouseRunner/nodemon.json create mode 100644 Mail/nodemon.json create mode 100644 Probe/nodemon.json create mode 100644 ProbeAPI/nodemon.json create mode 100644 Realtime/nodemon.json create mode 100644 ScriptRunner/nodemon.json create mode 100644 Zapier/nodemon.json diff --git a/Accounts/src/Pages/Register.tsx b/Accounts/src/Pages/Register.tsx index b7ea3007eb..c0857f7459 100644 --- a/Accounts/src/Pages/Register.tsx +++ b/Accounts/src/Pages/Register.tsx @@ -1,19 +1,35 @@ -import React, { FunctionComponent } from 'react'; +import React, { FunctionComponent, useState } from 'react'; import { Link } from 'react-router-dom'; import BasicModelForm from 'CommonUI/src/Components/Forms/BasicModelForm'; import User from 'Common/Models/User'; import FormValues from 'CommonUI/src/Components/Forms/Types/FormValues'; import Footer from '../Footer'; import Container from 'CommonUI/src/Container'; +import IdentityAPI from 'CommonUI/src/Utils/API/IdentityAPI'; +import Route from 'Common/Types/API/Route'; const RegisterPage: FunctionComponent = () => { + + const [isLaoding, setIsLoading] = useState(false); + const user: User = new User(); + const submitForm = async (values: FormValues) => { + setIsLoading(true); + + await IdentityAPI.post(new Route("/")) + + + setIsLoading(false); + } + + return ( model={user} - id="login-form" + isLoading={isLaoding} + id="register-form" showAsColumns={2} fields={[ { @@ -65,9 +81,7 @@ const RegisterPage: FunctionComponent = () => { required: true, }, ]} - onSubmit={(values: FormValues) => { - console.log(values); - }} + onSubmit={submitForm} submitButtonText={'Sign Up'} title={'Create your OneUptime account'} footer={ diff --git a/Alert/nodemon.json b/Alert/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Alert/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Alert/package.json b/Alert/package.json index f077017576..6f2641f7a1 100644 --- a/Alert/package.json +++ b/Alert/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true", "test": "jest" diff --git a/Common/Models/BaseModel.ts b/Common/Models/BaseModel.ts index 471636af2f..2b04e8d717 100644 --- a/Common/Models/BaseModel.ts +++ b/Common/Models/BaseModel.ts @@ -618,7 +618,17 @@ export default class BaseModel extends BaseEntity { return baseModel as T; } - public static fromJSON(json: JSONObject): T { + public static fromJSON(json: JSONObject | JSONArray): T | Array { + if (Array.isArray(json)) { + let arr: Array = []; + + for (const item of json) { + arr.push(this._fromJSON(item)) + } + + return arr; + } + return this._fromJSON(json); } diff --git a/Common/Tests/Types/API/ErrorResponse.test.ts b/Common/Tests/Types/API/ErrorResponse.test.ts index e9bf4fc6b5..f512cd013d 100644 --- a/Common/Tests/Types/API/ErrorResponse.test.ts +++ b/Common/Tests/Types/API/ErrorResponse.test.ts @@ -1,4 +1,4 @@ -import ErrorResponse from '../../../Types/API/ErrorResponse'; +import ErrorResponse from '../../../Types/API/HTTPErrorResponse'; describe('ErrorResponse', () => { test('should return a valid error response object', () => { const errorResponseObject: ErrorResponse = new ErrorResponse(500, { diff --git a/Common/Tests/Types/API/Response.test.ts b/Common/Tests/Types/API/Response.test.ts index f295ac7711..075345b1ee 100644 --- a/Common/Tests/Types/API/Response.test.ts +++ b/Common/Tests/Types/API/Response.test.ts @@ -1,4 +1,4 @@ -import Response from '../../../Types/API/Response'; +import Response from '../../../Types/API/HTTPResponse'; describe('Response()', () => { test('should return a valid response object', () => { let responseObject: Response; diff --git a/Common/Types/API/ErrorResponse.ts b/Common/Types/API/ErrorResponse.ts deleted file mode 100644 index f52774da62..0000000000 --- a/Common/Types/API/ErrorResponse.ts +++ /dev/null @@ -1,3 +0,0 @@ -import HTTPResponse from './Response'; - -export default class HTTPErrorResponse extends HTTPResponse {} diff --git a/Common/Types/API/HTTPErrorResponse.ts b/Common/Types/API/HTTPErrorResponse.ts new file mode 100644 index 0000000000..2d2ea7564f --- /dev/null +++ b/Common/Types/API/HTTPErrorResponse.ts @@ -0,0 +1,5 @@ +import BaseModel from '../../Models/BaseModel'; +import { JSONObjectOrArray } from '../JSON'; +import HTTPResponse from './HTTPResponse'; + +export default class HTTPErrorResponse> extends HTTPResponse {} diff --git a/Common/Types/API/HTTPResponse.ts b/Common/Types/API/HTTPResponse.ts new file mode 100644 index 0000000000..652b17a45d --- /dev/null +++ b/Common/Types/API/HTTPResponse.ts @@ -0,0 +1,44 @@ +import BaseModel from "../../Models/BaseModel"; +import { JSONObjectOrArray } from "../JSON"; + +export default class HTTPResponse> { + private _statusCode: number = -1; + public get statusCode(): number { + return this._statusCode; + } + public set statusCode(v: number) { + this._statusCode = v; + } + + private _jsonData!: JSONObjectOrArray; + public get jsonData(): JSONObjectOrArray { + return this._jsonData; + } + public set jsonData(v: JSONObjectOrArray) { + this._jsonData = v; + } + + + private _data! : T; + public get data() : T { + return this._data; + } + public set data(v : T) { + this._data = v; + } + + + public constructor(statusCode: number, data: JSONObjectOrArray) { + this.statusCode = statusCode; + this.jsonData = data; + + let obj!: T; + + if (obj instanceof BaseModel) { + this.data = BaseModel.fromJSON(data) as T; + } else { + this.data = data as T; + } + + } +} diff --git a/Common/Types/API/Response.ts b/Common/Types/API/Response.ts deleted file mode 100644 index 13b7aa83f9..0000000000 --- a/Common/Types/API/Response.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { JSONObjectOrArray } from '../JSON'; - -export default class HTTPResponse { - private _statusCode: number = -1; - public get statusCode(): number { - return this._statusCode; - } - public set statusCode(v: number) { - this._statusCode = v; - } - - private _data: JSONObjectOrArray = {}; - public get data(): JSONObjectOrArray { - return this._data; - } - public set data(v: JSONObjectOrArray) { - this._data = v; - } - - public constructor(statusCode: number, data: JSONObjectOrArray) { - this.statusCode = statusCode; - this.data = data; - } -} diff --git a/Common/Utils/API.ts b/Common/Utils/API.ts index a77287a6c1..2af5b5465b 100644 --- a/Common/Utils/API.ts +++ b/Common/Utils/API.ts @@ -2,15 +2,17 @@ import axios, { AxiosError } from 'axios'; import URL from '../Types/API/URL'; import { JSONObjectOrArray } from '../Types/JSON'; import Headers from '../Types/API/Headers'; -import HTTPResponse from '../Types/API/Response'; -import HTTPErrorResponse from '../Types/API/ErrorResponse'; +import HTTPResponse from '../Types/API/HTTPResponse'; +import HTTPErrorResponse from '../Types/API/HTTPErrorResponse'; import HTTPMethod from '../Types/API/HTTPMethod'; import APIException from '../Types/Exception/ApiException'; import Protocol from '../Types/API/Protocol'; import Hostname from '../Types/API/Hostname'; import Route from '../Types/API/Route'; +import BaseModel from '../Models/BaseModel'; export default class API { + private _protocol: Protocol = Protocol.HTTPS; public get protocol(): Protocol { return this._protocol; @@ -19,7 +21,7 @@ export default class API { this._protocol = v; } - private _hostname: Hostname = new Hostname('localhost'); + private _hostname!: Hostname; public get hostname(): Hostname { return this._hostname; } @@ -32,57 +34,57 @@ export default class API { this.hostname = hostname; } - public async get( + public async get>( path: Route, data?: JSONObjectOrArray, headers?: Headers - ): Promise { - return await API.get( + ): Promise> { + return await API.get( new URL(this.protocol, this.hostname, path), data, headers ); } - public async delete( + public async delete>( path: Route, data?: JSONObjectOrArray, headers?: Headers - ): Promise { - return await API.delete( + ): Promise> { + return await API.delete( new URL(this.protocol, this.hostname, path), data, headers ); } - public async put( + public async put>( path: Route, data?: JSONObjectOrArray, headers?: Headers - ): Promise { - return await API.put( + ): Promise> { + return await API.put( new URL(this.protocol, this.hostname, path), data, headers ); } - public async post( + public async post>( path: Route, data?: JSONObjectOrArray, headers?: Headers - ): Promise { - return await API.post( + ): Promise> { + return await API.post( new URL(this.protocol, this.hostname, path), data, headers ); } - protected static handleError( - error: HTTPErrorResponse | APIException - ): HTTPErrorResponse | APIException { + protected static handleError>( + error: HTTPErrorResponse | APIException + ): HTTPErrorResponse | APIException { return error; } @@ -109,47 +111,48 @@ export default class API { return defaultHeaders; } - public static async get( + public static async get>( url: URL, data?: JSONObjectOrArray, headers?: Headers - ): Promise { - return await this.fetch(HTTPMethod.GET, url, data, headers); + ): Promise> { + return await this.fetch(HTTPMethod.GET, url, data, headers); } - public static async delete( + public static async delete>( url: URL, data?: JSONObjectOrArray, headers?: Headers - ): Promise { + ): Promise> { return await this.fetch(HTTPMethod.DELETE, url, data, headers); } - public static async put( + public static async put>( url: URL, data?: JSONObjectOrArray, headers?: Headers - ): Promise { + ): Promise> { return await this.fetch(HTTPMethod.PUT, url, data, headers); } - public static async post( + public static async post>( url: URL, data?: JSONObjectOrArray, headers?: Headers - ): Promise { + ): Promise> { return await this.fetch(HTTPMethod.POST, url, data, headers); } - private static async fetch( + private static async fetch>( method: HTTPMethod, url: URL, data?: JSONObjectOrArray, headers?: Headers - ): Promise { + ): Promise> { const apiHeaders: Headers = this.getHeaders(headers); try { + const result: { data: JSONObjectOrArray; status: number; @@ -160,14 +163,15 @@ export default class API { data, }); - const response: HTTPResponse = new HTTPResponse( + const response: HTTPResponse = new HTTPResponse( result.status, result.data ); + return response; } catch (e) { const error: Error | AxiosError = e as Error | AxiosError; - let errorResponse: HTTPErrorResponse | APIException; + let errorResponse: HTTPErrorResponse | APIException; if (axios.isAxiosError(error)) { // Do whatever you want with native error errorResponse = this.getErrorResponse(error); @@ -175,16 +179,16 @@ export default class API { errorResponse = new APIException(error.message); } - this.handleError(errorResponse); + this.handleError(errorResponse); throw errorResponse; } } - private static getErrorResponse(error: AxiosError): HTTPErrorResponse { + private static getErrorResponse>(error: AxiosError): HTTPErrorResponse { if (error.response) { - return new HTTPErrorResponse( + return new HTTPErrorResponse( error.response.status, - error.response.data + error.response.data as JSONObjectOrArray ); } diff --git a/CommonUI/src/Components/Basic/Button/Button.tsx b/CommonUI/src/Components/Basic/Button/Button.tsx index b91c6b532c..caac623386 100644 --- a/CommonUI/src/Components/Basic/Button/Button.tsx +++ b/CommonUI/src/Components/Basic/Button/Button.tsx @@ -9,7 +9,8 @@ export interface ComponentProps { disabled?: boolean; id: string; shortcutKey?: ShortcutKey; - type?: ButtonType + type?: ButtonType; + isLoading?: boolean; } const Button: FunctionComponent = (props: ComponentProps): ReactElement => { diff --git a/CommonUI/src/Components/Forms/BasicForm.tsx b/CommonUI/src/Components/Forms/BasicForm.tsx index 4aeb989075..167e644106 100644 --- a/CommonUI/src/Components/Forms/BasicForm.tsx +++ b/CommonUI/src/Components/Forms/BasicForm.tsx @@ -22,6 +22,7 @@ export interface ComponentProps { description?: string; showAsColumns?: number; footer: ReactElement; + isLoading: boolean; } const BasicForm = ( @@ -132,6 +133,7 @@ const BasicForm = ( } type={ButtonTypes.Submit} id={`${props.id}-submit-button`} + isLoading={props.isLoading} /> {props.footer} diff --git a/CommonUI/src/Components/Forms/BasicModelForm.tsx b/CommonUI/src/Components/Forms/BasicModelForm.tsx index 5f637fa439..d8226ad23c 100644 --- a/CommonUI/src/Components/Forms/BasicModelForm.tsx +++ b/CommonUI/src/Components/Forms/BasicModelForm.tsx @@ -16,6 +16,7 @@ export interface ComponentProps { description?: string; showAsColumns?: number; footer: ReactElement; + isLoading: boolean; } const BasicModelForm = ( @@ -53,6 +54,7 @@ const BasicModelForm = ( return ( + isLoading={props.isLoading} fields={fields} id={props.id} onSubmit={props.onSubmit} diff --git a/CommonUI/src/Utils/API/ApiDocs.ts b/CommonUI/src/Utils/API/ApiDocsAPI.ts similarity index 100% rename from CommonUI/src/Utils/API/ApiDocs.ts rename to CommonUI/src/Utils/API/ApiDocsAPI.ts diff --git a/CommonUI/src/Utils/API/DashboardBackend.ts b/CommonUI/src/Utils/API/DashboardAPI.ts similarity index 100% rename from CommonUI/src/Utils/API/DashboardBackend.ts rename to CommonUI/src/Utils/API/DashboardAPI.ts diff --git a/CommonUI/src/Utils/API/Dashboard.ts b/CommonUI/src/Utils/API/DashboardFrontendAPI.ts similarity index 100% rename from CommonUI/src/Utils/API/Dashboard.ts rename to CommonUI/src/Utils/API/DashboardFrontendAPI.ts diff --git a/CommonUI/src/Utils/API/Helm.ts b/CommonUI/src/Utils/API/HelmAPI.ts similarity index 100% rename from CommonUI/src/Utils/API/Helm.ts rename to CommonUI/src/Utils/API/HelmAPI.ts diff --git a/CommonUI/src/Utils/API/Identity.ts b/CommonUI/src/Utils/API/IdentityAPI.ts similarity index 72% rename from CommonUI/src/Utils/API/Identity.ts rename to CommonUI/src/Utils/API/IdentityAPI.ts index ed8ab8805b..6383371c2b 100755 --- a/CommonUI/src/Utils/API/Identity.ts +++ b/CommonUI/src/Utils/API/IdentityAPI.ts @@ -1,10 +1,10 @@ import { IDENTITY_HOSTNAME, API_PROTOCOL } from '../../Config'; import BaseAPI from './BaseAPI'; -class BackendAPI extends BaseAPI { +class IdentityAPI extends BaseAPI { public constructor() { super(API_PROTOCOL, IDENTITY_HOSTNAME); } } -export default new BackendAPI(); +export default new IdentityAPI(); diff --git a/CommonUI/src/Utils/API/Integration.ts b/CommonUI/src/Utils/API/IntegrationAPI.ts similarity index 100% rename from CommonUI/src/Utils/API/Integration.ts rename to CommonUI/src/Utils/API/IntegrationAPI.ts diff --git a/DashboardAPI/nodemon.json b/DashboardAPI/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/DashboardAPI/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/DashboardAPI/package.json b/DashboardAPI/package.json index 0270330349..d5ac67587d 100644 --- a/DashboardAPI/package.json +++ b/DashboardAPI/package.json @@ -74,7 +74,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "nyc --reporter=lcov --reporter=text mocha --exit test/index.ts", "enterprise-test": "IS_TESTING=true nyc --reporter=lcov --reporter=text mocha --exit test/enterprise.js", "audit": "npm audit --audit-level=low", diff --git a/DataIngestor/nodemon.json b/DataIngestor/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/DataIngestor/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/DataIngestor/package.json b/DataIngestor/package.json index 4a4bfd817c..aa6a42984b 100644 --- a/DataIngestor/package.json +++ b/DataIngestor/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true" }, diff --git a/HelmChart/nodemon.json b/HelmChart/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/HelmChart/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/HelmChart/package.json b/HelmChart/package.json index 97c6a6f886..9b4a19e331 100644 --- a/HelmChart/package.json +++ b/HelmChart/package.json @@ -7,7 +7,7 @@ "preinstall": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'", "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "mocha --exit test/index.ts", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true --ignores='ejs'" diff --git a/Home/package.json b/Home/package.json index db255db2c0..4e01a8c5c1 100755 --- a/Home/package.json +++ b/Home/package.json @@ -5,7 +5,7 @@ "preinstall": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'", "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "jest", "lighthouse-test": "jest --forceExit lighthouse-tests/test/index.test.js --env=node", "lighthouse": "start-server-and-test http://localhost:1444", diff --git a/HttpTestServer/nodemon.json b/HttpTestServer/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/HttpTestServer/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/HttpTestServer/package.json b/HttpTestServer/package.json index f7cd07547a..9950813247 100644 --- a/HttpTestServer/package.json +++ b/HttpTestServer/package.json @@ -7,7 +7,7 @@ "preinstall": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'", "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "test": "jest --forceExit --runInBand test", "dep-check": "depcheck ./ --skip-missing=true --ignores='ejs'" diff --git a/Identity/Index.ts b/Identity/Index.ts index f951213f8c..882dcf9035 100644 --- a/Identity/Index.ts +++ b/Identity/Index.ts @@ -1,3 +1,6 @@ import app from 'CommonServer/Utils/StartServer'; +import AuthenticationAPI from './API/AuthenticationAPI'; + +app.use('/v2', AuthenticationAPI); export default app; diff --git a/Identity/nodemon.json b/Identity/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Identity/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Identity/package.json b/Identity/package.json index c03d4ecf5a..e1cdd8fa67 100644 --- a/Identity/package.json +++ b/Identity/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true", "test": "jest" diff --git a/Integration/nodemon.json b/Integration/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Integration/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Integration/package.json b/Integration/package.json index 2b2faff9da..9c404fa833 100644 --- a/Integration/package.json +++ b/Integration/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true", "test": "jest" diff --git a/Licensing/nodemon.json b/Licensing/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Licensing/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Licensing/package.json b/Licensing/package.json index 71763ae078..9d18cc14d1 100644 --- a/Licensing/package.json +++ b/Licensing/package.json @@ -24,7 +24,7 @@ "preinstall": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'", "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "mocha --exit test/index.ts", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true --ignores='ejs'" diff --git a/LighthouseRunner/nodemon.json b/LighthouseRunner/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/LighthouseRunner/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Mail/nodemon.json b/Mail/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Mail/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Mail/package.json b/Mail/package.json index d103746381..3b4d52a645 100644 --- a/Mail/package.json +++ b/Mail/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "echo 'no tests'" }, "author": "", diff --git a/Probe/nodemon.json b/Probe/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Probe/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/ProbeAPI/nodemon.json b/ProbeAPI/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/ProbeAPI/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/ProbeAPI/package.json b/ProbeAPI/package.json index b3537fd92f..964d0cafe6 100644 --- a/ProbeAPI/package.json +++ b/ProbeAPI/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true", "test": "jest" diff --git a/Realtime/nodemon.json b/Realtime/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Realtime/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/Realtime/package.json b/Realtime/package.json index b657fd4431..40c4153eac 100644 --- a/Realtime/package.json +++ b/Realtime/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "audit": "npm audit --audit-level=low", "dep-check": "depcheck ./ --skip-missing=true" }, diff --git a/ScriptRunner/nodemon.json b/ScriptRunner/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/ScriptRunner/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file diff --git a/ScriptRunner/package.json b/ScriptRunner/package.json index 08931420b7..ffc433762c 100644 --- a/ScriptRunner/package.json +++ b/ScriptRunner/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node Index.ts", "compile": "tsc", - "dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts'", + "dev": "nodemon", "test": "echo \"Error: no test specified\" && exit 1", "audit": "npm audit --audit-level=low" }, diff --git a/Zapier/nodemon.json b/Zapier/nodemon.json new file mode 100644 index 0000000000..d724c977d1 --- /dev/null +++ b/Zapier/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": [".","../Common", "../CommonServer"], + "ext": "ts,json,tsx,env", + "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" +} \ No newline at end of file