@memberjunction/codegen-lib 6.1.4 → 6.2.0-edge.1
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 +6 -0
- package/dist/Angular/angular-codegen.d.ts.map +1 -1
- package/dist/Angular/angular-codegen.js +26 -14
- package/dist/Angular/angular-codegen.js.map +1 -1
- package/dist/Config/config.d.ts +45 -2
- package/dist/Config/config.d.ts.map +1 -1
- package/dist/Config/config.js +116 -39
- package/dist/Config/config.js.map +1 -1
- package/dist/Config/db-connection.d.ts +4 -0
- package/dist/Config/db-connection.d.ts.map +1 -1
- package/dist/Config/db-connection.js +11 -3
- package/dist/Config/db-connection.js.map +1 -1
- package/dist/Config/pg-connection.d.ts +2 -0
- package/dist/Config/pg-connection.d.ts.map +1 -1
- package/dist/Config/pg-connection.js +5 -1
- package/dist/Config/pg-connection.js.map +1 -1
- package/dist/Config/schema-output.d.ts +8 -0
- package/dist/Config/schema-output.d.ts.map +1 -1
- package/dist/Config/schema-output.js +19 -7
- package/dist/Config/schema-output.js.map +1 -1
- package/dist/Database/__tests__/exclude-schema-permissions.test.js +3 -3
- package/dist/Database/codeGenDatabaseProvider.d.ts +40 -1
- package/dist/Database/codeGenDatabaseProvider.d.ts.map +1 -1
- package/dist/Database/codeGenDatabaseProvider.js +65 -7
- package/dist/Database/codeGenDatabaseProvider.js.map +1 -1
- package/dist/Database/dbSchema.d.ts +4 -0
- package/dist/Database/dbSchema.d.ts.map +1 -1
- package/dist/Database/dbSchema.js +17 -9
- package/dist/Database/dbSchema.js.map +1 -1
- package/dist/Database/entity-field-change-tracking.d.ts +4 -0
- package/dist/Database/entity-field-change-tracking.d.ts.map +1 -1
- package/dist/Database/entity-field-change-tracking.js +12 -4
- package/dist/Database/entity-field-change-tracking.js.map +1 -1
- package/dist/Database/exclude-tables.d.ts +2 -0
- package/dist/Database/exclude-tables.d.ts.map +1 -1
- package/dist/Database/exclude-tables.js +5 -1
- package/dist/Database/exclude-tables.js.map +1 -1
- package/dist/Database/field-metadata-lock.d.ts +8 -6
- package/dist/Database/field-metadata-lock.d.ts.map +1 -1
- package/dist/Database/field-metadata-lock.js +29 -25
- package/dist/Database/field-metadata-lock.js.map +1 -1
- package/dist/Database/heal-schema-params.d.ts +14 -2
- package/dist/Database/heal-schema-params.d.ts.map +1 -1
- package/dist/Database/heal-schema-params.js +21 -5
- package/dist/Database/heal-schema-params.js.map +1 -1
- package/dist/Database/manage-metadata.d.ts +227 -4
- package/dist/Database/manage-metadata.d.ts.map +1 -1
- package/dist/Database/manage-metadata.js +883 -384
- package/dist/Database/manage-metadata.js.map +1 -1
- package/dist/Database/materializationAnalysis.d.ts +61 -2
- package/dist/Database/materializationAnalysis.d.ts.map +1 -1
- package/dist/Database/materializationAnalysis.js +43 -23
- package/dist/Database/materializationAnalysis.js.map +1 -1
- package/dist/Database/materializationBroadRender.d.ts +5 -3
- package/dist/Database/materializationBroadRender.d.ts.map +1 -1
- package/dist/Database/materializationBroadRender.js +17 -13
- package/dist/Database/materializationBroadRender.js.map +1 -1
- package/dist/Database/materializationDrift.d.ts +2 -0
- package/dist/Database/materializationDrift.d.ts.map +1 -1
- package/dist/Database/materializationDrift.js +5 -1
- package/dist/Database/materializationDrift.js.map +1 -1
- package/dist/Database/materializationParamClassifier.d.ts +17 -2
- package/dist/Database/materializationParamClassifier.d.ts.map +1 -1
- package/dist/Database/materializationParamClassifier.js +22 -10
- package/dist/Database/materializationParamClassifier.js.map +1 -1
- package/dist/Database/materializationParamVerifier.d.ts +2 -0
- package/dist/Database/materializationParamVerifier.d.ts.map +1 -1
- package/dist/Database/materializationParamVerifier.js +18 -14
- package/dist/Database/materializationParamVerifier.js.map +1 -1
- package/dist/Database/materializationSqlAst.d.ts +19 -1
- package/dist/Database/materializationSqlAst.d.ts.map +1 -1
- package/dist/Database/materializationSqlAst.js +53 -17
- package/dist/Database/materializationSqlAst.js.map +1 -1
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts +18 -0
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.d.ts.map +1 -1
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js +76 -30
- package/dist/Database/providers/postgresql/PostgreSQLCodeGenProvider.js.map +1 -1
- package/dist/Database/providers/postgresql/metadataSupportObjects.d.ts +2 -0
- package/dist/Database/providers/postgresql/metadataSupportObjects.d.ts.map +1 -1
- package/dist/Database/providers/postgresql/metadataSupportObjects.js +5 -1
- package/dist/Database/providers/postgresql/metadataSupportObjects.js.map +1 -1
- package/dist/Database/providers/postgresql/viewDependencyCapture.d.ts +10 -0
- package/dist/Database/providers/postgresql/viewDependencyCapture.d.ts.map +1 -1
- package/dist/Database/providers/postgresql/viewDependencyCapture.js +25 -5
- package/dist/Database/providers/postgresql/viewDependencyCapture.js.map +1 -1
- package/dist/Database/providers/postgresql/viewFallback.d.ts +11 -7
- package/dist/Database/providers/postgresql/viewFallback.d.ts.map +1 -1
- package/dist/Database/providers/postgresql/viewFallback.js +18 -12
- package/dist/Database/providers/postgresql/viewFallback.js.map +1 -1
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts +9 -0
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.d.ts.map +1 -1
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js +27 -13
- package/dist/Database/providers/sqlserver/SQLServerCodeGenProvider.js.map +1 -1
- package/dist/Database/reconcileFieldLevelSecurity.d.ts +2 -0
- package/dist/Database/reconcileFieldLevelSecurity.d.ts.map +1 -1
- package/dist/Database/reconcileFieldLevelSecurity.js +5 -1
- package/dist/Database/reconcileFieldLevelSecurity.js.map +1 -1
- package/dist/Database/reorder-columns.d.ts +2 -0
- package/dist/Database/reorder-columns.d.ts.map +1 -1
- package/dist/Database/reorder-columns.js +5 -1
- package/dist/Database/reorder-columns.js.map +1 -1
- package/dist/Database/schema-filters.d.ts +6 -0
- package/dist/Database/schema-filters.d.ts.map +1 -1
- package/dist/Database/schema-filters.js +17 -5
- package/dist/Database/schema-filters.js.map +1 -1
- package/dist/Database/schema-scope.d.ts +4 -0
- package/dist/Database/schema-scope.d.ts.map +1 -1
- package/dist/Database/schema-scope.js +13 -5
- package/dist/Database/schema-scope.js.map +1 -1
- package/dist/Database/search-guardrails.d.ts +52 -0
- package/dist/Database/search-guardrails.d.ts.map +1 -1
- package/dist/Database/search-guardrails.js +77 -18
- package/dist/Database/search-guardrails.js.map +1 -1
- package/dist/Database/sql.d.ts +20 -0
- package/dist/Database/sql.d.ts.map +1 -1
- package/dist/Database/sql.js +72 -32
- package/dist/Database/sql.js.map +1 -1
- package/dist/Database/sql_codegen.d.ts +92 -0
- package/dist/Database/sql_codegen.d.ts.map +1 -1
- package/dist/Database/sql_codegen.js +197 -113
- package/dist/Database/sql_codegen.js.map +1 -1
- package/dist/EntityNameScanner/EntityNameScanner.d.ts +16 -0
- package/dist/EntityNameScanner/EntityNameScanner.d.ts.map +1 -1
- package/dist/EntityNameScanner/EntityNameScanner.js +47 -15
- package/dist/EntityNameScanner/EntityNameScanner.js.map +1 -1
- package/dist/EntityNameScanner/HtmlEntityNameScanner.d.ts +6 -0
- package/dist/EntityNameScanner/HtmlEntityNameScanner.d.ts.map +1 -1
- package/dist/EntityNameScanner/HtmlEntityNameScanner.js +19 -7
- package/dist/EntityNameScanner/HtmlEntityNameScanner.js.map +1 -1
- package/dist/EntityNameScanner/MetadataNameScanner.d.ts +6 -0
- package/dist/EntityNameScanner/MetadataNameScanner.d.ts.map +1 -1
- package/dist/EntityNameScanner/MetadataNameScanner.js +19 -7
- package/dist/EntityNameScanner/MetadataNameScanner.js.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts +6 -0
- package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts.map +1 -1
- package/dist/Manifest/GenerateClassRegistrationsManifest.js +16 -4
- package/dist/Manifest/GenerateClassRegistrationsManifest.js.map +1 -1
- package/dist/Misc/action_subclasses_codegen.d.ts +4 -0
- package/dist/Misc/action_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/action_subclasses_codegen.js +11 -3
- package/dist/Misc/action_subclasses_codegen.js.map +1 -1
- package/dist/Misc/advanced_generation.d.ts +48 -2
- package/dist/Misc/advanced_generation.d.ts.map +1 -1
- package/dist/Misc/advanced_generation.js +53 -15
- package/dist/Misc/advanced_generation.js.map +1 -1
- package/dist/Misc/codegen-reporter.d.ts +53 -0
- package/dist/Misc/codegen-reporter.d.ts.map +1 -1
- package/dist/Misc/codegen-reporter.js +106 -22
- package/dist/Misc/codegen-reporter.js.map +1 -1
- package/dist/Misc/createNewUser.d.ts +6 -0
- package/dist/Misc/createNewUser.d.ts.map +1 -1
- package/dist/Misc/createNewUser.js +5 -1
- package/dist/Misc/createNewUser.js.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.d.ts +8 -0
- package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
- package/dist/Misc/entity_subclasses_codegen.js +52 -36
- package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
- package/dist/Misc/externalTypeMapping.d.ts +2 -0
- package/dist/Misc/externalTypeMapping.d.ts.map +1 -1
- package/dist/Misc/externalTypeMapping.js +5 -1
- package/dist/Misc/externalTypeMapping.js.map +1 -1
- package/dist/Misc/file-write.d.ts +2 -0
- package/dist/Misc/file-write.d.ts.map +1 -1
- package/dist/Misc/file-write.js +5 -1
- package/dist/Misc/file-write.js.map +1 -1
- package/dist/Misc/graphql_server_codegen.d.ts +14 -0
- package/dist/Misc/graphql_server_codegen.d.ts.map +1 -1
- package/dist/Misc/graphql_server_codegen.js +51 -27
- package/dist/Misc/graphql_server_codegen.js.map +1 -1
- package/dist/Misc/remote_operations_codegen.d.ts +12 -0
- package/dist/Misc/remote_operations_codegen.d.ts.map +1 -1
- package/dist/Misc/remote_operations_codegen.js +21 -5
- package/dist/Misc/remote_operations_codegen.js.map +1 -1
- package/dist/Misc/runCommand.d.ts +6 -0
- package/dist/Misc/runCommand.d.ts.map +1 -1
- package/dist/Misc/runCommand.js +16 -4
- package/dist/Misc/runCommand.js.map +1 -1
- package/dist/Misc/schema-emit.d.ts +28 -0
- package/dist/Misc/schema-emit.d.ts.map +1 -1
- package/dist/Misc/schema-emit.js +75 -23
- package/dist/Misc/schema-emit.js.map +1 -1
- package/dist/Misc/sql_logging.d.ts +44 -11
- package/dist/Misc/sql_logging.d.ts.map +1 -1
- package/dist/Misc/sql_logging.js +132 -51
- package/dist/Misc/sql_logging.js.map +1 -1
- package/dist/Misc/sql_text.d.ts +22 -0
- package/dist/Misc/sql_text.d.ts.map +1 -0
- package/dist/Misc/sql_text.js +46 -0
- package/dist/Misc/sql_text.js.map +1 -0
- package/dist/Misc/status_logging.d.ts +36 -0
- package/dist/Misc/status_logging.d.ts.map +1 -1
- package/dist/Misc/status_logging.js +95 -23
- package/dist/Misc/status_logging.js.map +1 -1
- package/dist/Misc/system_integrity.js +4 -4
- package/dist/Misc/system_integrity.js.map +1 -1
- package/dist/Misc/temp_batch_file.d.ts +12 -0
- package/dist/Misc/temp_batch_file.d.ts.map +1 -1
- package/dist/Misc/temp_batch_file.js +35 -11
- package/dist/Misc/temp_batch_file.js.map +1 -1
- package/dist/Misc/util.d.ts +33 -0
- package/dist/Misc/util.d.ts.map +1 -1
- package/dist/Misc/util.js +53 -13
- package/dist/Misc/util.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.d.ts +11 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +9 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/runCodeGen.d.ts +6 -0
- package/dist/runCodeGen.d.ts.map +1 -1
- package/dist/runCodeGen.js +150 -138
- package/dist/runCodeGen.js.map +1 -1
- package/package.json +29 -29
package/dist/Misc/sql_logging.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { configInfo,
|
|
1
|
+
import { configInfo, MjCoreSchema, DbPlatform, currentWorkingDirectory } from "../Config/config.js";
|
|
2
2
|
import { logError, logStatus } from "./status_logging.js";
|
|
3
|
+
import { EndsWithBatchSeparatorLine, TrimTrailingStatementTerminators } from './sql_text.js';
|
|
3
4
|
import * as fs from 'fs';
|
|
4
5
|
import path from 'path';
|
|
5
6
|
const MJ_DEFAULT_SQL_OUTPUT_RE = /(^|\/|\\)migrations[/\\]v\d+[/\\]?$/i;
|
|
@@ -7,10 +8,14 @@ const MJ_DEFAULT_SQL_OUTPUT_RE = /(^|\/|\\)migrations[/\\]v\d+[/\\]?$/i;
|
|
|
7
8
|
* True when `folderPath` is the CodeGenLib / MJ-host default (`./migrations/v5` etc.),
|
|
8
9
|
* not an Open App `migrations/codegen` tree.
|
|
9
10
|
*/
|
|
10
|
-
export function
|
|
11
|
+
export function IsMjDefaultSqlOutputPath(folderPath) {
|
|
11
12
|
const n = folderPath.replace(/\\/g, '/').replace(/\/+$/, '');
|
|
12
13
|
return MJ_DEFAULT_SQL_OUTPUT_RE.test(n) || n === './migrations/v5' || n === '../../migrations/v5';
|
|
13
14
|
}
|
|
15
|
+
/** @deprecated Use {@link IsMjDefaultSqlOutputPath}. */
|
|
16
|
+
export function isMjDefaultSqlOutputPath(folderPath) {
|
|
17
|
+
return IsMjDefaultSqlOutputPath(folderPath);
|
|
18
|
+
}
|
|
14
19
|
/**
|
|
15
20
|
* Where CodeGen writes `CodeGen_Run_*.sql` (EntityField INSERTs and other metadata SQL).
|
|
16
21
|
*
|
|
@@ -22,46 +27,50 @@ export function isMjDefaultSqlOutputPath(folderPath) {
|
|
|
22
27
|
* MJ monorepo cwd + `includeSchemas` listing a non-core schema: throw. Run
|
|
23
28
|
* CodeGen from the app directory.
|
|
24
29
|
*/
|
|
25
|
-
export function
|
|
26
|
-
const cwd = path.resolve(args.
|
|
27
|
-
const core = (args.
|
|
28
|
-
const include = (args.
|
|
30
|
+
export function ResolveSQLOutputFolder(args) {
|
|
31
|
+
const cwd = path.resolve(args.Cwd);
|
|
32
|
+
const core = (args.CoreSchema || '__mj').toLowerCase();
|
|
33
|
+
const include = (args.IncludeSchemas ?? []).map(s => s.toLowerCase());
|
|
29
34
|
const generatingAppSchemas = include.some(s => s !== core);
|
|
30
|
-
if (args.
|
|
31
|
-
const resolved = path.resolve(cwd, args.
|
|
32
|
-
if (args.
|
|
35
|
+
if (args.SqlOutputDirFlag) {
|
|
36
|
+
const resolved = path.resolve(cwd, args.SqlOutputDirFlag);
|
|
37
|
+
if (args.HasMjAppJson && IsMjDefaultSqlOutputPath(resolved)) {
|
|
33
38
|
throw new Error(`CodeGen --sql-output-dir resolves to an MJ host migrations tree (${resolved}). ` +
|
|
34
39
|
`Open App metadata SQL must go to the app's migrations/codegen. ` +
|
|
35
40
|
`Run from the app cwd (mj-app.json) without this flag, or pass the app codegen folder.`);
|
|
36
41
|
}
|
|
37
42
|
return resolved;
|
|
38
43
|
}
|
|
39
|
-
if (args.
|
|
40
|
-
const configured = args.
|
|
41
|
-
if (configured && !
|
|
44
|
+
if (args.HasMjAppJson) {
|
|
45
|
+
const configured = args.ConfiguredFolderPath;
|
|
46
|
+
if (configured && !IsMjDefaultSqlOutputPath(configured)) {
|
|
42
47
|
return path.resolve(cwd, configured);
|
|
43
48
|
}
|
|
44
49
|
return path.join(cwd, 'migrations', 'codegen');
|
|
45
50
|
}
|
|
46
|
-
if (args.
|
|
51
|
+
if (args.IsMjMonorepo && generatingAppSchemas) {
|
|
47
52
|
throw new Error(`CodeGen SQLOutput would write Open App metadata SQL into the MJ repo (${cwd}). ` +
|
|
48
53
|
`Run \`mj codegen\` from the Open App directory (a cwd that contains mj-app.json), not from MJ. ` +
|
|
49
|
-
`includeSchemas=${(args.
|
|
54
|
+
`includeSchemas=${(args.IncludeSchemas ?? []).join(',') || '(empty)'}`);
|
|
50
55
|
}
|
|
51
|
-
const folder = args.
|
|
56
|
+
const folder = args.ConfiguredFolderPath ?? './migrations/v5/';
|
|
52
57
|
return path.resolve(cwd, folder);
|
|
53
58
|
}
|
|
59
|
+
/** @deprecated Use {@link ResolveSQLOutputFolder}. */
|
|
60
|
+
export function resolveSQLOutputFolder(args) {
|
|
61
|
+
return ResolveSQLOutputFolder(args);
|
|
62
|
+
}
|
|
54
63
|
/**
|
|
55
64
|
* Utility class for logging SQL to a run file that can be fresh for each run or appended to depending on the settings in the configuration
|
|
56
65
|
*/
|
|
57
66
|
export class SQLLogging {
|
|
58
|
-
static { this.
|
|
59
|
-
static { this.
|
|
67
|
+
static { this._sQLLoggingFilePath = ''; }
|
|
68
|
+
static { this._omitRecurringScriptsFromLog = true; }
|
|
60
69
|
static get SQLLoggingFilePath() {
|
|
61
|
-
return SQLLogging.
|
|
70
|
+
return SQLLogging._sQLLoggingFilePath;
|
|
62
71
|
}
|
|
63
72
|
static get OmitRecurringScriptsFromLog() {
|
|
64
|
-
return SQLLogging.
|
|
73
|
+
return SQLLogging._omitRecurringScriptsFromLog;
|
|
65
74
|
}
|
|
66
75
|
/**
|
|
67
76
|
* Rewrites the migrations-root segment of a path to `migrations-pg`.
|
|
@@ -87,7 +96,7 @@ export class SQLLogging {
|
|
|
87
96
|
*
|
|
88
97
|
* Public so the routing can be unit-tested without a CodeGen run.
|
|
89
98
|
*/
|
|
90
|
-
static
|
|
99
|
+
static RedirectToPGMigrations(folderPath) {
|
|
91
100
|
// Split on either separator so a Windows-style path is handled without normalizing the
|
|
92
101
|
// whole string (which would rewrite the caller's separators as a side effect).
|
|
93
102
|
const segments = folderPath.split(/([\\/])/);
|
|
@@ -110,57 +119,77 @@ export class SQLLogging {
|
|
|
110
119
|
}
|
|
111
120
|
return folderPath;
|
|
112
121
|
}
|
|
113
|
-
|
|
122
|
+
/** @deprecated Use {@link RedirectToPGMigrations}. */
|
|
123
|
+
static redirectToPGMigrations(folderPath) {
|
|
124
|
+
return this.RedirectToPGMigrations(folderPath);
|
|
125
|
+
}
|
|
126
|
+
static InitSQLLogging() {
|
|
114
127
|
const config = configInfo.SQLOutput;
|
|
115
128
|
if (!config) {
|
|
116
129
|
throw new Error("SQLOutput config is required to enable metadata logging");
|
|
117
130
|
}
|
|
118
|
-
SQLLogging.
|
|
131
|
+
SQLLogging._omitRecurringScriptsFromLog = config.omitRecurringScriptsFromLog;
|
|
119
132
|
if (!SQLLogging.SQLLoggingFilePath) {
|
|
120
133
|
if (!config.enabled)
|
|
121
134
|
return;
|
|
122
135
|
const cwd = currentWorkingDirectory || process.cwd();
|
|
123
|
-
const coreSchema =
|
|
124
|
-
let folderPath =
|
|
125
|
-
cwd,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
coreSchema,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
const coreSchema = MjCoreSchema();
|
|
137
|
+
let folderPath = ResolveSQLOutputFolder({
|
|
138
|
+
Cwd: cwd,
|
|
139
|
+
ConfiguredFolderPath: config.folderPath,
|
|
140
|
+
IncludeSchemas: configInfo.includeSchemas,
|
|
141
|
+
CoreSchema: coreSchema,
|
|
142
|
+
SqlOutputDirFlag: SQLLogging.sqlOutputDirFlag,
|
|
143
|
+
HasMjAppJson: fs.existsSync(path.join(cwd, 'mj-app.json')),
|
|
144
|
+
IsMjMonorepo: fs.existsSync(path.join(cwd, 'packages', 'CodeGenLib')) ||
|
|
132
145
|
fs.existsSync(path.join(cwd, 'packages', 'MJCLI')),
|
|
133
146
|
});
|
|
134
|
-
if (
|
|
147
|
+
if (DbPlatform() === 'postgresql') {
|
|
135
148
|
folderPath = SQLLogging.redirectToPGMigrations(folderPath);
|
|
136
149
|
}
|
|
137
150
|
if (!fs.existsSync(folderPath)) {
|
|
138
151
|
fs.mkdirSync(folderPath, { recursive: true });
|
|
139
152
|
}
|
|
140
153
|
const fileName = config.fileName || this.createFileName();
|
|
141
|
-
SQLLogging.
|
|
154
|
+
SQLLogging._sQLLoggingFilePath = path.join(folderPath, fileName);
|
|
142
155
|
if (!config.appendToFile || !fs.existsSync(SQLLogging.SQLLoggingFilePath)) {
|
|
143
156
|
fs.writeFileSync(SQLLogging.SQLLoggingFilePath, '');
|
|
144
157
|
}
|
|
145
158
|
logStatus(`Metadata logging enabled. File path: ${SQLLogging.SQLLoggingFilePath}`);
|
|
146
159
|
}
|
|
147
160
|
}
|
|
161
|
+
/** @deprecated Use {@link InitSQLLogging}. */
|
|
162
|
+
static initSQLLogging() {
|
|
163
|
+
return this.InitSQLLogging();
|
|
164
|
+
}
|
|
148
165
|
/**
|
|
149
166
|
* The batch separator for the active platform: `GO` on SQL Server, none on PostgreSQL. Used as the
|
|
150
167
|
* default for callers that do not pass the provider's separator, so a PostgreSQL capture can never
|
|
151
168
|
* pick up a literal `GO` from a forgotten argument.
|
|
152
169
|
*/
|
|
170
|
+
static DefaultBatchSeparator() {
|
|
171
|
+
return DbPlatform() === 'postgresql' ? '' : 'GO';
|
|
172
|
+
}
|
|
173
|
+
/** @deprecated Use {@link DefaultBatchSeparator}. */
|
|
153
174
|
static defaultBatchSeparator() {
|
|
154
|
-
return
|
|
175
|
+
return this.DefaultBatchSeparator();
|
|
155
176
|
}
|
|
156
177
|
/** Test hook — SQLLogging is a process-wide singleton. */
|
|
157
|
-
static
|
|
158
|
-
SQLLogging.
|
|
178
|
+
static ResetForTests() {
|
|
179
|
+
SQLLogging._sQLLoggingFilePath = '';
|
|
159
180
|
SQLLogging.sqlOutputDirFlag = undefined;
|
|
160
181
|
}
|
|
182
|
+
/** @deprecated Use {@link ResetForTests}. */
|
|
183
|
+
static resetForTests() {
|
|
184
|
+
return this.ResetForTests();
|
|
185
|
+
}
|
|
161
186
|
/** Test hook — sets the active capture file path for testing. */
|
|
187
|
+
static SetFilePathForTesting(filePath) {
|
|
188
|
+
SQLLogging._sQLLoggingFilePath = filePath;
|
|
189
|
+
}
|
|
190
|
+
/** @deprecated Use {@link SetFilePathForTesting}. */
|
|
162
191
|
static setFilePathForTesting(filePath) {
|
|
163
|
-
|
|
192
|
+
return this.SetFilePathForTesting(filePath);
|
|
164
193
|
}
|
|
165
194
|
/**
|
|
166
195
|
* Test hook — turns SQL capture off for the process: disables `SQLOutput` so
|
|
@@ -168,22 +197,26 @@ export class SQLLogging {
|
|
|
168
197
|
* file open, and closes any capture file already open so nothing is written meanwhile. Returns a
|
|
169
198
|
* function that restores both; call it from `afterAll`.
|
|
170
199
|
*/
|
|
171
|
-
static
|
|
200
|
+
static SuppressOutputForTests() {
|
|
172
201
|
const output = configInfo.SQLOutput;
|
|
173
202
|
const previousEnabled = output?.enabled;
|
|
174
|
-
const previousPath = SQLLogging.
|
|
203
|
+
const previousPath = SQLLogging._sQLLoggingFilePath;
|
|
175
204
|
if (output) {
|
|
176
205
|
output.enabled = false;
|
|
177
206
|
}
|
|
178
|
-
SQLLogging.
|
|
207
|
+
SQLLogging._sQLLoggingFilePath = '';
|
|
179
208
|
return () => {
|
|
180
209
|
if (output && previousEnabled !== undefined) {
|
|
181
210
|
output.enabled = previousEnabled;
|
|
182
211
|
}
|
|
183
|
-
SQLLogging.
|
|
212
|
+
SQLLogging._sQLLoggingFilePath = previousPath;
|
|
184
213
|
};
|
|
185
214
|
}
|
|
186
|
-
|
|
215
|
+
/** @deprecated Use {@link SuppressOutputForTests}. */
|
|
216
|
+
static suppressOutputForTests() {
|
|
217
|
+
return this.SuppressOutputForTests();
|
|
218
|
+
}
|
|
219
|
+
static FinishSQLLogging() {
|
|
187
220
|
if (SQLLogging.SQLLoggingFilePath) {
|
|
188
221
|
if (SQLLogging.getFileLength(SQLLogging.SQLLoggingFilePath) === 0) {
|
|
189
222
|
// no content in the file, so delete it
|
|
@@ -195,6 +228,10 @@ export class SQLLogging {
|
|
|
195
228
|
}
|
|
196
229
|
}
|
|
197
230
|
}
|
|
231
|
+
/** @deprecated Use {@link FinishSQLLogging}. */
|
|
232
|
+
static finishSQLLogging() {
|
|
233
|
+
return this.FinishSQLLogging();
|
|
234
|
+
}
|
|
198
235
|
static createFileName() {
|
|
199
236
|
const date = new Date();
|
|
200
237
|
const year = date.getUTCFullYear();
|
|
@@ -221,9 +258,12 @@ export class SQLLogging {
|
|
|
221
258
|
* @param isRecurringScript - if set to true tells the logger that the provided SQL represents a recurring script meaning it is something that is executed, generally, for all CodeGen runs. In these cases, the Config settings can result in omitting these recurring scripts from being logged because the configuration environment may have those recurring scripts already set to run after all run-specific migrations get run.
|
|
222
259
|
* @param includeBatchSeparator - if true, appends a batch separator (e.g., GO for SQL Server) after the SQL. Use this when the next statement in the migration needs to reference schema changes made by this statement (e.g., ALTER TABLE ADD column followed by UPDATE referencing that column). Defaults to false.
|
|
223
260
|
* @param batchSeparator - the batch separator string to use (e.g., 'GO' for SQL Server). Only used when includeBatchSeparator is true.
|
|
261
|
+
* @param requiresOwnBatch - the unit must be the ONLY statement in its batch — e.g. `CREATE OR ALTER VIEW`,
|
|
262
|
+
* which T-SQL requires to be first in its batch as well as last. Emits a separator BEFORE the unit
|
|
263
|
+
* unless the log already ends at a batch boundary, and one after it. Implies `includeBatchSeparator`.
|
|
224
264
|
* @returns
|
|
225
265
|
*/
|
|
226
|
-
static async
|
|
266
|
+
static async AppendToSQLLogFile(contents, description, isRecurringScript = false, includeBatchSeparator = false, batchSeparator = SQLLogging.defaultBatchSeparator(), requiresOwnBatch = false) {
|
|
227
267
|
try {
|
|
228
268
|
if (isRecurringScript && SQLLogging.OmitRecurringScriptsFromLog) {
|
|
229
269
|
return; // is a recurring script and the flag to omit recurring scripts is set
|
|
@@ -250,28 +290,40 @@ export class SQLLogging {
|
|
|
250
290
|
// generateBaseView / generateCRUDCreate / generateRootIDFunction return strings
|
|
251
291
|
// ending in `GO`. Appending `;` produces `GO;`, which SSMS and sqlcmd reject
|
|
252
292
|
// ("Incorrect syntax near ';'"). Detect and skip the `;` append in that case.
|
|
253
|
-
|
|
293
|
+
// Linear scans, not `/[\s;]+$/` or `/(^|\n)\s*GO\s*$/`: a unit can carry caller-supplied SQL
|
|
294
|
+
// (a TransitiveView body), and those patterns backtrack quadratically on a long interior
|
|
295
|
+
// whitespace run (see ./sql_text).
|
|
296
|
+
const trimmed = TrimTrailingStatementTerminators(contents);
|
|
254
297
|
let endsWithBatchSeparator = false;
|
|
255
298
|
if (trimmed.length > 0) {
|
|
256
|
-
endsWithBatchSeparator =
|
|
299
|
+
endsWithBatchSeparator = EndsWithBatchSeparatorLine(trimmed, 'GO');
|
|
257
300
|
contents = endsWithBatchSeparator ? trimmed : `${trimmed};`;
|
|
258
301
|
}
|
|
302
|
+
// A unit that must be alone in its batch also needs a separator BEFORE it: the log only ever
|
|
303
|
+
// appends, so whatever was logged last would otherwise share its batch.
|
|
304
|
+
const leadingSeparator = requiresOwnBatch && !!batchSeparator && !SQLLogging.logEndsAtBatchBoundary(batchSeparator)
|
|
305
|
+
? `${batchSeparator}\n\n`
|
|
306
|
+
: '';
|
|
259
307
|
// Emit a separator when the caller asked for one, or when the unit declares a batch-scoped
|
|
260
308
|
// variable (see the method JSDoc). Never for an empty separator (PostgreSQL), and never
|
|
261
309
|
// after a unit that already closes its own batch. The declaration scan runs only on
|
|
262
310
|
// units that could receive a separator, so GO-terminated view and routine bodies — the
|
|
263
311
|
// largest units logged — are not scanned.
|
|
264
312
|
const emitSeparator = !!batchSeparator && !endsWithBatchSeparator &&
|
|
265
|
-
(includeBatchSeparator || SQLLogging.
|
|
313
|
+
(includeBatchSeparator || requiresOwnBatch || SQLLogging.DeclaresBatchScopedVariable(trimmed));
|
|
266
314
|
contents = emitSeparator
|
|
267
315
|
? `${contents}\n${batchSeparator}\n\n`
|
|
268
316
|
: `${contents}\n\n`;
|
|
269
|
-
fs.appendFileSync(SQLLogging.SQLLoggingFilePath, contents);
|
|
317
|
+
fs.appendFileSync(SQLLogging.SQLLoggingFilePath, `${leadingSeparator}${contents}`);
|
|
270
318
|
}
|
|
271
319
|
catch (ex) {
|
|
272
320
|
logError("Unable to log metadata SQL text to file", ex);
|
|
273
321
|
}
|
|
274
322
|
}
|
|
323
|
+
/** @deprecated Use {@link AppendToSQLLogFile}. */
|
|
324
|
+
static async appendToSQLLogFile(contents, description, isRecurringScript = false, includeBatchSeparator = false, batchSeparator = SQLLogging.defaultBatchSeparator(), requiresOwnBatch = false) {
|
|
325
|
+
return this.AppendToSQLLogFile(contents, description, isRecurringScript, includeBatchSeparator, batchSeparator, requiresOwnBatch);
|
|
326
|
+
}
|
|
275
327
|
/**
|
|
276
328
|
* Executes the given SQL query using the given DataSource object.
|
|
277
329
|
* If the appendToLogFile parameter is true, the query will also be appended to the log file.
|
|
@@ -280,14 +332,15 @@ export class SQLLogging {
|
|
|
280
332
|
* @param query - The SQL query to execute.
|
|
281
333
|
* @param description - A description of the query to append to the log file.
|
|
282
334
|
* @param isRecurringScript - if set to true tells the logger that the provided SQL represents a recurring script meaning it is something that is executed, generally, for all CodeGen runs. In these cases, the Config settings can result in omitting these recurring scripts from being logged because the configuration environment may have those recurring scripts already set to run after all run-specific migrations get run.
|
|
335
|
+
* @param requiresOwnBatch - see {@link appendToSQLLogFile}: the unit must be alone in its batch.
|
|
283
336
|
* @returns - The result of the query execution.
|
|
284
337
|
*/
|
|
285
|
-
static async LogSQLAndExecute(ds, query, description, isRecurringScript = false, includeBatchSeparator = false, batchSeparator = SQLLogging.defaultBatchSeparator()) {
|
|
338
|
+
static async LogSQLAndExecute(ds, query, description, isRecurringScript = false, includeBatchSeparator = false, batchSeparator = SQLLogging.defaultBatchSeparator(), requiresOwnBatch = false) {
|
|
286
339
|
if (configInfo.SQLOutput?.enabled && !SQLLogging.SQLLoggingFilePath) {
|
|
287
340
|
throw new Error('SQLOutput.enabled but no CodeGen_Run log file is open. Refusing to apply metadata SQL with no artifact. ' +
|
|
288
341
|
'Run `mj codegen` from the Open App directory (mj-app.json) or pass --sql-output-dir.');
|
|
289
342
|
}
|
|
290
|
-
SQLLogging.
|
|
343
|
+
SQLLogging.AppendToSQLLogFile(query, description, isRecurringScript, includeBatchSeparator, batchSeparator, requiresOwnBatch);
|
|
291
344
|
const result = await ds.query(query);
|
|
292
345
|
return result.recordset;
|
|
293
346
|
}
|
|
@@ -298,7 +351,7 @@ export class SQLLogging {
|
|
|
298
351
|
* inside `IF ... BEGIN ... END` — so the match is not limited to the first statement. A declaration
|
|
299
352
|
* inside a routine body is routine-scoped and cannot collide across units, so it does not count.
|
|
300
353
|
*/
|
|
301
|
-
static
|
|
354
|
+
static DeclaresBatchScopedVariable(sql) {
|
|
302
355
|
if (!sql) {
|
|
303
356
|
return false;
|
|
304
357
|
}
|
|
@@ -319,6 +372,34 @@ export class SQLLogging {
|
|
|
319
372
|
}
|
|
320
373
|
return false;
|
|
321
374
|
}
|
|
375
|
+
/** @deprecated Use {@link DeclaresBatchScopedVariable}. */
|
|
376
|
+
static declaresBatchScopedVariable(sql) {
|
|
377
|
+
return this.DeclaresBatchScopedVariable(sql);
|
|
378
|
+
}
|
|
379
|
+
/** Bytes read from the end of the log to decide whether it ends at a batch boundary. */
|
|
380
|
+
static { this.BOUNDARY_TAIL_BYTES = 512; }
|
|
381
|
+
/**
|
|
382
|
+
* True when the log is empty or its last non-blank line is `separator` — i.e. the next unit starts
|
|
383
|
+
* a new batch. Reads only the tail of the file, so it holds whoever wrote the previous unit.
|
|
384
|
+
*/
|
|
385
|
+
static logEndsAtBatchBoundary(separator) {
|
|
386
|
+
const filePath = SQLLogging.SQLLoggingFilePath;
|
|
387
|
+
const size = SQLLogging.getFileLength(filePath);
|
|
388
|
+
if (size === 0) {
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
const length = Math.min(size, SQLLogging.BOUNDARY_TAIL_BYTES);
|
|
392
|
+
const buffer = Buffer.alloc(length);
|
|
393
|
+
const fd = fs.openSync(filePath, 'r');
|
|
394
|
+
try {
|
|
395
|
+
fs.readSync(fd, buffer, 0, length, size - length);
|
|
396
|
+
}
|
|
397
|
+
finally {
|
|
398
|
+
fs.closeSync(fd);
|
|
399
|
+
}
|
|
400
|
+
const tail = buffer.toString('utf8');
|
|
401
|
+
return tail.trim().length === 0 || EndsWithBatchSeparatorLine(tail, separator);
|
|
402
|
+
}
|
|
322
403
|
static getFileLength(filePath) {
|
|
323
404
|
try {
|
|
324
405
|
const stats = fs.statSync(filePath);
|
|
@@ -335,7 +416,7 @@ export class SQLLogging {
|
|
|
335
416
|
let data = fs.readFileSync(this.SQLLoggingFilePath, 'utf-8');
|
|
336
417
|
// Get schema placeholder mappings, defaulting to legacy behavior if not specified
|
|
337
418
|
const schemaPlaceholders = configInfo.SQLOutput.schemaPlaceholders || [
|
|
338
|
-
{ schema:
|
|
419
|
+
{ schema: MjCoreSchema(), placeholder: '${flyway:defaultSchema}' }
|
|
339
420
|
];
|
|
340
421
|
// Apply each schema-to-placeholder mapping in order
|
|
341
422
|
for (const mapping of schemaPlaceholders) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql_logging.js","sourceRoot":"","sources":["../../src/Misc/sql_logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAmB,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,wBAAwB,GAAG,sCAAsC,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB;IACvD,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7D,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,iBAAiB,IAAI,CAAC,KAAK,qBAAqB,CAAC;AACtG,CAAC;AAaD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAgC;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CA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CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear-time helpers for normalizing SQL text before it is embedded in a larger statement or
|
|
3
|
+
* appended to a CodeGen migration log.
|
|
4
|
+
*
|
|
5
|
+
* Why not regex: SQL here is often caller- or configuration-supplied (a `TransitiveView` body, a
|
|
6
|
+
* generated routine), and the obvious patterns — `/[\s;]+$/` to trim, `/(^|\n)\s*GO\s*$/` to detect a
|
|
7
|
+
* trailing batch separator — backtrack quadratically on a long whitespace run that is not at the end
|
|
8
|
+
* of the string (CodeQL js/polynomial-redos). A 200,000-character run took ~32s. These scans are
|
|
9
|
+
* O(n) for any input.
|
|
10
|
+
*/
|
|
11
|
+
/** Strips trailing whitespace and `;` statement terminators. */
|
|
12
|
+
export declare function TrimTrailingStatementTerminators(sql: string): string;
|
|
13
|
+
/** @deprecated Use {@link TrimTrailingStatementTerminators}. */
|
|
14
|
+
export declare function trimTrailingStatementTerminators(sql: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* True when the last non-blank line of `text` is exactly `separator` (case-insensitive, surrounding
|
|
17
|
+
* whitespace ignored) — e.g. a unit that already closes its own T-SQL batch with `GO`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function EndsWithBatchSeparatorLine(text: string, separator: string): boolean;
|
|
20
|
+
/** @deprecated Use {@link EndsWithBatchSeparatorLine}. */
|
|
21
|
+
export declare function endsWithBatchSeparatorLine(text: string, separator: string): boolean;
|
|
22
|
+
//# sourceMappingURL=sql_text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql_text.d.ts","sourceRoot":"","sources":["../../src/Misc/sql_text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,gEAAgE;AAChE,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpE;AAED,gEAAgE;AAChE,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAUnF;AAED,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear-time helpers for normalizing SQL text before it is embedded in a larger statement or
|
|
3
|
+
* appended to a CodeGen migration log.
|
|
4
|
+
*
|
|
5
|
+
* Why not regex: SQL here is often caller- or configuration-supplied (a `TransitiveView` body, a
|
|
6
|
+
* generated routine), and the obvious patterns — `/[\s;]+$/` to trim, `/(^|\n)\s*GO\s*$/` to detect a
|
|
7
|
+
* trailing batch separator — backtrack quadratically on a long whitespace run that is not at the end
|
|
8
|
+
* of the string (CodeQL js/polynomial-redos). A 200,000-character run took ~32s. These scans are
|
|
9
|
+
* O(n) for any input.
|
|
10
|
+
*/
|
|
11
|
+
/** True for the characters `\s` matches in the regexes these helpers replace. */
|
|
12
|
+
function isWhitespace(ch) {
|
|
13
|
+
return /\s/.test(ch);
|
|
14
|
+
}
|
|
15
|
+
/** Strips trailing whitespace and `;` statement terminators. */
|
|
16
|
+
export function TrimTrailingStatementTerminators(sql) {
|
|
17
|
+
let end = sql.length;
|
|
18
|
+
while (end > 0 && (sql[end - 1] === ';' || isWhitespace(sql[end - 1]))) {
|
|
19
|
+
end--;
|
|
20
|
+
}
|
|
21
|
+
return sql.slice(0, end);
|
|
22
|
+
}
|
|
23
|
+
/** @deprecated Use {@link TrimTrailingStatementTerminators}. */
|
|
24
|
+
export function trimTrailingStatementTerminators(sql) {
|
|
25
|
+
return TrimTrailingStatementTerminators(sql);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* True when the last non-blank line of `text` is exactly `separator` (case-insensitive, surrounding
|
|
29
|
+
* whitespace ignored) — e.g. a unit that already closes its own T-SQL batch with `GO`.
|
|
30
|
+
*/
|
|
31
|
+
export function EndsWithBatchSeparatorLine(text, separator) {
|
|
32
|
+
if (!separator) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
let end = text.length;
|
|
36
|
+
while (end > 0 && isWhitespace(text[end - 1])) {
|
|
37
|
+
end--;
|
|
38
|
+
}
|
|
39
|
+
const lineStart = text.lastIndexOf('\n', end - 1) + 1;
|
|
40
|
+
return text.slice(lineStart, end).trim().toUpperCase() === separator.trim().toUpperCase();
|
|
41
|
+
}
|
|
42
|
+
/** @deprecated Use {@link EndsWithBatchSeparatorLine}. */
|
|
43
|
+
export function endsWithBatchSeparatorLine(text, separator) {
|
|
44
|
+
return EndsWithBatchSeparatorLine(text, separator);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=sql_text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql_text.js","sourceRoot":"","sources":["../../src/Misc/sql_text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iFAAiF;AACjF,SAAS,YAAY,CAAC,EAAU;IAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,gCAAgC,CAAC,GAAW;IAC1D,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACrB,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,gCAAgC,CAAC,GAAW;IAC1D,OAAO,gCAAgC,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY,EAAE,SAAiB;IACxE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,GAAG,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,GAAG,EAAE,CAAC;IACR,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC5F,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,0BAA0B,CAAC,IAAY,EAAE,SAAiB;IACxE,OAAO,0BAA0B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SeverityType } from '@memberjunction/core';
|
|
2
2
|
/** Redirect the CodeGen spinner to {@link stream} (e.g. stderr in JSON mode). */
|
|
3
|
+
export declare function SetCodeGenSpinnerStream(stream: NodeJS.WriteStream): void;
|
|
4
|
+
/** @deprecated Use {@link SetCodeGenSpinnerStream}. */
|
|
3
5
|
export declare function setCodeGenSpinnerStream(stream: NodeJS.WriteStream): void;
|
|
4
6
|
/**
|
|
5
7
|
* Base class for logging, you can sub-class this class to create your own logger and override the logError and logStatus methods if desired.
|
|
@@ -33,39 +35,55 @@ export declare class LoggerBase {
|
|
|
33
35
|
/**
|
|
34
36
|
* Start a spinner with a message (non-verbose mode only)
|
|
35
37
|
*/
|
|
38
|
+
StartSpinner(message: string): void;
|
|
39
|
+
/** @deprecated Use {@link StartSpinner}. */
|
|
36
40
|
startSpinner(message: string): void;
|
|
37
41
|
/**
|
|
38
42
|
* Update spinner text (non-verbose mode only). Resets the live elapsed timer so
|
|
39
43
|
* the displayed duration tracks the new sub-step rather than the prior one.
|
|
40
44
|
*/
|
|
45
|
+
UpdateSpinner(message: string): void;
|
|
46
|
+
/** @deprecated Use {@link UpdateSpinner}. */
|
|
41
47
|
updateSpinner(message: string): void;
|
|
42
48
|
/**
|
|
43
49
|
* Stop spinner with success message
|
|
44
50
|
*/
|
|
51
|
+
SucceedSpinner(message?: string): void;
|
|
52
|
+
/** @deprecated Use {@link SucceedSpinner}. */
|
|
45
53
|
succeedSpinner(message?: string): void;
|
|
46
54
|
/**
|
|
47
55
|
* Stop spinner with failure message
|
|
48
56
|
*/
|
|
57
|
+
FailSpinner(message?: string): void;
|
|
58
|
+
/** @deprecated Use {@link FailSpinner}. */
|
|
49
59
|
failSpinner(message?: string): void;
|
|
50
60
|
/**
|
|
51
61
|
* Stop spinner with warning message
|
|
52
62
|
*/
|
|
63
|
+
WarnSpinner(message?: string): void;
|
|
64
|
+
/** @deprecated Use {@link WarnSpinner}. */
|
|
53
65
|
warnSpinner(message?: string): void;
|
|
54
66
|
/**
|
|
55
67
|
* Stop spinner without status
|
|
56
68
|
*/
|
|
69
|
+
StopSpinner(): void;
|
|
70
|
+
/** @deprecated Use {@link StopSpinner}. */
|
|
57
71
|
stopSpinner(): void;
|
|
58
72
|
/**
|
|
59
73
|
* Logs an error message to the console and to the log file if configured
|
|
60
74
|
* @param message
|
|
61
75
|
* @param args
|
|
62
76
|
*/
|
|
77
|
+
LogError(message: string, severity: SeverityType, ...args: any[]): void;
|
|
78
|
+
/** @deprecated Use {@link LogError}. */
|
|
63
79
|
logError(message: string, severity: SeverityType, ...args: any[]): void;
|
|
64
80
|
/**
|
|
65
81
|
* Logs a status message to the console and to the log file if configured
|
|
66
82
|
* @param message
|
|
67
83
|
* @param args
|
|
68
84
|
*/
|
|
85
|
+
LogStatus(message: string, severity: SeverityType, ...args: any[]): void;
|
|
86
|
+
/** @deprecated Use {@link LogStatus}. */
|
|
69
87
|
logStatus(message: string, severity: SeverityType, ...args: any[]): void;
|
|
70
88
|
/**
|
|
71
89
|
* Helper function to log a message with a specified severity and whether it is an error
|
|
@@ -74,6 +92,8 @@ export declare class LoggerBase {
|
|
|
74
92
|
* @param isError Whether to treat this message as an error
|
|
75
93
|
* @param args Any additional arguments to log
|
|
76
94
|
*/
|
|
95
|
+
LogMessage(message: string, severity: SeverityType, isError: boolean, ...args: any[]): void;
|
|
96
|
+
/** @deprecated Use {@link LogMessage}. */
|
|
77
97
|
logMessage(message: string, severity: SeverityType, isError: boolean, ...args: any[]): void;
|
|
78
98
|
protected logToConsole(message: string, isError: boolean, ...args: any[]): void;
|
|
79
99
|
protected logToFile(message: string, isError: boolean, ...args: any[]): void;
|
|
@@ -82,6 +102,8 @@ export declare class LoggerBase {
|
|
|
82
102
|
* Wrapper for the LoggerBase.logError method
|
|
83
103
|
*/
|
|
84
104
|
export declare function logError(message: string, ...args: any[]): void;
|
|
105
|
+
export declare function LogWarning(message: string, ...args: any[]): void;
|
|
106
|
+
/** @deprecated Use {@link LogWarning}. */
|
|
85
107
|
export declare function logWarning(message: string, ...args: any[]): void;
|
|
86
108
|
/**
|
|
87
109
|
* Wrapper for the LoggerBase.logStatus method
|
|
@@ -90,11 +112,25 @@ export declare function logStatus(message: string, ...args: any[]): void;
|
|
|
90
112
|
/**
|
|
91
113
|
* Wrapper for the LoggerBase.logMessage method
|
|
92
114
|
*/
|
|
115
|
+
export declare function LogMessage(message: string, severity: SeverityType, isError?: boolean, ...args: any[]): void;
|
|
116
|
+
/** @deprecated Use {@link LogMessage}. */
|
|
93
117
|
export declare function logMessage(message: string, severity: SeverityType, isError?: boolean, ...args: any[]): void;
|
|
118
|
+
export declare function StartSpinner(message: string): void;
|
|
119
|
+
/** @deprecated Use {@link StartSpinner}. */
|
|
94
120
|
export declare function startSpinner(message: string): void;
|
|
121
|
+
export declare function UpdateSpinner(message: string): void;
|
|
122
|
+
/** @deprecated Use {@link UpdateSpinner}. */
|
|
95
123
|
export declare function updateSpinner(message: string): void;
|
|
124
|
+
export declare function SucceedSpinner(message?: string): void;
|
|
125
|
+
/** @deprecated Use {@link SucceedSpinner}. */
|
|
96
126
|
export declare function succeedSpinner(message?: string): void;
|
|
127
|
+
export declare function FailSpinner(message?: string): void;
|
|
128
|
+
/** @deprecated Use {@link FailSpinner}. */
|
|
97
129
|
export declare function failSpinner(message?: string): void;
|
|
130
|
+
export declare function WarnSpinner(message?: string): void;
|
|
131
|
+
/** @deprecated Use {@link WarnSpinner}. */
|
|
98
132
|
export declare function warnSpinner(message?: string): void;
|
|
133
|
+
export declare function StopSpinner(): void;
|
|
134
|
+
/** @deprecated Use {@link StopSpinner}. */
|
|
99
135
|
export declare function stopSpinner(): void;
|
|
100
136
|
//# sourceMappingURL=status_logging.d.ts.map
|
|
@@ -1 +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;AAajH,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAExE;AAED;;;;;;;GAOG;AACH,qBAAa,UAAU;IACpB,OAAO,CAAC,QAAQ,CAAa;IAC7B,oFAAoF;IACpF,OAAO,CAAC,mBAAmB,CAAc;IACzC,kFAAkF;IAClF,OAAO,CAAC,aAAa,CAAa;IAClC,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAA+B;IAElD,OAAO,KAAK,SAAS,GAGpB;IAED,OAAO,CAAC,a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