Skip to content

Commit 201aae1

Browse files
committed
build from formated
1 parent e4ddfcc commit 201aae1

File tree

3 files changed

+29
-43
lines changed

3 files changed

+29
-43
lines changed

dist/nosql-ts.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200894,15 +200894,16 @@ Draw.loadPlugin(function (ui) {
200894200894
if (type == "ts") {
200895200895
const { data: doc } = (0, core_types_json_schema_1.convertOpenApiToCoreTypes)(openapi);
200896200896
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;
200898200900
result += sourceCode;
200899200901
}
200900200902
else if (type == "openapi") {
200901200903
result = JSON.stringify(openapi, null, 2);
200902200904
}
200903200905
sqlInputGenSQL.value = result;
200904200906
}
200905-
;
200906200907
mxUtils.br(divGenSQL);
200907200908
const resetBtnGenSQL = mxUtils.button(mxResources.get("reset"), function () {
200908200909
sqlInputGenSQL.value = sqlExportDefault;
@@ -200971,7 +200972,7 @@ Draw.loadPlugin(function (ui) {
200971200972
let openApi = null;
200972200973
const openApiOptions = {
200973200974
title: "nosql default options",
200974-
version: constants_1.pluginVersion
200975+
version: constants_1.pluginVersion,
200975200976
};
200976200977
if (type == "openapi") {
200977200978
// should already be a json, but going to serialize to openapi for validation
@@ -201009,7 +201010,6 @@ Draw.loadPlugin(function (ui) {
201009201010
console.log(error);
201010201011
}
201011201012
}
201012-
;
201013201013
mxUtils.br(divFromNOSQL);
201014201014
const resetBtnFromNOSQL = mxUtils.button(mxResources.get("Reset TS"), function () {
201015201015
sqlInputFromNOSQL.value = constants_nosql_1.defaultReset;
@@ -201178,7 +201178,7 @@ const JSONSchemaTypes = [
201178201178
"object",
201179201179
"array",
201180201180
"null",
201181-
"any"
201181+
"any",
201182201182
];
201183201183
exports.validJSONSchemaTypes = JSONSchemaTypes;
201184201184

@@ -201357,32 +201357,35 @@ function dbToOpenApi(db) {
201357201357
//
201358201358
}
201359201359
else {
201360-
// else {
201361201360
removeType = true;
201362201361
$ref = `#/components/schemas/${(0, sharedUtils_1.RemoveNameQuantifiers)(type)}`;
201363201362
}
201364201363
}
201365201364
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);
201367201368
const roleLookup = `[${key}.${propName}]`;
201368201369
// FIND MATCH
201369-
const rel = relationships.find(x => x.roleA.indexOf(roleLookup) != -1);
201370+
const rel = relationships.find((x) => x.roleA.indexOf(roleLookup) != -1);
201370201371
if (rel) {
201371201372
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();
201373201376
$ref = `#/components/schemas/${entityBName}`;
201374201377
}
201375201378
if ($ref) {
201376201379
// if array additionalProperties.$ref
201377201380
if (type == "array") {
201378201381
items = {
201379-
$ref: $ref
201382+
$ref: $ref,
201380201383
};
201381201384
}
201382201385
// if object items.$ref
201383201386
if (type == "object") {
201384201387
additionalProperties = {
201385-
$ref: $ref
201388+
$ref: $ref,
201386201389
};
201387201390
}
201388201391
}
@@ -201443,9 +201446,7 @@ function GeneratePropertyModel(tableName, propertyName, property) {
201443201446
if (property.items && typeof property.items === constants_1.objectKeyword) {
201444201447
if (property.items.format && !property.format) {
201445201448
property.format = property.items.format;
201446-
// columnProperties = `${(property.items as JSONSchema4).format}[]`;
201447201449
}
201448-
// else
201449201450
if (property.items.type)
201450201451
columnProperties = `${property.items.type}[]`;
201451201452
}
@@ -201549,10 +201550,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
201549201550
property.type = refName;
201550201551
}
201551201552
const propertyModel = GeneratePropertyModel(tableModel.Name, propertyKey, property);
201552-
// if (
201553-
// propertyModel.ColumnProperties.includes(objectKeyword) ||
201554-
// propertyModel.ColumnProperties.includes(arrayKeyword)
201555-
// ) {
201556201553
if (refName) {
201557201554
const primaryKeyModel = {
201558201555
PrimaryKeyTableName: tableModel.Name,
@@ -201574,7 +201571,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
201574201571
models.ForeignKeyList.push(primaryKeyModel);
201575201572
propertyModel.IsForeignKey = true;
201576201573
}
201577-
// }
201578201574
tableModel.Properties.push(propertyModel);
201579201575
}
201580201576
}

dist/nosql.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4650,7 +4650,6 @@ Draw.loadPlugin(function (ui) {
46504650
}
46514651
sqlInputGenSQL.value = result;
46524652
}
4653-
;
46544653
mxUtils.br(divGenSQL);
46554654
const resetBtnGenSQL = mxUtils.button(mxResources.get("reset"), function () {
46564655
sqlInputGenSQL.value = sqlExportDefault;
@@ -4713,7 +4712,7 @@ Draw.loadPlugin(function (ui) {
47134712
let openApi = null;
47144713
const openApiOptions = {
47154714
title: "nosql default options",
4716-
version: constants_1.pluginVersion
4715+
version: constants_1.pluginVersion,
47174716
};
47184717
if (type == "openapi") {
47194718
// should already be a json, but going to serialize to openapi for validation
@@ -4748,7 +4747,6 @@ Draw.loadPlugin(function (ui) {
47484747
console.log(error);
47494748
}
47504749
}
4751-
;
47524750
mxUtils.br(divFromNOSQL);
47534751
const resetOpenAPIBtnFromNOSQL = mxUtils.button("Reset OpenAPI", function () {
47544752
sqlInputFromNOSQL.value = constants_nosql_1.defaultResetOpenApi;
@@ -4904,7 +4902,7 @@ const JSONSchemaTypes = [
49044902
"object",
49054903
"array",
49064904
"null",
4907-
"any"
4905+
"any",
49084906
];
49094907
exports.validJSONSchemaTypes = JSONSchemaTypes;
49104908

@@ -5083,32 +5081,35 @@ function dbToOpenApi(db) {
50835081
//
50845082
}
50855083
else {
5086-
// else {
50875084
removeType = true;
50885085
$ref = `#/components/schemas/${(0, sharedUtils_1.RemoveNameQuantifiers)(type)}`;
50895086
}
50905087
}
50915088
if (["array", "object"].indexOf(type) !== -1) {
5092-
const relationships = db.getRelationships().filter(x => x.entityA == key);
5089+
const relationships = db
5090+
.getRelationships()
5091+
.filter((x) => x.entityA == key);
50935092
const roleLookup = `[${key}.${propName}]`;
50945093
// FIND MATCH
5095-
const rel = relationships.find(x => x.roleA.indexOf(roleLookup) != -1);
5094+
const rel = relationships.find((x) => x.roleA.indexOf(roleLookup) != -1);
50965095
if (rel) {
50975096
const commentFKIndexes = (0, sharedUtils_1.getCommentIndexes)(rel.entityB);
5098-
const entityBName = rel.entityB.substring(0, commentFKIndexes.beforeStart).trim();
5097+
const entityBName = rel.entityB
5098+
.substring(0, commentFKIndexes.beforeStart)
5099+
.trim();
50995100
$ref = `#/components/schemas/${entityBName}`;
51005101
}
51015102
if ($ref) {
51025103
// if array additionalProperties.$ref
51035104
if (type == "array") {
51045105
items = {
5105-
$ref: $ref
5106+
$ref: $ref,
51065107
};
51075108
}
51085109
// if object items.$ref
51095110
if (type == "object") {
51105111
additionalProperties = {
5111-
$ref: $ref
5112+
$ref: $ref,
51125113
};
51135114
}
51145115
}
@@ -5169,9 +5170,7 @@ function GeneratePropertyModel(tableName, propertyName, property) {
51695170
if (property.items && typeof property.items === constants_1.objectKeyword) {
51705171
if (property.items.format && !property.format) {
51715172
property.format = property.items.format;
5172-
// columnProperties = `${(property.items as JSONSchema4).format}[]`;
51735173
}
5174-
// else
51755174
if (property.items.type)
51765175
columnProperties = `${property.items.type}[]`;
51775176
}
@@ -5275,10 +5274,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
52755274
property.type = refName;
52765275
}
52775276
const propertyModel = GeneratePropertyModel(tableModel.Name, propertyKey, property);
5278-
// if (
5279-
// propertyModel.ColumnProperties.includes(objectKeyword) ||
5280-
// propertyModel.ColumnProperties.includes(arrayKeyword)
5281-
// ) {
52825277
if (refName) {
52835278
const primaryKeyModel = {
52845279
PrimaryKeyTableName: tableModel.Name,
@@ -5300,7 +5295,6 @@ function ConvertOpenApiToDatabaseModel(schemas) {
53005295
models.ForeignKeyList.push(primaryKeyModel);
53015296
propertyModel.IsForeignKey = true;
53025297
}
5303-
// }
53045298
tableModel.Properties.push(propertyModel);
53055299
}
53065300
}

dist/sql.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -935,14 +935,15 @@ Draw.loadPlugin(function (ui) {
935935
const parser = new generate_sql_ddl_1.DbParser(type, db);
936936
// generate sql
937937
let sql = parser.getSQLDataDefinition();
938-
sql = `/*\n\tGenerated in drawio\n\tDatabase: ${type}\n\tPlugin: sql\n\tVersion: ${constants_1.pluginVersion}\n*/\n\n` + sql;
938+
sql =
939+
`/*\n\tGenerated in drawio\n\tDatabase: ${type}\n\tPlugin: sql\n\tVersion: ${constants_1.pluginVersion}\n*/\n\n` +
940+
sql;
939941
sql = sql.trim();
940942
// update sql value in text area
941943
sqlInputGenSQL.value = sql;
942944
// TODO: use selection as well?
943945
// const modelSelected = ui.editor.graph.getSelectionModel();
944946
}
945-
;
946947
mxUtils.br(divGenSQL);
947948
const resetBtnGenSQL = mxUtils.button(mxResources.get("reset"), function () {
948949
sqlInputGenSQL.value = sqlExportDefault;
@@ -1023,11 +1024,7 @@ Draw.loadPlugin(function (ui) {
10231024
rowCell = null;
10241025
// load parser
10251026
const parser = new sqlsimpleparser_1.SqlSimpleParser(type);
1026-
const models = parser
1027-
.feed(text)
1028-
.WithoutEnds()
1029-
.WithEnds()
1030-
.ToModel();
1027+
const models = parser.feed(text).WithoutEnds().WithEnds().ToModel();
10311028
foreignKeyList = models.ForeignKeyList;
10321029
primaryKeyList = models.PrimaryKeyList;
10331030
tableList = models.TableList;
@@ -1041,7 +1038,6 @@ Draw.loadPlugin(function (ui) {
10411038
rowCell = createTableResult.rowCell;
10421039
}
10431040
}
1044-
;
10451041
mxUtils.br(divFromSQL);
10461042
const resetBtnFromSQL = mxUtils.button(mxResources.get("reset"), function () {
10471043
sqlInputFromSQL.value = defaultReset;

0 commit comments

Comments
 (0)