@memberjunction/cli 2.117.0 → 2.119.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/README.md +358 -55
- package/dist/commands/clean/index.js +2 -4
- package/dist/commands/dbdoc/analyze.d.ts +3 -3
- package/dist/commands/dbdoc/analyze.js +25 -48
- package/dist/commands/dbdoc/export.d.ts +11 -4
- package/dist/commands/dbdoc/export.js +72 -75
- package/dist/commands/dbdoc/generate-queries.d.ts +13 -0
- package/dist/commands/dbdoc/generate-queries.js +82 -0
- package/dist/commands/dbdoc/init.d.ts +1 -4
- package/dist/commands/dbdoc/init.js +7 -118
- package/dist/commands/dbdoc/reset.d.ts +9 -0
- package/dist/commands/dbdoc/reset.js +53 -0
- package/dist/commands/dbdoc/status.d.ts +9 -0
- package/dist/commands/dbdoc/status.js +52 -0
- package/dist/commands/migrate/index.js +3 -5
- package/dist/commands/sync/push.d.ts +2 -0
- package/dist/commands/sync/push.js +18 -1
- package/dist/commands/sync/status.d.ts +2 -0
- package/dist/commands/sync/status.js +14 -1
- package/dist/commands/test/compare.d.ts +18 -0
- package/dist/commands/test/compare.js +73 -0
- package/dist/commands/test/history.d.ts +15 -0
- package/dist/commands/test/history.js +66 -0
- package/dist/commands/test/index.d.ts +6 -0
- package/dist/commands/test/index.js +31 -0
- package/dist/commands/test/list.d.ts +16 -0
- package/dist/commands/test/list.js +73 -0
- package/dist/commands/test/run.d.ts +17 -0
- package/dist/commands/test/run.js +69 -0
- package/dist/commands/test/suite.d.ts +15 -0
- package/dist/commands/test/suite.js +58 -0
- package/dist/commands/test/validate.d.ts +17 -0
- package/dist/commands/test/validate.js +70 -0
- package/dist/config.d.ts +16 -12
- package/dist/config.js +45 -9
- package/oclif.manifest.json +791 -85
- package/package.json +12 -9
- package/dist/commands/dbdoc/review.d.ts +0 -10
- package/dist/commands/dbdoc/review.js +0 -81
|
@@ -22,92 +22,89 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const core_1 = require("@oclif/core");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
33
|
-
const fs = __importStar(require("fs/promises"));
|
|
34
|
-
const path = __importStar(require("path"));
|
|
35
|
-
const db_auto_doc_1 = require("@memberjunction/db-auto-doc");
|
|
36
|
-
class Export extends core_1.Command {
|
|
37
|
-
static description = 'Generate output files (SQL scripts, markdown documentation)';
|
|
27
|
+
class DbDocExport extends core_1.Command {
|
|
28
|
+
static description = 'Export documentation in multiple formats (delegates to db-auto-doc export)';
|
|
38
29
|
static examples = [
|
|
39
|
-
'<%= config.bin %> <%= command.id %>',
|
|
40
|
-
'<%= config.bin %> <%= command.id %> --
|
|
41
|
-
'<%= config.bin %> <%= command.id %> --
|
|
42
|
-
'<%= config.bin %> <%= command.id %> --
|
|
30
|
+
'<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json',
|
|
31
|
+
'<%= config.bin %> <%= command.id %> --sql',
|
|
32
|
+
'<%= config.bin %> <%= command.id %> --markdown',
|
|
33
|
+
'<%= config.bin %> <%= command.id %> --html',
|
|
34
|
+
'<%= config.bin %> <%= command.id %> --csv',
|
|
35
|
+
'<%= config.bin %> <%= command.id %> --mermaid',
|
|
36
|
+
'<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply',
|
|
43
37
|
];
|
|
44
38
|
static flags = {
|
|
45
|
-
|
|
46
|
-
description: '
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
'state-file': core_1.Flags.string({
|
|
40
|
+
description: 'Path to state JSON file',
|
|
41
|
+
char: 's'
|
|
42
|
+
}),
|
|
43
|
+
'output-dir': core_1.Flags.string({
|
|
44
|
+
description: 'Output directory for generated files',
|
|
45
|
+
char: 'o'
|
|
46
|
+
}),
|
|
47
|
+
sql: core_1.Flags.boolean({
|
|
48
|
+
description: 'Generate SQL script'
|
|
49
|
+
}),
|
|
50
|
+
markdown: core_1.Flags.boolean({
|
|
51
|
+
description: 'Generate Markdown documentation'
|
|
52
|
+
}),
|
|
53
|
+
html: core_1.Flags.boolean({
|
|
54
|
+
description: 'Generate interactive HTML documentation'
|
|
49
55
|
}),
|
|
50
|
-
|
|
51
|
-
description: '
|
|
52
|
-
|
|
56
|
+
csv: core_1.Flags.boolean({
|
|
57
|
+
description: 'Generate CSV exports (tables and columns)'
|
|
58
|
+
}),
|
|
59
|
+
mermaid: core_1.Flags.boolean({
|
|
60
|
+
description: 'Generate Mermaid ERD diagram files'
|
|
61
|
+
}),
|
|
62
|
+
report: core_1.Flags.boolean({
|
|
63
|
+
description: 'Generate analysis report'
|
|
64
|
+
}),
|
|
65
|
+
apply: core_1.Flags.boolean({
|
|
66
|
+
description: 'Apply SQL to database',
|
|
67
|
+
default: false
|
|
53
68
|
}),
|
|
54
69
|
'approved-only': core_1.Flags.boolean({
|
|
55
70
|
description: 'Only export approved items',
|
|
56
|
-
default: false
|
|
57
|
-
}),
|
|
58
|
-
execute: core_1.Flags.boolean({
|
|
59
|
-
description: 'Execute SQL script (apply to database)',
|
|
60
|
-
default: false,
|
|
71
|
+
default: false
|
|
61
72
|
}),
|
|
73
|
+
'confidence-threshold': core_1.Flags.string({
|
|
74
|
+
description: 'Minimum confidence threshold',
|
|
75
|
+
default: '0'
|
|
76
|
+
})
|
|
62
77
|
};
|
|
63
78
|
async run() {
|
|
64
|
-
const { flags } = await this.parse(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
|
-
await connection.close();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (flags.format === 'markdown' || flags.format === 'all') {
|
|
100
|
-
const mdGen = new db_auto_doc_1.MarkdownGenerator();
|
|
101
|
-
const markdown = mdGen.generate(state);
|
|
102
|
-
const mdPath = path.join(outputDir, 'database-documentation.md');
|
|
103
|
-
await fs.writeFile(mdPath, markdown);
|
|
104
|
-
this.log(chalk_1.default.green(`✓ Generated Markdown: ${mdPath}`));
|
|
105
|
-
}
|
|
106
|
-
this.log(chalk_1.default.green('\n✅ Export complete!'));
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
this.error(error.message);
|
|
110
|
-
}
|
|
79
|
+
const { flags } = await this.parse(DbDocExport);
|
|
80
|
+
// Load DBAutoDoc command dynamically
|
|
81
|
+
const { default: ExportCommand } = await Promise.resolve().then(() => __importStar(require('@memberjunction/db-auto-doc/dist/commands/export')));
|
|
82
|
+
// Build args array for DBAutoDoc command
|
|
83
|
+
const args = [];
|
|
84
|
+
if (flags['state-file'])
|
|
85
|
+
args.push('--state-file', flags['state-file']);
|
|
86
|
+
if (flags['output-dir'])
|
|
87
|
+
args.push('--output-dir', flags['output-dir']);
|
|
88
|
+
if (flags.sql)
|
|
89
|
+
args.push('--sql');
|
|
90
|
+
if (flags.markdown)
|
|
91
|
+
args.push('--markdown');
|
|
92
|
+
if (flags.html)
|
|
93
|
+
args.push('--html');
|
|
94
|
+
if (flags.csv)
|
|
95
|
+
args.push('--csv');
|
|
96
|
+
if (flags.mermaid)
|
|
97
|
+
args.push('--mermaid');
|
|
98
|
+
if (flags.report)
|
|
99
|
+
args.push('--report');
|
|
100
|
+
if (flags.apply)
|
|
101
|
+
args.push('--apply');
|
|
102
|
+
if (flags['approved-only'])
|
|
103
|
+
args.push('--approved-only');
|
|
104
|
+
if (flags['confidence-threshold'])
|
|
105
|
+
args.push('--confidence-threshold', flags['confidence-threshold']);
|
|
106
|
+
// Execute the DBAutoDoc export command
|
|
107
|
+
await ExportCommand.run(args);
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
|
-
exports.default =
|
|
110
|
+
exports.default = DbDocExport;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DbDocGenerateQueries extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
'from-state': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'queries-per-table': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'max-execution-time': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const core_1 = require("@oclif/core");
|
|
27
|
+
class DbDocGenerateQueries extends core_1.Command {
|
|
28
|
+
static description = 'Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)';
|
|
29
|
+
static examples = [
|
|
30
|
+
'<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json',
|
|
31
|
+
'<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries',
|
|
32
|
+
'<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10',
|
|
33
|
+
];
|
|
34
|
+
static flags = {
|
|
35
|
+
'from-state': core_1.Flags.string({
|
|
36
|
+
description: 'Path to existing state.json file from previous analysis',
|
|
37
|
+
required: true
|
|
38
|
+
}),
|
|
39
|
+
'output-dir': core_1.Flags.string({
|
|
40
|
+
description: 'Output directory for generated queries',
|
|
41
|
+
required: false
|
|
42
|
+
}),
|
|
43
|
+
config: core_1.Flags.string({
|
|
44
|
+
char: 'c',
|
|
45
|
+
description: 'Path to config file (for database connection and AI settings)',
|
|
46
|
+
default: './config.json'
|
|
47
|
+
}),
|
|
48
|
+
'queries-per-table': core_1.Flags.integer({
|
|
49
|
+
description: 'Number of queries to generate per table',
|
|
50
|
+
required: false
|
|
51
|
+
}),
|
|
52
|
+
'max-execution-time': core_1.Flags.integer({
|
|
53
|
+
description: 'Maximum execution time for query validation (ms)',
|
|
54
|
+
required: false
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
const { flags } = await this.parse(DbDocGenerateQueries);
|
|
59
|
+
// Load DBAutoDoc command dynamically
|
|
60
|
+
const { default: GenerateQueriesCommand } = await Promise.resolve().then(() => __importStar(require('@memberjunction/db-auto-doc/dist/commands/generate-queries')));
|
|
61
|
+
// Build args array for DBAutoDoc command
|
|
62
|
+
const args = [];
|
|
63
|
+
if (flags['from-state']) {
|
|
64
|
+
args.push('--from-state', flags['from-state']);
|
|
65
|
+
}
|
|
66
|
+
if (flags['output-dir']) {
|
|
67
|
+
args.push('--output-dir', flags['output-dir']);
|
|
68
|
+
}
|
|
69
|
+
if (flags.config) {
|
|
70
|
+
args.push('--config', flags.config);
|
|
71
|
+
}
|
|
72
|
+
if (flags['queries-per-table']) {
|
|
73
|
+
args.push('--queries-per-table', flags['queries-per-table'].toString());
|
|
74
|
+
}
|
|
75
|
+
if (flags['max-execution-time']) {
|
|
76
|
+
args.push('--max-execution-time', flags['max-execution-time'].toString());
|
|
77
|
+
}
|
|
78
|
+
// Execute the DBAutoDoc generate-queries command
|
|
79
|
+
await GenerateQueriesCommand.run(args);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.default = DbDocGenerateQueries;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class DbDocInit extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
interactive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
};
|
|
8
5
|
run(): Promise<void>;
|
|
9
6
|
}
|
|
@@ -22,129 +22,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const core_1 = require("@oclif/core");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
33
|
-
const fs = __importStar(require("fs/promises"));
|
|
34
|
-
const path = __importStar(require("path"));
|
|
35
|
-
const db_auto_doc_1 = require("@memberjunction/db-auto-doc");
|
|
36
|
-
class Init extends core_1.Command {
|
|
37
|
-
static description = 'Initialize database documentation project';
|
|
27
|
+
class DbDocInit extends core_1.Command {
|
|
28
|
+
static description = 'Initialize DBAutoDoc project (delegates to db-auto-doc init)';
|
|
38
29
|
static examples = [
|
|
39
30
|
'<%= config.bin %> <%= command.id %>',
|
|
40
31
|
];
|
|
41
|
-
static flags = {
|
|
42
|
-
interactive: core_1.Flags.boolean({
|
|
43
|
-
description: 'Interactive setup',
|
|
44
|
-
default: true,
|
|
45
|
-
}),
|
|
46
|
-
};
|
|
47
32
|
async run() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let database;
|
|
53
|
-
let user;
|
|
54
|
-
let pwd;
|
|
55
|
-
if (flags.interactive) {
|
|
56
|
-
server = await (0, prompts_1.input)({
|
|
57
|
-
message: 'Database server:',
|
|
58
|
-
default: 'localhost',
|
|
59
|
-
});
|
|
60
|
-
database = await (0, prompts_1.input)({
|
|
61
|
-
message: 'Database name:',
|
|
62
|
-
validate: (val) => (val ? true : 'Database name required'),
|
|
63
|
-
});
|
|
64
|
-
user = await (0, prompts_1.input)({
|
|
65
|
-
message: 'Username:',
|
|
66
|
-
default: 'sa',
|
|
67
|
-
});
|
|
68
|
-
pwd = await (0, prompts_1.password)({
|
|
69
|
-
message: 'Password:',
|
|
70
|
-
mask: '*',
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
server = process.env.DB_SERVER || 'localhost';
|
|
75
|
-
database = process.env.DB_DATABASE || '';
|
|
76
|
-
user = process.env.DB_USER || 'sa';
|
|
77
|
-
pwd = process.env.DB_PASSWORD || '';
|
|
78
|
-
}
|
|
79
|
-
// Test connection
|
|
80
|
-
const spinner = (0, ora_classic_1.default)('Testing database connection...').start();
|
|
81
|
-
const connection = new db_auto_doc_1.DatabaseConnection({
|
|
82
|
-
server,
|
|
83
|
-
database,
|
|
84
|
-
user,
|
|
85
|
-
password: pwd,
|
|
86
|
-
encrypt: true,
|
|
87
|
-
trustServerCertificate: true,
|
|
88
|
-
});
|
|
89
|
-
const connected = await connection.test();
|
|
90
|
-
if (!connected) {
|
|
91
|
-
spinner.fail('Connection failed');
|
|
92
|
-
this.exit(1);
|
|
93
|
-
}
|
|
94
|
-
spinner.succeed('Connection successful');
|
|
95
|
-
// Create .env file
|
|
96
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
97
|
-
const envContent = `
|
|
98
|
-
# Database Connection
|
|
99
|
-
DB_SERVER=${server}
|
|
100
|
-
DB_DATABASE=${database}
|
|
101
|
-
DB_USER=${user}
|
|
102
|
-
DB_PASSWORD=${pwd}
|
|
103
|
-
DB_ENCRYPT=true
|
|
104
|
-
DB_TRUST_SERVER_CERTIFICATE=true
|
|
105
|
-
|
|
106
|
-
# AI Configuration
|
|
107
|
-
AI_PROVIDER=openai
|
|
108
|
-
AI_MODEL=gpt-4
|
|
109
|
-
AI_API_KEY=your-api-key-here
|
|
110
|
-
`.trim();
|
|
111
|
-
await fs.writeFile(envPath, envContent);
|
|
112
|
-
this.log(chalk_1.default.green('✓ Created .env file'));
|
|
113
|
-
// Create state file
|
|
114
|
-
const stateManager = new db_auto_doc_1.StateManager();
|
|
115
|
-
await stateManager.reset(server, database);
|
|
116
|
-
this.log(chalk_1.default.green('✓ Created db-doc-state.json'));
|
|
117
|
-
// Ask seed questions
|
|
118
|
-
if (flags.interactive) {
|
|
119
|
-
const addSeed = await (0, prompts_1.confirm)({
|
|
120
|
-
message: 'Would you like to provide seed context?',
|
|
121
|
-
default: true,
|
|
122
|
-
});
|
|
123
|
-
if (addSeed) {
|
|
124
|
-
const purpose = await (0, prompts_1.input)({
|
|
125
|
-
message: 'Overall database purpose:',
|
|
126
|
-
});
|
|
127
|
-
const domains = await (0, prompts_1.input)({
|
|
128
|
-
message: 'Business domains (comma-separated):',
|
|
129
|
-
});
|
|
130
|
-
const state = stateManager.getState();
|
|
131
|
-
state.seedContext = {
|
|
132
|
-
overallPurpose: purpose,
|
|
133
|
-
businessDomains: domains.split(',').map((d) => d.trim()),
|
|
134
|
-
};
|
|
135
|
-
await stateManager.save();
|
|
136
|
-
this.log(chalk_1.default.green('✓ Saved seed context'));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
this.log(chalk_1.default.green.bold('\n✅ Initialization complete!\n'));
|
|
140
|
-
this.log('Next steps:');
|
|
141
|
-
this.log(' 1. Edit .env and add your AI API key');
|
|
142
|
-
this.log(' 2. Run: mj dbdoc analyze');
|
|
143
|
-
await connection.close();
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
this.error(error.message);
|
|
147
|
-
}
|
|
33
|
+
// Load DBAutoDoc command dynamically
|
|
34
|
+
const { default: InitCommand } = await Promise.resolve().then(() => __importStar(require('@memberjunction/db-auto-doc/dist/commands/init')));
|
|
35
|
+
// Execute the DBAutoDoc init command
|
|
36
|
+
await InitCommand.run([]);
|
|
148
37
|
}
|
|
149
38
|
}
|
|
150
|
-
exports.default =
|
|
39
|
+
exports.default = DbDocInit;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DbDocReset extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const core_1 = require("@oclif/core");
|
|
27
|
+
class DbDocReset extends core_1.Command {
|
|
28
|
+
static description = 'Reset analysis state (delegates to db-auto-doc reset)';
|
|
29
|
+
static examples = [
|
|
30
|
+
'<%= config.bin %> <%= command.id %>',
|
|
31
|
+
'<%= config.bin %> <%= command.id %> --force',
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
force: core_1.Flags.boolean({
|
|
35
|
+
description: 'Force reset without confirmation',
|
|
36
|
+
char: 'f',
|
|
37
|
+
default: false
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const { flags } = await this.parse(DbDocReset);
|
|
42
|
+
// Load DBAutoDoc command dynamically
|
|
43
|
+
const { default: ResetCommand } = await Promise.resolve().then(() => __importStar(require('@memberjunction/db-auto-doc/dist/commands/reset')));
|
|
44
|
+
// Build args array for DBAutoDoc command
|
|
45
|
+
const args = [];
|
|
46
|
+
if (flags.force) {
|
|
47
|
+
args.push('--force');
|
|
48
|
+
}
|
|
49
|
+
// Execute the DBAutoDoc reset command
|
|
50
|
+
await ResetCommand.run(args);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = DbDocReset;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DbDocStatus extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
'state-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const core_1 = require("@oclif/core");
|
|
27
|
+
class DbDocStatus extends core_1.Command {
|
|
28
|
+
static description = 'Show analysis status and progress (delegates to db-auto-doc status)';
|
|
29
|
+
static examples = [
|
|
30
|
+
'<%= config.bin %> <%= command.id %>',
|
|
31
|
+
'<%= config.bin %> <%= command.id %> --state-file ./custom-state.json',
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
'state-file': core_1.Flags.string({
|
|
35
|
+
description: 'Path to state JSON file',
|
|
36
|
+
char: 's'
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
async run() {
|
|
40
|
+
const { flags } = await this.parse(DbDocStatus);
|
|
41
|
+
// Load DBAutoDoc command dynamically
|
|
42
|
+
const { default: StatusCommand } = await Promise.resolve().then(() => __importStar(require('@memberjunction/db-auto-doc/dist/commands/status')));
|
|
43
|
+
// Build args array for DBAutoDoc command
|
|
44
|
+
const args = [];
|
|
45
|
+
if (flags['state-file']) {
|
|
46
|
+
args.push('--state-file', flags['state-file']);
|
|
47
|
+
}
|
|
48
|
+
// Execute the DBAutoDoc status command
|
|
49
|
+
await StatusCommand.run(args);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = DbDocStatus;
|
|
@@ -19,14 +19,12 @@ class Migrate extends core_1.Command {
|
|
|
19
19
|
};
|
|
20
20
|
async run() {
|
|
21
21
|
const { flags } = await this.parse(Migrate);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
const flywayConfig = await (0, config_1.getFlywayConfig)(config_1.config, flags.tag);
|
|
22
|
+
const config = (0, config_1.getValidatedConfig)();
|
|
23
|
+
const flywayConfig = await (0, config_1.getFlywayConfig)(config, flags.tag);
|
|
26
24
|
const flyway = new node_flyway_1.Flyway(flywayConfig);
|
|
27
25
|
if (flags.verbose) {
|
|
28
26
|
this.log(`Connecting to ${flywayConfig.url}`);
|
|
29
|
-
this.log(`Migrating ${
|
|
27
|
+
this.log(`Migrating ${config.coreSchema} schema using migrations from:\n\t- ${flywayConfig.migrationLocations.join('\n\t- ')}\n`);
|
|
30
28
|
}
|
|
31
29
|
if (flags.tag) {
|
|
32
30
|
this.log(`Migrating to ${flags.tag}`);
|
|
@@ -9,6 +9,8 @@ export default class Push extends Command {
|
|
|
9
9
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
'no-validate': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
'parallel-batch-size': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
exclude: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
14
|
};
|
|
13
15
|
run(): Promise<void>;
|
|
14
16
|
}
|
|
@@ -29,6 +29,14 @@ class Push extends core_1.Command {
|
|
|
29
29
|
min: 1,
|
|
30
30
|
max: 50
|
|
31
31
|
}),
|
|
32
|
+
include: core_1.Flags.string({
|
|
33
|
+
description: 'Only process these directories (comma-separated, supports patterns)',
|
|
34
|
+
multiple: false
|
|
35
|
+
}),
|
|
36
|
+
exclude: core_1.Flags.string({
|
|
37
|
+
description: 'Skip these directories (comma-separated, supports patterns)',
|
|
38
|
+
multiple: false
|
|
39
|
+
}),
|
|
32
40
|
};
|
|
33
41
|
async run() {
|
|
34
42
|
const { flags } = await this.parse(Push);
|
|
@@ -57,10 +65,17 @@ class Push extends core_1.Command {
|
|
|
57
65
|
else {
|
|
58
66
|
spinner.stop();
|
|
59
67
|
}
|
|
68
|
+
// Parse include/exclude filters
|
|
69
|
+
const includeFilter = flags.include ? flags.include.split(',').map(s => s.trim()) : undefined;
|
|
70
|
+
const excludeFilter = flags.exclude ? flags.exclude.split(',').map(s => s.trim()) : undefined;
|
|
60
71
|
// Run validation unless disabled
|
|
61
72
|
if (!flags['no-validate']) {
|
|
62
73
|
spinner.start('Validating metadata...');
|
|
63
|
-
const validator = new metadata_sync_1.ValidationService({
|
|
74
|
+
const validator = new metadata_sync_1.ValidationService({
|
|
75
|
+
verbose: flags.verbose,
|
|
76
|
+
include: includeFilter,
|
|
77
|
+
exclude: excludeFilter
|
|
78
|
+
});
|
|
64
79
|
const formatter = new metadata_sync_1.FormattingService();
|
|
65
80
|
const targetDir = flags.dir ? path_1.default.resolve(metadata_sync_1.configManager.getOriginalCwd(), flags.dir) : metadata_sync_1.configManager.getOriginalCwd();
|
|
66
81
|
const validationResult = await validator.validateDirectory(targetDir);
|
|
@@ -97,6 +112,8 @@ class Push extends core_1.Command {
|
|
|
97
112
|
verbose: flags.verbose,
|
|
98
113
|
noValidate: flags['no-validate'],
|
|
99
114
|
parallelBatchSize: flags['parallel-batch-size'],
|
|
115
|
+
include: includeFilter,
|
|
116
|
+
exclude: excludeFilter,
|
|
100
117
|
}, {
|
|
101
118
|
onProgress: (message) => {
|
|
102
119
|
spinner.start(message);
|
|
@@ -5,6 +5,8 @@ export default class Status extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
dir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
include: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
exclude: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
10
|
};
|
|
9
11
|
run(): Promise<void>;
|
|
10
12
|
}
|
|
@@ -17,6 +17,14 @@ class Status extends core_1.Command {
|
|
|
17
17
|
static flags = {
|
|
18
18
|
dir: core_1.Flags.string({ description: 'Specific entity directory to check status' }),
|
|
19
19
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'Show detailed field-level differences' }),
|
|
20
|
+
include: core_1.Flags.string({
|
|
21
|
+
description: 'Only process these directories (comma-separated, supports patterns)',
|
|
22
|
+
multiple: false
|
|
23
|
+
}),
|
|
24
|
+
exclude: core_1.Flags.string({
|
|
25
|
+
description: 'Skip these directories (comma-separated, supports patterns)',
|
|
26
|
+
multiple: false
|
|
27
|
+
}),
|
|
20
28
|
};
|
|
21
29
|
async run() {
|
|
22
30
|
const { flags } = await this.parse(Status);
|
|
@@ -41,11 +49,16 @@ class Status extends core_1.Command {
|
|
|
41
49
|
else {
|
|
42
50
|
spinner.stop();
|
|
43
51
|
}
|
|
52
|
+
// Parse include/exclude filters
|
|
53
|
+
const includeFilter = flags.include ? flags.include.split(',').map(s => s.trim()) : undefined;
|
|
54
|
+
const excludeFilter = flags.exclude ? flags.exclude.split(',').map(s => s.trim()) : undefined;
|
|
44
55
|
// Create status service and execute
|
|
45
56
|
const statusService = new metadata_sync_1.StatusService(syncEngine);
|
|
46
57
|
spinner.start('Checking status...');
|
|
47
58
|
const result = await statusService.checkStatus({
|
|
48
|
-
dir: flags.dir
|
|
59
|
+
dir: flags.dir,
|
|
60
|
+
include: includeFilter,
|
|
61
|
+
exclude: excludeFilter
|
|
49
62
|
}, {
|
|
50
63
|
onProgress: (message) => {
|
|
51
64
|
spinner.start(message);
|