mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
refactor: update dependencies and fix resulting errors
Upgraded JSON Schema from version 6 to version 7 Upgraded TypeDoc version to latest Replaced 'jsonschema' with 'json-schema' package to better comply with 'ts-json-schema-generator' Replace JSON Schema validation with AJV in areas where it wasn't used previously Removed commander help output as it causes strange issues
This commit is contained in:
committed by
Rainer Killinger
parent
b7cdb6a9ad
commit
5330255b7e
@@ -87,7 +87,7 @@ export async function createDiagram(
|
||||
/**
|
||||
* This will encode the plantuml code and post the code to the plantuml server
|
||||
* The server will then parse the code and create a corresponding diagram
|
||||
*
|
||||
*
|
||||
* @param modelPlantUMLCode raw PlantUML code
|
||||
* @param plantUmlBaseURL PlantUML server address that shall be used
|
||||
* @param outputFile filename of the output file without file extension
|
||||
@@ -102,7 +102,7 @@ export async function createDiagramFromString(
|
||||
const url = `${plantUmlBaseURL}/svg/${plantUMLCode}`;
|
||||
let response;
|
||||
try {
|
||||
response = await request.get(url);
|
||||
response = await request.default.get(url);
|
||||
const httpOK = 200;
|
||||
if (response.statusCode !== httpOK) {
|
||||
await Logger.error(`Plantuml Server responded with an error.\n${response.statusMessage}`);
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {
|
||||
ArrayType,
|
||||
ConditionalType,
|
||||
DeclarationReflection,
|
||||
IntrinsicType,
|
||||
ProjectReflection,
|
||||
QueryType,
|
||||
ReferenceType,
|
||||
ReflectionKind,
|
||||
ReflectionType,
|
||||
@@ -248,10 +250,43 @@ function readTypeInformation(declarationType: Type): LightweightType {
|
||||
if (declarationType instanceof UnionType) {
|
||||
return readAsUnionType(declarationType);
|
||||
}
|
||||
if (declarationType instanceof QueryType) {
|
||||
return readAsQueryType(declarationType);
|
||||
}
|
||||
if (declarationType instanceof ConditionalType) {
|
||||
return readAsConditionalType(declarationType);
|
||||
}
|
||||
|
||||
throw new Error(`Could not read type ${declarationType.type}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion method for ConditionalTypes
|
||||
*
|
||||
* @param _type Type to be converted
|
||||
*/
|
||||
function readAsConditionalType(_type: ConditionalType): LightweightType {
|
||||
const returnType: LightweightType = new LightweightType();
|
||||
|
||||
returnType.specificationTypes = [];
|
||||
returnType.name = getFullTypeName(returnType);
|
||||
returnType.isUnion = true;
|
||||
|
||||
return returnType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion method for QueryTypes
|
||||
*
|
||||
* @param type Type to be converted
|
||||
*/
|
||||
function readAsQueryType(type: QueryType): LightweightType {
|
||||
const out = readAsReferenceType(type.queryType);
|
||||
out.isReference = true;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion method for IntrinsicType's
|
||||
*
|
||||
@@ -315,10 +350,8 @@ function readAsReferenceType(type: ReferenceType): LightweightType {
|
||||
// interfaces and classes in a type are a sink, since their declaration are defined elsewhere
|
||||
if (
|
||||
typeof tempTypeReflection.kindString !== 'undefined' &&
|
||||
['Interface', 'Class', 'Enumeration', 'Type alias'].indexOf(
|
||||
tempTypeReflection.kindString,
|
||||
) > -1
|
||||
) {
|
||||
['Interface', 'Class', 'Enumeration', 'Type alias'].includes(
|
||||
tempTypeReflection.kindString)) {
|
||||
returnType.isReference = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user