mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
refactor: adjust code to new configuration
This commit is contained in:
@@ -53,14 +53,35 @@ export interface RouteWithMetaInformation {
|
||||
* Instance of the route
|
||||
*/
|
||||
route: {
|
||||
/**
|
||||
* Error names of a route
|
||||
*/
|
||||
errorNames: Error[];
|
||||
/**
|
||||
* Method of the route
|
||||
*/
|
||||
method: string;
|
||||
/**
|
||||
* Obligatory parameters of the route
|
||||
*/
|
||||
obligatoryParameters: {
|
||||
[k: string]: string;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Name of the request body
|
||||
*/
|
||||
requestBodyName: string;
|
||||
/**
|
||||
* Name of the response body
|
||||
*/
|
||||
responseBodyName: string;
|
||||
/**
|
||||
* Status code on success
|
||||
*/
|
||||
statusCodeSuccess: number;
|
||||
/**
|
||||
* URL fragment
|
||||
*/
|
||||
urlFragment: string;
|
||||
};
|
||||
}
|
||||
@@ -93,13 +114,21 @@ export interface NodesWithMetaInformation {
|
||||
* A schema with definitions
|
||||
*/
|
||||
interface SchemaWithDefinitions extends JSONSchema {
|
||||
definitions: { [name: string]: Definition };
|
||||
/**
|
||||
* Definitions of the schema
|
||||
*/
|
||||
definitions: { [name: string]: Definition; };
|
||||
}
|
||||
|
||||
/**
|
||||
* An expectable error
|
||||
*/
|
||||
export type ExpectableValidationError = ValidationError & { expected: boolean };
|
||||
export interface ExpectableValidationError extends ValidationError {
|
||||
/**
|
||||
* Whether or not the error is expected
|
||||
*/
|
||||
expected: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A map of files and their expectable validation errors
|
||||
@@ -162,7 +191,9 @@ export function getTsconfigPath(startPath: string): string {
|
||||
let tsconfigPath = startPath;
|
||||
|
||||
// see https://stackoverflow.com/questions/9652043/identifying-the-file-system-root-with-node-js
|
||||
const root = (platform() === 'win32') ? process.cwd().split(sep)[0] : '/';
|
||||
const root = (platform() === 'win32') ? process
|
||||
.cwd()
|
||||
.split(sep)[0] : '/';
|
||||
|
||||
// repeat until a tsconfig.json is found
|
||||
while (!existsSync(join(tsconfigPath, 'tsconfig.json'))) {
|
||||
|
||||
Reference in New Issue
Block a user