@memberjunction/codegen-lib 2.7.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Angular/angular-codegen.js +3 -3
- package/dist/Angular/angular-codegen.js.map +1 -1
- package/dist/Config/config.d.ts +7 -7
- package/dist/Config/config.d.ts.map +1 -1
- package/dist/Config/config.js +2 -2
- package/dist/Config/config.js.map +1 -1
- package/dist/Database/dbSchema.js +2 -2
- package/dist/Database/dbSchema.js.map +1 -1
- package/dist/Database/manage-metadata.d.ts +7 -13
- package/dist/Database/manage-metadata.d.ts.map +1 -1
- package/dist/Database/manage-metadata.js +146 -196
- package/dist/Database/manage-metadata.js.map +1 -1
- package/dist/Database/sql.js +5 -5
- package/dist/Database/sql.js.map +1 -1
- package/dist/Database/sql_codegen.js +26 -26
- package/dist/Database/sql_codegen.js.map +1 -1
- package/dist/Misc/action_subclasses_codegen.d.ts.map +1 -0
- package/dist/{action_subclasses_codegen.js → Misc/action_subclasses_codegen.js} +4 -4
- package/dist/Misc/action_subclasses_codegen.js.map +1 -0
- package/dist/Misc/createNewUser.js +6 -6
- package/dist/Misc/createNewUser.js.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -0
- package/dist/{entity_subclasses_codegen.js → Misc/entity_subclasses_codegen.js} +4 -4
- package/dist/Misc/entity_subclasses_codegen.js.map +1 -0
- package/dist/Misc/graphql_server_codegen.d.ts.map +1 -0
- package/dist/{graphql_server_codegen.js → Misc/graphql_server_codegen.js} +10 -12
- package/dist/Misc/graphql_server_codegen.js.map +1 -0
- package/dist/Misc/runCommand.js +10 -10
- package/dist/Misc/runCommand.js.map +1 -1
- package/dist/Misc/sql_logging.d.ts +21 -0
- package/dist/Misc/sql_logging.d.ts.map +1 -0
- package/dist/Misc/sql_logging.js +128 -0
- package/dist/Misc/sql_logging.js.map +1 -0
- package/dist/Misc/{logging.d.ts → status_logging.d.ts} +1 -1
- package/dist/Misc/status_logging.d.ts.map +1 -0
- package/dist/Misc/{logging.js → status_logging.js} +1 -1
- package/dist/Misc/status_logging.js.map +1 -0
- package/dist/Misc/util.js +2 -2
- package/dist/Misc/util.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/runCodeGen.d.ts.map +1 -1
- package/dist/runCodeGen.js +54 -52
- package/dist/runCodeGen.js.map +1 -1
- package/package.json +8 -7
- package/dist/Misc/logging.d.ts.map +0 -1
- package/dist/Misc/logging.js.map +0 -1
- package/dist/action_subclasses_codegen.d.ts.map +0 -1
- package/dist/action_subclasses_codegen.js.map +0 -1
- package/dist/entity_subclasses_codegen.d.ts.map +0 -1
- package/dist/entity_subclasses_codegen.js.map +0 -1
- package/dist/graphql_server_codegen.d.ts.map +0 -1
- package/dist/graphql_server_codegen.js.map +0 -1
- /package/dist/{action_subclasses_codegen.d.ts → Misc/action_subclasses_codegen.d.ts} +0 -0
- /package/dist/{entity_subclasses_codegen.d.ts → Misc/entity_subclasses_codegen.d.ts} +0 -0
- /package/dist/{graphql_server_codegen.d.ts → Misc/graphql_server_codegen.d.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataSource } from "typeorm";
|
|
2
|
+
export declare class SQLLogging {
|
|
3
|
+
private static _SQLLoggingFilePath;
|
|
4
|
+
protected static get SQLLoggingFilePath(): string;
|
|
5
|
+
static initSQLLogging(): void;
|
|
6
|
+
static finishSQLLogging(): void;
|
|
7
|
+
protected static createFileName(): string;
|
|
8
|
+
static appendToSQLLogFile(contents: string, description?: string): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Executes the given SQL query using the given DataSource object.
|
|
11
|
+
* If the appendToLogFile parameter is true, the query will also be appended to the log file.
|
|
12
|
+
* Note that in order to append to the log file, ManageMetadataBase.manageMetaDataLogging must be called first.
|
|
13
|
+
* @param ds - The DataSource object to use to execute the query.
|
|
14
|
+
* @param query - The SQL query to execute.
|
|
15
|
+
* @param description - A description of the query to append to the log file.
|
|
16
|
+
* @returns - The result of the query execution.
|
|
17
|
+
*/
|
|
18
|
+
static LogSQLAndExecute(ds: DataSource, query: string, description?: string): Promise<any>;
|
|
19
|
+
protected static convertSQLLogToFlywaySchema(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=sql_logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql_logging.d.ts","sourceRoot":"","sources":["../../src/Misc/sql_logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAc;IAEhD,SAAS,CAAC,MAAM,KAAK,kBAAkB,IAAI,MAAM,CAEhD;WACa,cAAc;WAmCb,gBAAgB;IAQ9B,SAAS,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM;WAetB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7F;;;;;;;;MAQE;WACkB,gBAAgB,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAMvG,SAAS,CAAC,MAAM,CAAC,2BAA2B,IAAI,IAAI;CAcvD"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.SQLLogging = void 0;
|
|
30
|
+
const config_1 = require("../Config/config");
|
|
31
|
+
const status_logging_1 = require("./status_logging");
|
|
32
|
+
const fs = __importStar(require("fs"));
|
|
33
|
+
const path_1 = __importDefault(require("path"));
|
|
34
|
+
class SQLLogging {
|
|
35
|
+
static get SQLLoggingFilePath() {
|
|
36
|
+
return SQLLogging._SQLLoggingFilePath;
|
|
37
|
+
}
|
|
38
|
+
static initSQLLogging() {
|
|
39
|
+
if (!SQLLogging.SQLLoggingFilePath) {
|
|
40
|
+
// not already set up, so proceed, otherwise we do nothing as we're already good to go
|
|
41
|
+
const config = config_1.configInfo.SQLOutput;
|
|
42
|
+
if (!config) {
|
|
43
|
+
(0, status_logging_1.logError)("MetadataLoggingConfig is required to enable metadata logging");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!config.enabled)
|
|
47
|
+
return; // we are not doing anything here....
|
|
48
|
+
if (config.folderPath) {
|
|
49
|
+
const dirExists = fs.existsSync(config.folderPath);
|
|
50
|
+
if (!dirExists) {
|
|
51
|
+
fs.mkdirSync(config.folderPath, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
const fileName = config.fileName || this.createFileName();
|
|
54
|
+
SQLLogging._SQLLoggingFilePath = path_1.default.join(config.folderPath, fileName);
|
|
55
|
+
if (!config.appendToFile || !fs.existsSync(SQLLogging.SQLLoggingFilePath)) {
|
|
56
|
+
//create an empty file
|
|
57
|
+
fs.writeFileSync(SQLLogging.SQLLoggingFilePath, '');
|
|
58
|
+
}
|
|
59
|
+
(0, status_logging_1.logStatus)(`Metadata logging enabled. File path: ${SQLLogging.SQLLoggingFilePath}`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
(0, status_logging_1.logError)("folderPath is required to enable metadata logging");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static finishSQLLogging() {
|
|
68
|
+
if (SQLLogging.SQLLoggingFilePath) {
|
|
69
|
+
if (config_1.configInfo.SQLOutput.convertCoreSchemaToFlywayMigrationFile) {
|
|
70
|
+
SQLLogging.convertSQLLogToFlywaySchema();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static createFileName() {
|
|
75
|
+
const date = new Date();
|
|
76
|
+
const year = date.getUTCFullYear();
|
|
77
|
+
const month = String(date.getUTCMonth() + 1).padStart(2, '0'); // Month is 0-based
|
|
78
|
+
const day = String(date.getUTCDate()).padStart(2, '0');
|
|
79
|
+
const hour = String(date.getUTCHours()).padStart(2, '0');
|
|
80
|
+
const minute = String(date.getUTCMinutes()).padStart(2, '0');
|
|
81
|
+
const second = String(date.getUTCSeconds()).padStart(2, '0');
|
|
82
|
+
const fileName = `CodeGen_Run_${year}-${month}-${day}_${hour}-${minute}-${second}.sql`;
|
|
83
|
+
return fileName;
|
|
84
|
+
}
|
|
85
|
+
static async appendToSQLLogFile(contents, description) {
|
|
86
|
+
try {
|
|
87
|
+
if (!contents || !this.SQLLoggingFilePath) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (description) {
|
|
91
|
+
const comment = `/* ${description} */\n`;
|
|
92
|
+
contents = `${comment}${contents}`;
|
|
93
|
+
}
|
|
94
|
+
contents = `${contents}\n\n`;
|
|
95
|
+
fs.appendFileSync(this.SQLLoggingFilePath, contents);
|
|
96
|
+
}
|
|
97
|
+
catch (ex) {
|
|
98
|
+
(0, status_logging_1.logError)("Unable to log metadata SQL text to file", ex);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Executes the given SQL query using the given DataSource object.
|
|
103
|
+
* If the appendToLogFile parameter is true, the query will also be appended to the log file.
|
|
104
|
+
* Note that in order to append to the log file, ManageMetadataBase.manageMetaDataLogging must be called first.
|
|
105
|
+
* @param ds - The DataSource object to use to execute the query.
|
|
106
|
+
* @param query - The SQL query to execute.
|
|
107
|
+
* @param description - A description of the query to append to the log file.
|
|
108
|
+
* @returns - The result of the query execution.
|
|
109
|
+
*/
|
|
110
|
+
static async LogSQLAndExecute(ds, query, description) {
|
|
111
|
+
SQLLogging.appendToSQLLogFile(query, description);
|
|
112
|
+
return ds.query(query);
|
|
113
|
+
}
|
|
114
|
+
static convertSQLLogToFlywaySchema() {
|
|
115
|
+
if (!this.SQLLoggingFilePath) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const coreSchema = (0, config_1.mj_core_schema)();
|
|
119
|
+
const regex = new RegExp(coreSchema, 'g');
|
|
120
|
+
const data = fs.readFileSync(this.SQLLoggingFilePath, 'utf-8');
|
|
121
|
+
const replacedData = data.replace(regex, "${flyway:defaultSchema}");
|
|
122
|
+
fs.writeFileSync(`${this.SQLLoggingFilePath}`, replacedData);
|
|
123
|
+
(0, status_logging_1.logStatus)(` >>> Flyway Migration File Completed: Replaced all instances of ${coreSchema} with \${flyway:defaultSchema} in the metadata log file`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.SQLLogging = SQLLogging;
|
|
127
|
+
SQLLogging._SQLLoggingFilePath = '';
|
|
128
|
+
//# sourceMappingURL=sql_logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql_logging.js","sourceRoot":"","sources":["../../src/Misc/sql_logging.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA+E;AAC/E,qDAAuD;AACvD,uCAAyB;AACzB,gDAAwB;AAExB,MAAa,UAAU;IAGT,MAAM,KAAK,kBAAkB;QACnC,OAAO,UAAU,CAAC,mBAAmB,CAAC;IAC1C,CAAC;IACM,MAAM,CAAC,cAAc;QACxB,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;YACjC,sFAAsF;YACtF,MAAM,MAAM,GAAG,mBAAU,CAAC,SAAS,CAAC;YACpC,IAAG,CAAC,MAAM,EAAC,CAAC;gBACR,IAAA,yBAAQ,EAAC,8DAA8D,CAAC,CAAC;gBACzE,OAAO;YACX,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,OAAO;gBACf,OAAO,CAAC,sCAAsC;YAElD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACpB,MAAM,SAAS,GAAY,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;oBACb,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,CAAC;gBAED,MAAM,QAAQ,GAAW,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAClE,UAAU,CAAC,mBAAmB,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAC,QAAQ,CAAC,CAAC;gBAEvE,IAAI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,UAAU,EAAE,GAAG,CAAC,CAAC;QAElD,MAAM,IAAI,GAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,YAAY,GAAW,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC;QAE5E,EAAE,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,EAAE,YAAY,CAAC,CAAC;QAC7D,IAAA,0BAAS,EAAC,qEAAqE,UAAU,yDAAyD,CAAC,CAAC;IACvJ,CAAC;;AAhHN,gCAiHC;AAhHkB,8BAAmB,GAAW,EAAE,CAAC"}
|
|
@@ -40,4 +40,4 @@ export declare function logStatus(message: string, ...args: any[]): void;
|
|
|
40
40
|
* Wrapper for the LoggerBase.logMessage method
|
|
41
41
|
*/
|
|
42
42
|
export declare function logMessage(message: string, severity: SeverityType, isError?: boolean, ...args: any[]): void;
|
|
43
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=status_logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status_logging.d.ts","sourceRoot":"","sources":["../../src/Misc/status_logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,YAAY,EAA2C,MAAM,sBAAsB,CAAA;AAIjH;;;GAGG;AACH,qBACa,UAAU;IACpB;;;;OAIG;IACI,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAOvE;;;;OAIG;IACI,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAOxE;;;;;;OAMG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAO3F,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAUxE,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CAgBvE;AAKD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAEvD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAEzD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAExD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,UAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAEzG"}
|
|
@@ -112,4 +112,4 @@ function logMessage(message, severity, isError = false, ...args) {
|
|
|
112
112
|
return _logger.logMessage(message, severity, isError, ...args);
|
|
113
113
|
}
|
|
114
114
|
exports.logMessage = logMessage;
|
|
115
|
-
//# sourceMappingURL=
|
|
115
|
+
//# sourceMappingURL=status_logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status_logging.js","sourceRoot":"","sources":["../../src/Misc/status_logging.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAuE;AACvE,+CAAiH;AACjH,mDAAiE;AACjE,gDAAwB;AAExB;;;GAGG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAU;IACpB;;;;OAIG;IACI,QAAQ,CAAC,OAAe,EAAE,QAAsB,EAAE,GAAG,IAAW;QACpE,MAAM,cAAc,GAAW,IAAA,2BAAoB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACv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GAAG,IAAI,CAAC,CAAC;AACpE,CAAC;AAFD,4BAEC;AAED,SAAgB,UAAU,CAAC,OAAe,EAAE,GAAG,IAAW;IACvD,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,mBAAY,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACnE,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,OAAe,EAAE,GAAG,IAAW;IACtD,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,mBAAY,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AACjE,CAAC;AAFD,8BAEC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,OAAe,EAAE,QAAsB,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,IAAW;IAChG,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAClE,CAAC;AAFD,gCAEC"}
|
package/dist/Misc/util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.combineFiles = exports.attemptDeleteFile = exports.copyDir = exports.makeDir = exports.makeDirs = exports.replaceAllSpaces = void 0;
|
|
4
|
-
const
|
|
4
|
+
const status_logging_1 = require("./status_logging");
|
|
5
5
|
const fs_extra_1 = require("fs-extra");
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const fse = require('fs-extra');
|
|
@@ -32,7 +32,7 @@ function copyDir(sourceDir, destDir) {
|
|
|
32
32
|
fse.copySync(sourceDir, destDir, { overwrite: true });
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
-
(0,
|
|
35
|
+
(0, status_logging_1.logError)(err);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.copyDir = copyDir;
|
package/dist/Misc/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/Misc/util.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/Misc/util.ts"],"names":[],"mappings":";;;AAAA,qDAA4C;AAC5C,uCAAsC;AAEtC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAChC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,SAAgB,gBAAgB,CAAC,CAAS;IACtC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QACf,OAAO,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB;SAC7D,YAAY;QACb,OAAO,CAAC,CAAC;AACjB,CAAC;AALD,4CAKC;AAED,SAAgB,QAAQ,CAAC,QAAkB;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAJD,4BAIC;AAED,SAAgB,OAAO,CAAC,OAAe;IACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC;AAJD,0BAIC;AAED,SAAgB,OAAO,CAAC,SAAiB,EAAE,OAAe;IACtD,yDAAyD;IACzD,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,OAA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ACX,CAAC;IAED,mGAAmG;IACnG,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;IAEzG,qGAAqG;IACrG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;QAChC,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;QAChE,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;QAChE,IAAI,cAAc,IAAI,CAAC,cAAc,EAAE,CAAC;YACpC,OAAO,CAAC,CAAC;QACb,CAAC;aAAM,IAAI,CAAC,cAAc,IAAI,cAAc,EAAE,CAAC;YAC3C,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,eAAe,GAAG,EAAE,CAAC;IACzB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,eAAe,IAAI,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,mDAAmD;IACnD,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AACxD,CAAC;AAjCD,oCAiCC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export { initializeConfig } from './Config/config';
|
|
|
2
2
|
export * from './Config/config';
|
|
3
3
|
export * from './Config/db-connection';
|
|
4
4
|
export * from './Database/dbSchema';
|
|
5
|
-
export * from './entity_subclasses_codegen';
|
|
6
|
-
export * from './action_subclasses_codegen';
|
|
7
|
-
export * from './graphql_server_codegen';
|
|
8
|
-
export * from './Misc/
|
|
5
|
+
export * from './Misc/entity_subclasses_codegen';
|
|
6
|
+
export * from './Misc/action_subclasses_codegen';
|
|
7
|
+
export * from './Misc/graphql_server_codegen';
|
|
8
|
+
export * from './Misc/status_logging';
|
|
9
9
|
export * from './Database/manage-metadata';
|
|
10
10
|
export * from './Misc/runCommand';
|
|
11
11
|
export * from './Database/sql_codegen';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAE3B,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAC;AACpD,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -20,10 +20,10 @@ Object.defineProperty(exports, "initializeConfig", { enumerable: true, get: func
|
|
|
20
20
|
__exportStar(require("./Config/config"), exports);
|
|
21
21
|
__exportStar(require("./Config/db-connection"), exports);
|
|
22
22
|
__exportStar(require("./Database/dbSchema"), exports);
|
|
23
|
-
__exportStar(require("./entity_subclasses_codegen"), exports);
|
|
24
|
-
__exportStar(require("./action_subclasses_codegen"), exports);
|
|
25
|
-
__exportStar(require("./graphql_server_codegen"), exports);
|
|
26
|
-
__exportStar(require("./Misc/
|
|
23
|
+
__exportStar(require("./Misc/entity_subclasses_codegen"), exports);
|
|
24
|
+
__exportStar(require("./Misc/action_subclasses_codegen"), exports);
|
|
25
|
+
__exportStar(require("./Misc/graphql_server_codegen"), exports);
|
|
26
|
+
__exportStar(require("./Misc/status_logging"), exports);
|
|
27
27
|
__exportStar(require("./Database/manage-metadata"), exports);
|
|
28
28
|
__exportStar(require("./Misc/runCommand"), exports);
|
|
29
29
|
__exportStar(require("./Database/sql_codegen"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAkD;AAAzC,0GAAA,gBAAgB,OAAA;AAEzB,kDAA+B;AAC/B,yDAAsC;AACtC,sDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAkD;AAAzC,0GAAA,gBAAgB,OAAA;AAEzB,kDAA+B;AAC/B,yDAAsC;AACtC,sDAAmC;AACnC,mEAAgD;AAChD,mEAAiD;AACjD,gEAA6C;AAC7C,wDAAqC;AACrC,6DAA0C;AAC1C,oDAAiC;AACjC,yDAAsC;AACtC,iDAA8B;AAC9B,8CAA2B;AAE3B,4DAAyC;AACzC,sEAAoD;AACpD,oFAAkE;AAClE,+EAA6D;AAC7D,8EAA4D;AAE5D,+CAA4B"}
|
package/dist/runCodeGen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runCodeGen.d.ts","sourceRoot":"","sources":["../src/runCodeGen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runCodeGen.d.ts","sourceRoot":"","sources":["../src/runCodeGen.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,qBACa,cAAc;IACvB;;OAEG;IACU,eAAe;IAmB5B;;;;OAIG;IACU,GAAG,CAAC,sBAAsB,GAAE,OAAe;CAiP3D;AAED,wBAAsB,+BAA+B,CAAC,sBAAsB,GAAE,OAAe,iBAG5F"}
|
package/dist/runCodeGen.js
CHANGED
|
@@ -30,14 +30,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.runMemberJunctionCodeGeneration = exports.RunCodeGenBase = void 0;
|
|
33
|
-
const graphql_server_codegen_1 = require("./graphql_server_codegen");
|
|
33
|
+
const graphql_server_codegen_1 = require("./Misc/graphql_server_codegen");
|
|
34
34
|
const sql_codegen_1 = require("./Database/sql_codegen");
|
|
35
|
-
const entity_subclasses_codegen_1 = require("./entity_subclasses_codegen");
|
|
35
|
+
const entity_subclasses_codegen_1 = require("./Misc/entity_subclasses_codegen");
|
|
36
36
|
const sqlserver_dataprovider_1 = require("@memberjunction/sqlserver-dataprovider");
|
|
37
37
|
const db_connection_1 = __importStar(require("./Config/db-connection"));
|
|
38
38
|
const manage_metadata_1 = require("./Database/manage-metadata");
|
|
39
39
|
const config_1 = require("./Config/config");
|
|
40
|
-
const
|
|
40
|
+
const status_logging_1 = require("./Misc/status_logging");
|
|
41
41
|
const MJ = __importStar(require("@memberjunction/core"));
|
|
42
42
|
const runCommand_1 = require("./Misc/runCommand");
|
|
43
43
|
const dbSchema_1 = require("./Database/dbSchema");
|
|
@@ -45,8 +45,9 @@ const angular_codegen_1 = require("./Angular/angular-codegen");
|
|
|
45
45
|
const sqlserver_dataprovider_2 = require("@memberjunction/sqlserver-dataprovider");
|
|
46
46
|
const createNewUser_1 = require("./Misc/createNewUser");
|
|
47
47
|
const global_1 = require("@memberjunction/global");
|
|
48
|
-
const action_subclasses_codegen_1 = require("./action_subclasses_codegen");
|
|
48
|
+
const action_subclasses_codegen_1 = require("./Misc/action_subclasses_codegen");
|
|
49
49
|
const actions_1 = require("@memberjunction/actions");
|
|
50
|
+
const sql_logging_1 = require("./Misc/sql_logging");
|
|
50
51
|
/**
|
|
51
52
|
* This class is the main entry point for running the code generation process. It will handle all the steps required to generate the code for the MemberJunction system. You can sub-class this class
|
|
52
53
|
* and override specific methods as desired to customize the code generation process.
|
|
@@ -59,13 +60,13 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
59
60
|
/****************************************************************************************
|
|
60
61
|
// First, setup the data source and make sure the metadata and related stuff for MJCore is initialized
|
|
61
62
|
****************************************************************************************/
|
|
62
|
-
(0,
|
|
63
|
+
(0, status_logging_1.logStatus)("Initializing Data Source...");
|
|
63
64
|
await db_connection_1.default.initialize()
|
|
64
65
|
.then(() => {
|
|
65
|
-
(0,
|
|
66
|
+
(0, status_logging_1.logStatus)("Data Source has been initialized!");
|
|
66
67
|
})
|
|
67
68
|
.catch((err) => {
|
|
68
|
-
(0,
|
|
69
|
+
(0, status_logging_1.logError)("Error during Data Source initialization", err);
|
|
69
70
|
});
|
|
70
71
|
const pool = await (0, db_connection_1.MSSQLConnection)(); // get the MSSQL connection pool
|
|
71
72
|
const config = new sqlserver_dataprovider_2.SQLServerProviderConfigData(db_connection_1.default, '', (0, config_1.mj_core_schema)(), 0);
|
|
@@ -79,7 +80,7 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
79
80
|
async Run(skipDatabaseGeneration = false) {
|
|
80
81
|
try {
|
|
81
82
|
const startTime = new Date();
|
|
82
|
-
(0,
|
|
83
|
+
(0, status_logging_1.logStatus)("\n\nSTARTING MJ CodeGen Run... @ " + startTime.toLocaleString());
|
|
83
84
|
await this.setupDataSource();
|
|
84
85
|
await sqlserver_dataprovider_1.UserCache.Instance.Refresh(db_connection_1.default);
|
|
85
86
|
const userMatch = sqlserver_dataprovider_1.UserCache.Users.find(u => u?.Type?.trim().toLowerCase() === 'owner');
|
|
@@ -87,7 +88,7 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
87
88
|
// get the entity metadata
|
|
88
89
|
const md = new MJ.Metadata();
|
|
89
90
|
if (md.Entities.length === 0) {
|
|
90
|
-
(0,
|
|
91
|
+
(0, status_logging_1.logError)('No entities found in metadata, exiting...'); // TODO: add a way to generate the metadata if it doesn't exist
|
|
91
92
|
process.exit(1);
|
|
92
93
|
}
|
|
93
94
|
const runCommandsObject = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(runCommand_1.RunCommandsBase);
|
|
@@ -95,22 +96,23 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
95
96
|
// check to see if the user wants to skip database generation via the config settings
|
|
96
97
|
const skipDB = skipDatabaseGeneration || (0, config_1.getSettingValue)('skip_database_generation', false);
|
|
97
98
|
if (!skipDB) {
|
|
98
|
-
(0,
|
|
99
|
+
(0, status_logging_1.logStatus)("Handling SQL Script Execution, Metadata Maintenance, and SQL Object Generation... (to skip this, set skip_database_generation to true in the config file under settings)");
|
|
100
|
+
sql_logging_1.SQLLogging.initSQLLogging(); // initialize the SQL Logging functionality
|
|
99
101
|
/****************************************************************************************
|
|
100
102
|
// STEP 0 --- Precursor Step execute any commands specified in the config file
|
|
101
103
|
****************************************************************************************/
|
|
102
104
|
const beforeCommands = (0, config_1.commands)('BEFORE');
|
|
103
105
|
if (beforeCommands && beforeCommands.length > 0) {
|
|
104
|
-
(0,
|
|
106
|
+
(0, status_logging_1.logStatus)('Executing BEFORE commands...');
|
|
105
107
|
const results = await runCommandsObject.runCommands(beforeCommands);
|
|
106
108
|
if (results.some(r => !r.success))
|
|
107
|
-
(0,
|
|
109
|
+
(0, status_logging_1.logError)('ERROR running one or more BEFORE commands');
|
|
108
110
|
}
|
|
109
111
|
/****************************************************************************************
|
|
110
112
|
// STEP 0.1 --- Execute any before SQL Scripts specified in the config file
|
|
111
113
|
****************************************************************************************/
|
|
112
114
|
if (!await sqlCodeGenObject.runCustomSQLScripts(db_connection_1.default, 'before-all'))
|
|
113
|
-
(0,
|
|
115
|
+
(0, status_logging_1.logError)('ERROR running before-all SQL Scripts');
|
|
114
116
|
/****************************************************************************************
|
|
115
117
|
// STEP 0.2 --- Create a new user if there is newUserSetup info in the config file
|
|
116
118
|
****************************************************************************************/
|
|
@@ -120,11 +122,11 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
120
122
|
const result = await newUserObject.createNewUser(newUserSetup);
|
|
121
123
|
if (!result.Success) {
|
|
122
124
|
if (result.Severity === 'error') {
|
|
123
|
-
(0,
|
|
124
|
-
(0,
|
|
125
|
+
(0, status_logging_1.logError)('ERROR creating new user');
|
|
126
|
+
(0, status_logging_1.logError)(' ' + result.Message);
|
|
125
127
|
}
|
|
126
128
|
else {
|
|
127
|
-
(0,
|
|
129
|
+
(0, status_logging_1.logWarning)('Warning: (New User Setup) ' + result.Message);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -132,28 +134,28 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
132
134
|
// STEP 1 - Manage Metadata - including generating new metadata as required
|
|
133
135
|
****************************************************************************************/
|
|
134
136
|
const manageMD = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(manage_metadata_1.ManageMetadataBase);
|
|
135
|
-
(0,
|
|
136
|
-
manageMD.manageMetaDataLogging(config_1.configInfo.metadataConfig);
|
|
137
|
+
(0, status_logging_1.logStatus)('Managing Metadata...');
|
|
137
138
|
const metadataSuccess = await manageMD.manageMetadata(db_connection_1.default);
|
|
138
139
|
if (!metadataSuccess) {
|
|
139
|
-
(0,
|
|
140
|
+
(0, status_logging_1.logError)('ERROR managing metadata');
|
|
140
141
|
}
|
|
141
142
|
/****************************************************************************************
|
|
142
143
|
// STEP 2 - SQL Script Generation
|
|
143
144
|
****************************************************************************************/
|
|
144
145
|
const sqlOutputDir = (0, config_1.outputDir)('SQL', true);
|
|
145
146
|
if (sqlOutputDir) {
|
|
146
|
-
(0,
|
|
147
|
+
(0, status_logging_1.logStatus)('Managing SQL Scripts and Execution...');
|
|
147
148
|
const sqlSuccess = await sqlCodeGenObject.manageSQLScriptsAndExecution(db_connection_1.default, md.Entities, sqlOutputDir);
|
|
148
149
|
if (!sqlSuccess) {
|
|
149
|
-
(0,
|
|
150
|
+
(0, status_logging_1.logError)('Error managing SQL scripts and execution');
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
else
|
|
153
|
-
(0,
|
|
154
|
+
(0, status_logging_1.logStatus)('SQL output directory NOT found in config file, skipping...');
|
|
155
|
+
sql_logging_1.SQLLogging.finishSQLLogging(); // finish up the SQL Logging
|
|
154
156
|
}
|
|
155
157
|
else {
|
|
156
|
-
(0,
|
|
158
|
+
(0, status_logging_1.logMessage)("Skipping all database related CodeGen work because skip_database_generation was set to true in the config file under settings", MJ.SeverityType.Warning, false);
|
|
157
159
|
}
|
|
158
160
|
const coreEntities = md.Entities.filter(e => e.IncludeInAPI).filter(e => e.SchemaName.trim().toLowerCase() === config_1.mjCoreSchema.trim().toLowerCase());
|
|
159
161
|
const nonCoreEntities = md.Entities.filter(e => e.IncludeInAPI).filter(e => e.SchemaName.trim().toLowerCase() !== config_1.mjCoreSchema.trim().toLowerCase());
|
|
@@ -163,31 +165,31 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
163
165
|
const graphQLCoreResolversOutputDir = (0, config_1.outputDir)('GraphQLCoreEntityResolvers', false);
|
|
164
166
|
if (graphQLCoreResolversOutputDir) {
|
|
165
167
|
// generate the GraphQL server code
|
|
166
|
-
(0,
|
|
168
|
+
(0, status_logging_1.logStatus)('Generating CORE Entity GraphQL Resolver Code...');
|
|
167
169
|
const graphQLGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(graphql_server_codegen_1.GraphQLServerGeneratorBase);
|
|
168
170
|
if (!graphQLGenerator.generateGraphQLServerCode(coreEntities, graphQLCoreResolversOutputDir, '@memberjunction/core-entities', true))
|
|
169
|
-
(0,
|
|
171
|
+
(0, status_logging_1.logError)('Error generating GraphQL server code');
|
|
170
172
|
}
|
|
171
173
|
const graphqlOutputDir = (0, config_1.outputDir)('GraphQLServer', true);
|
|
172
174
|
if (graphqlOutputDir) {
|
|
173
175
|
// generate the GraphQL server code
|
|
174
|
-
(0,
|
|
176
|
+
(0, status_logging_1.logStatus)('Generating GraphQL Resolver Code...');
|
|
175
177
|
const graphQLGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(graphql_server_codegen_1.GraphQLServerGeneratorBase);
|
|
176
178
|
if (!graphQLGenerator.generateGraphQLServerCode(nonCoreEntities, graphqlOutputDir, 'mj_generatedentities', false))
|
|
177
|
-
(0,
|
|
179
|
+
(0, status_logging_1.logError)('Error generating GraphQL Resolver code');
|
|
178
180
|
}
|
|
179
181
|
else
|
|
180
|
-
(0,
|
|
182
|
+
(0, status_logging_1.logStatus)('GraphQL server output directory NOT found in config file, skipping...');
|
|
181
183
|
/****************************************************************************************
|
|
182
184
|
// STEP 4 - Core Entity Subclass Code Gen
|
|
183
185
|
****************************************************************************************/
|
|
184
186
|
const coreEntitySubClassOutputDir = (0, config_1.outputDir)('CoreEntitySubClasses', false);
|
|
185
187
|
if (coreEntitySubClassOutputDir && coreEntitySubClassOutputDir.length > 0) {
|
|
186
188
|
// generate the entity subclass code
|
|
187
|
-
(0,
|
|
189
|
+
(0, status_logging_1.logStatus)('Generating CORE Entity Subclass Code...');
|
|
188
190
|
const entitySubClassGeneratorObject = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(entity_subclasses_codegen_1.EntitySubClassGeneratorBase);
|
|
189
191
|
if (!entitySubClassGeneratorObject.generateAllEntitySubClasses(coreEntities, coreEntitySubClassOutputDir)) {
|
|
190
|
-
(0,
|
|
192
|
+
(0, status_logging_1.logError)('Error generating entity subclass code');
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
/****************************************************************************************
|
|
@@ -196,14 +198,14 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
196
198
|
const entitySubClassOutputDir = (0, config_1.outputDir)('EntitySubClasses', true);
|
|
197
199
|
if (entitySubClassOutputDir) {
|
|
198
200
|
// generate the entity subclass code
|
|
199
|
-
(0,
|
|
201
|
+
(0, status_logging_1.logStatus)('Generating Entity Subclass Code...');
|
|
200
202
|
const entitySubClassGeneratorObject = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(entity_subclasses_codegen_1.EntitySubClassGeneratorBase);
|
|
201
203
|
if (!entitySubClassGeneratorObject.generateAllEntitySubClasses(nonCoreEntities, entitySubClassOutputDir)) {
|
|
202
|
-
(0,
|
|
204
|
+
(0, status_logging_1.logError)('Error generating entity subclass code');
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
else {
|
|
206
|
-
(0,
|
|
208
|
+
(0, status_logging_1.logStatus)('Entity subclass output directory NOT found in config file, skipping...');
|
|
207
209
|
}
|
|
208
210
|
/****************************************************************************************
|
|
209
211
|
// STEP 5 - Angular Code Gen
|
|
@@ -211,77 +213,77 @@ let RunCodeGenBase = class RunCodeGenBase {
|
|
|
211
213
|
const angularCoreEntitiesOutputDir = (0, config_1.outputDir)('AngularCoreEntities', false);
|
|
212
214
|
if (angularCoreEntitiesOutputDir) {
|
|
213
215
|
// generate the Angular client code
|
|
214
|
-
(0,
|
|
216
|
+
(0, status_logging_1.logStatus)('Generating Angular CORE Entities Code...');
|
|
215
217
|
const angularGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(angular_codegen_1.AngularClientGeneratorBase);
|
|
216
218
|
if (!await angularGenerator.generateAngularCode(coreEntities, angularCoreEntitiesOutputDir, 'Core', currentUser))
|
|
217
|
-
(0,
|
|
219
|
+
(0, status_logging_1.logError)('Error generating Angular CORE Entities code');
|
|
218
220
|
}
|
|
219
221
|
const angularOutputDir = (0, config_1.outputDir)('Angular', false);
|
|
220
222
|
if (angularOutputDir) {
|
|
221
223
|
// generate the Angular client code
|
|
222
|
-
(0,
|
|
224
|
+
(0, status_logging_1.logStatus)('Generating Angular Code...');
|
|
223
225
|
const angularGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(angular_codegen_1.AngularClientGeneratorBase);
|
|
224
226
|
if (!await angularGenerator.generateAngularCode(nonCoreEntities, angularOutputDir, '', currentUser))
|
|
225
|
-
(0,
|
|
227
|
+
(0, status_logging_1.logError)('Error generating Angular code');
|
|
226
228
|
}
|
|
227
229
|
else
|
|
228
|
-
(0,
|
|
230
|
+
(0, status_logging_1.logStatus)('Angular output directory NOT found in config file, skipping...');
|
|
229
231
|
/****************************************************************************************
|
|
230
232
|
// STEP 6 - Database Schema Output in JSON - for documentation and can be used by AI/etc.
|
|
231
233
|
****************************************************************************************/
|
|
232
234
|
const dbSchemaOutputDir = (0, config_1.outputDir)('DBSchemaJSON', false);
|
|
233
235
|
if (dbSchemaOutputDir) {
|
|
234
236
|
// generate the GraphQL client code
|
|
235
|
-
(0,
|
|
237
|
+
(0, status_logging_1.logStatus)('Generating Database Schema JSON Output...');
|
|
236
238
|
const schemaGeneratorObject = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(dbSchema_1.DBSchemaGeneratorBase);
|
|
237
239
|
if (!schemaGeneratorObject.generateDBSchemaJSONOutput(md.Entities, dbSchemaOutputDir))
|
|
238
|
-
(0,
|
|
240
|
+
(0, status_logging_1.logError)('Error generating Database Schema JSON Output');
|
|
239
241
|
}
|
|
240
242
|
else
|
|
241
|
-
(0,
|
|
243
|
+
(0, status_logging_1.logStatus)('DB Schema output directory NOT found in config file, skipping...');
|
|
242
244
|
/****************************************************************************************
|
|
243
245
|
// STEP 7 - Actions Code Gen
|
|
244
246
|
****************************************************************************************/
|
|
245
247
|
const coreActionsOutputDir = (0, config_1.outputDir)('CoreActionSubclasses', false);
|
|
246
248
|
await actions_1.ActionEngine.Instance.Config(false, currentUser);
|
|
247
249
|
if (coreActionsOutputDir) {
|
|
248
|
-
(0,
|
|
250
|
+
(0, status_logging_1.logStatus)('Generating CORE Actions Code...');
|
|
249
251
|
const actionsGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(action_subclasses_codegen_1.ActionSubClassGeneratorBase);
|
|
250
252
|
if (!await actionsGenerator.generateActions(actions_1.ActionEngine.Instance.CoreActions, coreActionsOutputDir))
|
|
251
|
-
(0,
|
|
253
|
+
(0, status_logging_1.logError)('Error generating CORE Actions code');
|
|
252
254
|
}
|
|
253
255
|
const actionsOutputDir = (0, config_1.outputDir)('ActionSubclasses', false);
|
|
254
256
|
if (actionsOutputDir) {
|
|
255
|
-
(0,
|
|
257
|
+
(0, status_logging_1.logStatus)('Generating Actions Code...');
|
|
256
258
|
const actionsGenerator = global_1.MJGlobal.Instance.ClassFactory.CreateInstance(action_subclasses_codegen_1.ActionSubClassGeneratorBase);
|
|
257
259
|
if (!await actionsGenerator.generateActions(actions_1.ActionEngine.Instance.NonCoreActions, actionsOutputDir))
|
|
258
|
-
(0,
|
|
260
|
+
(0, status_logging_1.logError)('Error generating Actions code');
|
|
259
261
|
}
|
|
260
262
|
else
|
|
261
|
-
(0,
|
|
263
|
+
(0, status_logging_1.logStatus)('Actions output directory NOT found in config file, skipping...');
|
|
262
264
|
/****************************************************************************************
|
|
263
265
|
// STEP 8 --- Finalization Step - execute any AFTER commands specified in the config file
|
|
264
266
|
****************************************************************************************/
|
|
265
267
|
const afterCommands = (0, config_1.commands)('AFTER');
|
|
266
268
|
if (afterCommands && afterCommands.length > 0) {
|
|
267
|
-
(0,
|
|
269
|
+
(0, status_logging_1.logStatus)('Executing AFTER commands...');
|
|
268
270
|
const results = await runCommandsObject.runCommands(afterCommands);
|
|
269
271
|
if (results.some(r => !r.success))
|
|
270
|
-
(0,
|
|
272
|
+
(0, status_logging_1.logError)('ERROR running one or more AFTER commands');
|
|
271
273
|
}
|
|
272
274
|
/****************************************************************************************
|
|
273
275
|
// STEP 9 --- Execute any AFTER SQL Scripts specified in the config file
|
|
274
276
|
****************************************************************************************/
|
|
275
277
|
if (!skipDB) {
|
|
276
278
|
if (!await sqlCodeGenObject.runCustomSQLScripts(db_connection_1.default, 'after-all'))
|
|
277
|
-
(0,
|
|
279
|
+
(0, status_logging_1.logError)('ERROR running after-all SQL Scripts');
|
|
278
280
|
}
|
|
279
|
-
(0,
|
|
280
|
-
(0,
|
|
281
|
+
(0, status_logging_1.logStatus)(md.Entities.length + ' entities processed and outputed to configured directories');
|
|
282
|
+
(0, status_logging_1.logStatus)("MJ CodeGen Run Complete! @ " + new Date().toLocaleString() + " (" + (new Date().getTime() - startTime.getTime()) / 1000 + " seconds)");
|
|
281
283
|
process.exit(0); // wrap it up, 0 means success
|
|
282
284
|
}
|
|
283
285
|
catch (e) {
|
|
284
|
-
(0,
|
|
286
|
+
(0, status_logging_1.logError)(e);
|
|
285
287
|
process.exit(1); // error code
|
|
286
288
|
}
|
|
287
289
|
}
|