@memberjunction/codegen-lib 2.48.0 → 2.49.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.d.ts +164 -6
- package/dist/Angular/angular-codegen.d.ts.map +1 -1
- package/dist/Angular/angular-codegen.js +177 -13
- package/dist/Angular/angular-codegen.js.map +1 -1
- package/dist/Angular/join-grid-related-entity-component.d.ts +52 -3
- package/dist/Angular/join-grid-related-entity-component.d.ts.map +1 -1
- package/dist/Angular/join-grid-related-entity-component.js +58 -3
- package/dist/Angular/join-grid-related-entity-component.js.map +1 -1
- package/dist/Angular/related-entity-components.d.ts +99 -42
- package/dist/Angular/related-entity-components.d.ts.map +1 -1
- package/dist/Angular/related-entity-components.js +116 -26
- package/dist/Angular/related-entity-components.js.map +1 -1
- package/dist/Angular/timeline-related-entity-component.d.ts +46 -7
- package/dist/Angular/timeline-related-entity-component.d.ts.map +1 -1
- package/dist/Angular/timeline-related-entity-component.js +64 -7
- package/dist/Angular/timeline-related-entity-component.js.map +1 -1
- package/dist/Angular/user-view-grid-related-entity-component.d.ts +33 -1
- package/dist/Angular/user-view-grid-related-entity-component.d.ts.map +1 -1
- package/dist/Angular/user-view-grid-related-entity-component.js +33 -1
- package/dist/Angular/user-view-grid-related-entity-component.js.map +1 -1
- package/dist/Config/config.d.ts +369 -45
- package/dist/Config/config.d.ts.map +1 -1
- package/dist/Config/config.js +136 -2
- package/dist/Config/config.js.map +1 -1
- package/dist/Config/db-connection.d.ts +17 -3
- package/dist/Config/db-connection.d.ts.map +1 -1
- package/dist/Config/db-connection.js +31 -19
- package/dist/Config/db-connection.js.map +1 -1
- package/dist/Database/dbSchema.d.ts +44 -1
- package/dist/Database/dbSchema.d.ts.map +1 -1
- package/dist/Database/dbSchema.js +44 -1
- package/dist/Database/dbSchema.js.map +1 -1
- package/dist/Database/manage-metadata.d.ts +52 -46
- package/dist/Database/manage-metadata.d.ts.map +1 -1
- package/dist/Database/manage-metadata.js +221 -167
- package/dist/Database/manage-metadata.js.map +1 -1
- package/dist/Database/reorder-columns.d.ts +2 -2
- package/dist/Database/reorder-columns.d.ts.map +1 -1
- package/dist/Database/reorder-columns.js +23 -17
- package/dist/Database/reorder-columns.js.map +1 -1
- package/dist/Database/sql.d.ts +4 -4
- package/dist/Database/sql.d.ts.map +1 -1
- package/dist/Database/sql.js +2 -2
- package/dist/Database/sql.js.map +1 -1
- package/dist/Database/sql_codegen.d.ts +15 -15
- package/dist/Database/sql_codegen.d.ts.map +1 -1
- package/dist/Database/sql_codegen.js +184 -112
- package/dist/Database/sql_codegen.js.map +1 -1
- package/dist/Misc/advanced_generation.js +81 -81
- package/dist/Misc/advanced_generation.js.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.d.ts +5 -5
- package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.js +10 -8
- package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
- package/dist/Misc/graphql_server_codegen.d.ts.map +1 -1
- package/dist/Misc/graphql_server_codegen.js +33 -28
- package/dist/Misc/graphql_server_codegen.js.map +1 -1
- package/dist/Misc/sql_logging.d.ts +2 -2
- package/dist/Misc/sql_logging.d.ts.map +1 -1
- package/dist/Misc/sql_logging.js +4 -3
- package/dist/Misc/sql_logging.js.map +1 -1
- package/dist/Misc/status_logging.d.ts +37 -0
- package/dist/Misc/status_logging.d.ts.map +1 -1
- package/dist/Misc/status_logging.js +145 -3
- package/dist/Misc/status_logging.js.map +1 -1
- package/dist/Misc/system_integrity.d.ts +9 -9
- package/dist/Misc/system_integrity.d.ts.map +1 -1
- package/dist/Misc/system_integrity.js +23 -21
- package/dist/Misc/system_integrity.js.map +1 -1
- package/dist/index.d.ts +45 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -7
- package/dist/index.js.map +1 -1
- package/dist/runCodeGen.d.ts +84 -6
- package/dist/runCodeGen.d.ts.map +1 -1
- package/dist/runCodeGen.js +242 -82
- package/dist/runCodeGen.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as sql from 'mssql';
|
|
2
2
|
export type IntegrityCheckResult = {
|
|
3
3
|
Name: string;
|
|
4
4
|
Success: boolean;
|
|
@@ -7,7 +7,7 @@ export type IntegrityCheckResult = {
|
|
|
7
7
|
export type RunIntegrityCheck = {
|
|
8
8
|
Name: string;
|
|
9
9
|
Enabled: boolean;
|
|
10
|
-
Run: (
|
|
10
|
+
Run: (pool: sql.ConnectionPool) => Promise<IntegrityCheckResult>;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* This class has methods that can check various aspects of a MemberJunction installation's integrity. Code Gen will
|
|
@@ -18,24 +18,24 @@ export declare class SystemIntegrityBase {
|
|
|
18
18
|
/**
|
|
19
19
|
* Runs integrity checks on the system. If onlyEnabled is true, then only checks that are enabled in the configuration
|
|
20
20
|
* will be run. If false, all checks will be run.
|
|
21
|
-
* @param
|
|
21
|
+
* @param pool
|
|
22
22
|
*/
|
|
23
|
-
static RunIntegrityChecks(
|
|
23
|
+
static RunIntegrityChecks(pool: sql.ConnectionPool, onlyEnabled: boolean, logResults?: boolean): Promise<IntegrityCheckResult[]>;
|
|
24
24
|
/**
|
|
25
25
|
* For a given entity, fields should be in sequence starting from 1. There should be no duplicate sequences within a given
|
|
26
26
|
* entity. Invalidation of this could cause downstream issues with the system in particular with execution of Create/Update operations.
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param pool
|
|
29
29
|
* @returns
|
|
30
30
|
*/
|
|
31
|
-
static CheckEntityFieldSequences(
|
|
31
|
+
static CheckEntityFieldSequences(pool: sql.ConnectionPool): Promise<IntegrityCheckResult>;
|
|
32
32
|
/**
|
|
33
33
|
* Checks the sequence of fields for a single entity. This is useful when you want to check a single entity at a time.
|
|
34
|
-
* @param
|
|
34
|
+
* @param pool
|
|
35
35
|
* @param entityName
|
|
36
36
|
* @returns
|
|
37
37
|
*/
|
|
38
|
-
static CheckSinleEntityFieldSequences(
|
|
39
|
-
protected static CheckEntityFieldSequencesInternal(
|
|
38
|
+
static CheckSinleEntityFieldSequences(pool: sql.ConnectionPool, entityName: string): Promise<IntegrityCheckResult>;
|
|
39
|
+
protected static CheckEntityFieldSequencesInternal(pool: sql.ConnectionPool, filter: string): Promise<IntegrityCheckResult>;
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=system_integrity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_integrity.d.ts","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"system_integrity.d.ts","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAK7B,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpE,CAAA;AAED;;;GAGG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAM7B;IAEF;;;;OAIG;WACiB,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAE,OAAc,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAoCnJ;;;;;;OAMG;WACiB,yBAAyB,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAItG;;;;;OAKG;WACiB,8BAA8B,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;qBAIxG,iCAAiC,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA4EpI"}
|
|
@@ -8,18 +8,25 @@ const config_1 = require("../Config/config");
|
|
|
8
8
|
* run the various integrity checks based on configuration options that can be set in the master configuration file.
|
|
9
9
|
*/
|
|
10
10
|
class SystemIntegrityBase {
|
|
11
|
+
static _integrityChecks = [
|
|
12
|
+
{
|
|
13
|
+
Name: 'CheckEntityFieldSequences',
|
|
14
|
+
Enabled: config_1.configInfo.integrityChecks?.enabled && config_1.configInfo.integrityChecks.entityFieldsSequenceCheck,
|
|
15
|
+
Run: SystemIntegrityBase.CheckEntityFieldSequences
|
|
16
|
+
}
|
|
17
|
+
];
|
|
11
18
|
/**
|
|
12
19
|
* Runs integrity checks on the system. If onlyEnabled is true, then only checks that are enabled in the configuration
|
|
13
20
|
* will be run. If false, all checks will be run.
|
|
14
|
-
* @param
|
|
21
|
+
* @param pool
|
|
15
22
|
*/
|
|
16
|
-
static async RunIntegrityChecks(
|
|
23
|
+
static async RunIntegrityChecks(pool, onlyEnabled, logResults = true) {
|
|
17
24
|
let results = [];
|
|
18
25
|
try {
|
|
19
26
|
const runPromises = [];
|
|
20
27
|
for (const check of SystemIntegrityBase._integrityChecks) {
|
|
21
28
|
if (!onlyEnabled || check.Enabled) {
|
|
22
|
-
runPromises.push(check.Run(
|
|
29
|
+
runPromises.push(check.Run(pool));
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
// async parallel run all the checks and then push the results into the results array
|
|
@@ -50,25 +57,26 @@ class SystemIntegrityBase {
|
|
|
50
57
|
* For a given entity, fields should be in sequence starting from 1. There should be no duplicate sequences within a given
|
|
51
58
|
* entity. Invalidation of this could cause downstream issues with the system in particular with execution of Create/Update operations.
|
|
52
59
|
*
|
|
53
|
-
* @param
|
|
60
|
+
* @param pool
|
|
54
61
|
* @returns
|
|
55
62
|
*/
|
|
56
|
-
static async CheckEntityFieldSequences(
|
|
57
|
-
return SystemIntegrityBase.CheckEntityFieldSequencesInternal(
|
|
63
|
+
static async CheckEntityFieldSequences(pool) {
|
|
64
|
+
return SystemIntegrityBase.CheckEntityFieldSequencesInternal(pool, "");
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* Checks the sequence of fields for a single entity. This is useful when you want to check a single entity at a time.
|
|
61
|
-
* @param
|
|
68
|
+
* @param pool
|
|
62
69
|
* @param entityName
|
|
63
70
|
* @returns
|
|
64
71
|
*/
|
|
65
|
-
static async CheckSinleEntityFieldSequences(
|
|
66
|
-
return SystemIntegrityBase.CheckEntityFieldSequencesInternal(
|
|
72
|
+
static async CheckSinleEntityFieldSequences(pool, entityName) {
|
|
73
|
+
return SystemIntegrityBase.CheckEntityFieldSequencesInternal(pool, `WHERE Entity='${entityName}'`);
|
|
67
74
|
}
|
|
68
|
-
static async CheckEntityFieldSequencesInternal(
|
|
75
|
+
static async CheckEntityFieldSequencesInternal(pool, filter) {
|
|
69
76
|
try {
|
|
70
77
|
const sSQL = `SELECT ID, Entity, SchemaName, BaseView, EntityID, Name, Sequence FROM [${(0, config_1.mj_core_schema)()}].[vwEntityFields] ${filter} ORDER BY Entity, Sequence`;
|
|
71
|
-
const
|
|
78
|
+
const resultResult = await pool.request().query(sSQL);
|
|
79
|
+
const result = resultResult.recordset;
|
|
72
80
|
if (!result || result.length === 0) {
|
|
73
81
|
throw new Error("No entity fields found");
|
|
74
82
|
}
|
|
@@ -107,11 +115,12 @@ class SystemIntegrityBase {
|
|
|
107
115
|
// we will do this by SELECT TOP 1 * from the base view
|
|
108
116
|
const entity = row.Entity;
|
|
109
117
|
const sampleSQL = `SELECT TOP 1 * FROM [${row.SchemaName}].[${row.BaseView}]`;
|
|
110
|
-
const
|
|
118
|
+
const sampleResultResult = await pool.request().query(sampleSQL);
|
|
119
|
+
const sampleResult = sampleResultResult.recordset;
|
|
111
120
|
// now check the order of the columns in the result set relative to the
|
|
112
121
|
// fields array
|
|
113
|
-
if (sampleResult && sampleResult.
|
|
114
|
-
const columns = Object.keys(sampleResult
|
|
122
|
+
if (sampleResult && sampleResult.length > 0) {
|
|
123
|
+
const columns = Object.keys(sampleResult[0]);
|
|
115
124
|
let i = 0;
|
|
116
125
|
for (const field of fields) {
|
|
117
126
|
if (columns[i] !== field.Name) {
|
|
@@ -137,11 +146,4 @@ class SystemIntegrityBase {
|
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
148
|
exports.SystemIntegrityBase = SystemIntegrityBase;
|
|
140
|
-
SystemIntegrityBase._integrityChecks = [
|
|
141
|
-
{
|
|
142
|
-
Name: 'CheckEntityFieldSequences',
|
|
143
|
-
Enabled: config_1.configInfo.integrityChecks?.enabled && config_1.configInfo.integrityChecks.entityFieldsSequenceCheck,
|
|
144
|
-
Run: SystemIntegrityBase.CheckEntityFieldSequences
|
|
145
|
-
}
|
|
146
|
-
];
|
|
147
149
|
//# sourceMappingURL=system_integrity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_integrity.js","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":";;;AACA,qDAAuD;AACvD,6CAA8D;AAe9D;;;GAGG;AACH,MAAa,mBAAmB;
|
|
1
|
+
{"version":3,"file":"system_integrity.js","sourceRoot":"","sources":["../../src/Misc/system_integrity.ts"],"names":[],"mappings":";;;AACA,qDAAuD;AACvD,6CAA8D;AAe9D;;;GAGG;AACH,MAAa,mBAAmB;IACpB,MAAM,CAAC,gBAAgB,GAAwB;QACnD;YACI,IAAI,EAAE,2BAA2B;YACjC,OAAO,EAAE,mBAAU,CAAC,eAAe,EAAE,OAAO,IAAI,mBAAU,CAAC,eAAe,CAAC,yBAAyB;YACpG,GAAG,EAAE,mBAAm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,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;QACnF,CAAC;IACL,CAAC;;AAlJL,kDAmJC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main entry point for the MemberJunction CodeGen Library.
|
|
3
|
+
*
|
|
4
|
+
* This package provides comprehensive code generation capabilities for the MemberJunction platform,
|
|
5
|
+
* including:
|
|
6
|
+
*
|
|
7
|
+
* **Configuration Management:**
|
|
8
|
+
* - Configuration file parsing and validation
|
|
9
|
+
* - Database connection management
|
|
10
|
+
*
|
|
11
|
+
* **Database Operations:**
|
|
12
|
+
* - Schema introspection and metadata management
|
|
13
|
+
* - SQL script generation (views, procedures, indexes)
|
|
14
|
+
* - Database schema JSON export
|
|
15
|
+
*
|
|
16
|
+
* **Code Generation:**
|
|
17
|
+
* - TypeScript entity classes with Zod validation
|
|
18
|
+
* - Angular components and forms
|
|
19
|
+
* - GraphQL resolvers and schemas
|
|
20
|
+
* - Action subclasses for business logic
|
|
21
|
+
*
|
|
22
|
+
* **Utilities:**
|
|
23
|
+
* - Status logging and error handling
|
|
24
|
+
* - Command execution
|
|
25
|
+
* - System integrity checks
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { RunCodeGenBase, initializeConfig } from '@memberjunction/codegen-lib';
|
|
30
|
+
*
|
|
31
|
+
* // Initialize configuration
|
|
32
|
+
* const config = initializeConfig(process.cwd());
|
|
33
|
+
*
|
|
34
|
+
* // Run code generation
|
|
35
|
+
* const codeGen = new RunCodeGenBase();
|
|
36
|
+
* await codeGen.Run();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
1
39
|
export { initializeConfig } from './Config/config';
|
|
2
40
|
export * from './Config/config';
|
|
3
41
|
export * from './Config/db-connection';
|
|
4
42
|
export * from './Database/dbSchema';
|
|
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
|
-
export * from './Misc/system_integrity';
|
|
10
43
|
export * from './Database/manage-metadata';
|
|
11
|
-
export * from './Misc/runCommand';
|
|
12
44
|
export * from './Database/sql_codegen';
|
|
13
45
|
export * from './Database/sql';
|
|
14
|
-
export * from './Misc/
|
|
46
|
+
export * from './Misc/entity_subclasses_codegen';
|
|
47
|
+
export * from './Misc/action_subclasses_codegen';
|
|
48
|
+
export * from './Misc/graphql_server_codegen';
|
|
15
49
|
export * from './Angular/angular-codegen';
|
|
16
50
|
export * from './Angular/related-entity-components';
|
|
17
51
|
export * from './Angular/user-view-grid-related-entity-component';
|
|
18
52
|
export * from './Angular/join-grid-related-entity-component';
|
|
19
53
|
export * from './Angular/timeline-related-entity-component';
|
|
54
|
+
export * from './Misc/status_logging';
|
|
55
|
+
export * from './Misc/system_integrity';
|
|
56
|
+
export * from './Misc/runCommand';
|
|
57
|
+
export * from './Misc/util';
|
|
20
58
|
export * from './runCodeGen';
|
|
21
59
|
//# sourceMappingURL=index.d.ts.map
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAGtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAG9B,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAA;AAG7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAC;AACpD,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAG5D,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAG3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Main entry point for the MemberJunction CodeGen Library.
|
|
4
|
+
*
|
|
5
|
+
* This package provides comprehensive code generation capabilities for the MemberJunction platform,
|
|
6
|
+
* including:
|
|
7
|
+
*
|
|
8
|
+
* **Configuration Management:**
|
|
9
|
+
* - Configuration file parsing and validation
|
|
10
|
+
* - Database connection management
|
|
11
|
+
*
|
|
12
|
+
* **Database Operations:**
|
|
13
|
+
* - Schema introspection and metadata management
|
|
14
|
+
* - SQL script generation (views, procedures, indexes)
|
|
15
|
+
* - Database schema JSON export
|
|
16
|
+
*
|
|
17
|
+
* **Code Generation:**
|
|
18
|
+
* - TypeScript entity classes with Zod validation
|
|
19
|
+
* - Angular components and forms
|
|
20
|
+
* - GraphQL resolvers and schemas
|
|
21
|
+
* - Action subclasses for business logic
|
|
22
|
+
*
|
|
23
|
+
* **Utilities:**
|
|
24
|
+
* - Status logging and error handling
|
|
25
|
+
* - Command execution
|
|
26
|
+
* - System integrity checks
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { RunCodeGenBase, initializeConfig } from '@memberjunction/codegen-lib';
|
|
31
|
+
*
|
|
32
|
+
* // Initialize configuration
|
|
33
|
+
* const config = initializeConfig(process.cwd());
|
|
34
|
+
*
|
|
35
|
+
* // Run code generation
|
|
36
|
+
* const codeGen = new RunCodeGenBase();
|
|
37
|
+
* await codeGen.Run();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
2
40
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
41
|
if (k2 === undefined) k2 = k;
|
|
4
42
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -15,25 +53,31 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
53
|
};
|
|
16
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
55
|
exports.initializeConfig = void 0;
|
|
56
|
+
// Configuration exports
|
|
18
57
|
var config_1 = require("./Config/config");
|
|
19
58
|
Object.defineProperty(exports, "initializeConfig", { enumerable: true, get: function () { return config_1.initializeConfig; } });
|
|
20
59
|
__exportStar(require("./Config/config"), exports);
|
|
21
60
|
__exportStar(require("./Config/db-connection"), exports);
|
|
61
|
+
// Database exports
|
|
22
62
|
__exportStar(require("./Database/dbSchema"), exports);
|
|
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
|
-
__exportStar(require("./Misc/system_integrity"), exports);
|
|
28
63
|
__exportStar(require("./Database/manage-metadata"), exports);
|
|
29
|
-
__exportStar(require("./Misc/runCommand"), exports);
|
|
30
64
|
__exportStar(require("./Database/sql_codegen"), exports);
|
|
31
65
|
__exportStar(require("./Database/sql"), exports);
|
|
32
|
-
|
|
66
|
+
// Code generation exports
|
|
67
|
+
__exportStar(require("./Misc/entity_subclasses_codegen"), exports);
|
|
68
|
+
__exportStar(require("./Misc/action_subclasses_codegen"), exports);
|
|
69
|
+
__exportStar(require("./Misc/graphql_server_codegen"), exports);
|
|
70
|
+
// Angular exports
|
|
33
71
|
__exportStar(require("./Angular/angular-codegen"), exports);
|
|
34
72
|
__exportStar(require("./Angular/related-entity-components"), exports);
|
|
35
73
|
__exportStar(require("./Angular/user-view-grid-related-entity-component"), exports);
|
|
36
74
|
__exportStar(require("./Angular/join-grid-related-entity-component"), exports);
|
|
37
75
|
__exportStar(require("./Angular/timeline-related-entity-component"), exports);
|
|
76
|
+
// Utility exports
|
|
77
|
+
__exportStar(require("./Misc/status_logging"), exports);
|
|
78
|
+
__exportStar(require("./Misc/system_integrity"), exports);
|
|
79
|
+
__exportStar(require("./Misc/runCommand"), exports);
|
|
80
|
+
__exportStar(require("./Misc/util"), exports);
|
|
81
|
+
// Main runner
|
|
38
82
|
__exportStar(require("./runCodeGen"), exports);
|
|
39
83
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;;;;;;;;;;;;;;;;;AAEH,wBAAwB;AACxB,0CAAkD;AAAzC,0GAAA,gBAAgB,OAAA;AACzB,kDAA+B;AAC/B,yDAAsC;AAEtC,mBAAmB;AACnB,sDAAmC;AACnC,6DAA0C;AAC1C,yDAAsC;AACtC,iDAA8B;AAE9B,0BAA0B;AAC1B,mEAAgD;AAChD,mEAAiD;AACjD,gEAA6C;AAE7C,kBAAkB;AAClB,4DAAyC;AACzC,sEAAoD;AACpD,oFAAkE;AAClE,+EAA6D;AAC7D,8EAA4D;AAE5D,kBAAkB;AAClB,wDAAqC;AACrC,0DAAwC;AACxC,oDAAiC;AACjC,8CAA2B;AAE3B,cAAc;AACd,+CAA4B"}
|
package/dist/runCodeGen.d.ts
CHANGED
|
@@ -1,19 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main orchestrator for the MemberJunction code generation process.
|
|
3
|
+
* Coordinates all aspects of code generation including database schema analysis,
|
|
4
|
+
* metadata management, SQL generation, TypeScript entities, Angular components,
|
|
5
|
+
* GraphQL resolvers, and more.
|
|
6
|
+
*/
|
|
1
7
|
import { SQLServerDataProvider } from '@memberjunction/sqlserver-dataprovider';
|
|
2
8
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
9
|
+
* Main orchestrator class for the MemberJunction code generation process.
|
|
10
|
+
*
|
|
11
|
+
* This class coordinates a comprehensive code generation pipeline that transforms
|
|
12
|
+
* database schemas into a complete, type-safe, full-stack application. The process includes:
|
|
13
|
+
*
|
|
14
|
+
* **Pipeline Steps:**
|
|
15
|
+
* 1. **Database Setup** - Initialize connections and metadata
|
|
16
|
+
* 2. **Metadata Management** - Analyze schema changes and update metadata
|
|
17
|
+
* 3. **SQL Generation** - Create views, procedures, and indexes
|
|
18
|
+
* 4. **TypeScript Entities** - Generate entity classes with validation
|
|
19
|
+
* 5. **Angular Components** - Create forms and UI components
|
|
20
|
+
* 6. **GraphQL Resolvers** - Generate API endpoints
|
|
21
|
+
* 7. **Action Classes** - Create business logic containers
|
|
22
|
+
* 8. **Documentation** - Generate schema JSON for AI/documentation
|
|
23
|
+
* 9. **Post-processing** - Run commands and integrity checks
|
|
24
|
+
*
|
|
25
|
+
* **Customization:**
|
|
26
|
+
* You can sub-class this class and override specific methods to customize
|
|
27
|
+
* the code generation process for your specific needs.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const codeGen = new RunCodeGenBase();
|
|
32
|
+
* await codeGen.Run(); // Full generation
|
|
33
|
+
* await codeGen.Run(true); // Skip database operations
|
|
34
|
+
* ```
|
|
5
35
|
*/
|
|
6
36
|
export declare class RunCodeGenBase {
|
|
7
37
|
/**
|
|
8
|
-
*
|
|
38
|
+
* Sets up the SQL Server data source and initializes the MemberJunction core metadata.
|
|
39
|
+
* This method establishes the database connection pool and configures the data provider
|
|
40
|
+
* that will be used throughout the code generation process.
|
|
41
|
+
*
|
|
42
|
+
* Override this method to customize the data source setup process for different
|
|
43
|
+
* database providers or connection configurations.
|
|
44
|
+
*
|
|
45
|
+
* @returns Promise resolving to the configured SQLServerDataProvider instance
|
|
46
|
+
* @throws Error if connection setup fails
|
|
9
47
|
*/
|
|
10
48
|
setupDataSource(): Promise<SQLServerDataProvider>;
|
|
11
49
|
/**
|
|
12
|
-
* Main entry point
|
|
13
|
-
*
|
|
14
|
-
*
|
|
50
|
+
* Main entry point for the complete code generation process.
|
|
51
|
+
*
|
|
52
|
+
* Orchestrates the entire pipeline from database schema analysis to final code output.
|
|
53
|
+
* The process is highly configurable through the configuration file and can be
|
|
54
|
+
* partially skipped for faster iteration during development.
|
|
55
|
+
*
|
|
56
|
+
* **Process Flow:**
|
|
57
|
+
* 1. Initialize data sources and user context
|
|
58
|
+
* 2. Execute pre-generation commands and scripts
|
|
59
|
+
* 3. Manage metadata and schema changes
|
|
60
|
+
* 4. Generate SQL objects (views, procedures, indexes)
|
|
61
|
+
* 5. Generate TypeScript entity classes
|
|
62
|
+
* 6. Generate Angular UI components
|
|
63
|
+
* 7. Generate GraphQL API resolvers
|
|
64
|
+
* 8. Generate Action business logic classes
|
|
65
|
+
* 9. Create documentation JSON
|
|
66
|
+
* 10. Run integrity checks
|
|
67
|
+
* 11. Execute post-generation commands
|
|
68
|
+
*
|
|
69
|
+
* @param skipDatabaseGeneration If true, skips all database-related operations
|
|
70
|
+
* (metadata management, SQL generation). Useful for faster UI-only regeneration.
|
|
71
|
+
* @throws Error if any critical step fails
|
|
72
|
+
* @returns Promise that resolves when generation is complete
|
|
15
73
|
*/
|
|
16
74
|
Run(skipDatabaseGeneration?: boolean): Promise<void>;
|
|
17
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Convenience function to run the MemberJunction code generation process.
|
|
78
|
+
* Creates a new instance of RunCodeGenBase and executes the full generation pipeline.
|
|
79
|
+
*
|
|
80
|
+
* This is the recommended way to trigger code generation from external scripts
|
|
81
|
+
* or applications.
|
|
82
|
+
*
|
|
83
|
+
* @param skipDatabaseGeneration Whether to skip database-related operations
|
|
84
|
+
* @returns Promise that resolves when generation is complete
|
|
85
|
+
* @throws Error if generation fails
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* // Full generation
|
|
90
|
+
* await runMemberJunctionCodeGeneration();
|
|
91
|
+
*
|
|
92
|
+
* // Skip database operations for faster UI generation
|
|
93
|
+
* await runMemberJunctionCodeGeneration(true);
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
18
96
|
export declare function runMemberJunctionCodeGeneration(skipDatabaseGeneration?: boolean): Promise<void>;
|
|
19
97
|
//# sourceMappingURL=runCodeGen.d.ts.map
|
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":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,qBAAqB,EAAmC,MAAM,wCAAwC,CAAC;AAoBhH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,cAAc;IACzB;;;;;;;;;;OAUG;IACU,eAAe,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAY9D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACU,GAAG,CAAC,sBAAsB,GAAE,OAAe;CAoUzD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,+BAA+B,CAAC,sBAAsB,GAAE,OAAe,iBAG5F"}
|