@@ -200894,15 +200894,16 @@ Draw.loadPlugin(function (ui) {
200894
200894
if (type == "ts") {
200895
200895
const { data: doc } = (0, core_types_json_schema_1.convertOpenApiToCoreTypes)(openapi);
200896
200896
const { data: sourceCode } = (0, core_types_ts_1.convertCoreTypesToTypeScript)(doc);
200897
- result = `/*\n\tGenerated in drawio\n\tDatabase: ${type}\n\tPlugin: nosql\n\tVersion: ${constants_1.pluginVersion}\n*/\n\n` + result;
200897
+ result =
200898
+ `/*\n\tGenerated in drawio\n\tDatabase: ${type}\n\tPlugin: nosql\n\tVersion: ${constants_1.pluginVersion}\n*/\n\n` +
200899
+ result;
200898
200900
result += sourceCode;
200899
200901
}
200900
200902
else if (type == "openapi") {
200901
200903
result = JSON.stringify(openapi, null, 2);
200902
200904
}
200903
200905
sqlInputGenSQL.value = result;
200904
200906
}
200905
- ;
200906
200907
mxUtils.br(divGenSQL);
200907
200908
const resetBtnGenSQL = mxUtils.button(mxResources.get("reset"), function () {
200908
200909
sqlInputGenSQL.value = sqlExportDefault;
@@ -200971,7 +200972,7 @@ Draw.loadPlugin(function (ui) {
200971
200972
let openApi = null;
200972
200973
const openApiOptions = {
200973
200974
title: "nosql default options",
200974
- version: constants_1.pluginVersion
200975
+ version: constants_1.pluginVersion,
200975
200976
};
200976
200977
if (type == "openapi") {
200977
200978
// should already be a json, but going to serialize to openapi for validation
@@ -201009,7 +201010,6 @@ Draw.loadPlugin(function (ui) {
201009
201010
console.log(error);
201010
201011
}
201011
201012
}
201012
- ;
201013
201013
mxUtils.br(divFromNOSQL);
201014
201014
const resetBtnFromNOSQL = mxUtils.button(mxResources.get("Reset TS"), function () {
201015
201015
sqlInputFromNOSQL.value = constants_nosql_1.defaultReset;
@@ -201178,7 +201178,7 @@ const JSONSchemaTypes = [
201178
201178
"object",
201179
201179
"array",
201180
201180
"null",
201181
- "any"
201181
+ "any",
201182
201182
];
201183
201183
exports.validJSONSchemaTypes = JSONSchemaTypes;
201184
201184
@@ -201357,32 +201357,35 @@ function dbToOpenApi(db) {
201357
201357
//
201358
201358
}
201359
201359
else {
201360
- // else {
201361
201360
removeType = true;
201362
201361
$ref = `#/components/schemas/${(0, sharedUtils_1.RemoveNameQuantifiers)(type)}`;
201363
201362
}
201364
201363
}
201365
201364
if (["array", "object"].indexOf(type) !== -1) {
201366
- const relationships = db.getRelationships().filter(x => x.entityA == key);
201365
+ const relationships = db
201366
+ .getRelationships()
201367
+ .filter((x) => x.entityA == key);
201367
201368
const roleLookup = `[${key}.${propName}]`;
201368
201369
// FIND MATCH
201369
- const rel = relationships.find(x => x.roleA.indexOf(roleLookup) != -1);
201370
+ const rel = relationships.find((x) => x.roleA.indexOf(roleLookup) != -1);
201370
201371
if (rel) {
201371
201372
const commentFKIndexes = (0, sharedUtils_1.getCommentIndexes)(rel.entityB);
201372
- const entityBName = rel.entityB.substring(0, commentFKIndexes.beforeStart).trim();
201373
+ const entityBName = rel.entityB
201374
+ .substring(0, commentFKIndexes.beforeStart)
201375
+ .trim();
201373
201376
$ref = `#/components/schemas/${entityBName}`;
201374
201377
}
201375
201378
if ($ref) {
201376
201379
// if array additionalProperties.$ref
201377
201380
if (type == "array") {
201378
201381
items = {
201379
- $ref: $ref
201382
+ $ref: $ref,
201380
201383
};
201381
201384
}
201382
201385
// if object items.$ref
201383
201386
if (type == "object") {
201384
201387
additionalProperties = {
201385
- $ref: $ref
201388
+ $ref: $ref,
201386
201389
};
201387
201390
}
201388
201391
}
@@ -201443,9 +201446,7 @@ function GeneratePropertyModel(tableName, propertyName, property) {
201443
201446
if (property.items && typeof property.items === constants_1.objectKeyword) {
201444
201447
if (property.items.format && !property.format) {
201445
201448
property.format = property.items.format;
201446
- // columnProperties = `${(property.items as JSONSchema4).format}[]`;
201447
201449
}
201448
- // else
201449
201450
if (property.items.type)
201450
201451
columnProperties = `${property.items.type}[]`;
201451
201452
}
@@ -201549,10 +201550,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
201549
201550
property.type = refName;
201550
201551
}
201551
201552
const propertyModel = GeneratePropertyModel(tableModel.Name, propertyKey, property);
201552
- // if (
201553
- // propertyModel.ColumnProperties.includes(objectKeyword) ||
201554
- // propertyModel.ColumnProperties.includes(arrayKeyword)
201555
- // ) {
201556
201553
if (refName) {
201557
201554
const primaryKeyModel = {
201558
201555
PrimaryKeyTableName: tableModel.Name,
@@ -201574,7 +201571,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
201574
201571
models.ForeignKeyList.push(primaryKeyModel);
201575
201572
propertyModel.IsForeignKey = true;
201576
201573
}
201577
- // }
201578
201574
tableModel.Properties.push(propertyModel);
201579
201575
}
201580
201576
}
0 commit comments