@memberjunction/cli 4.4.0 → 5.1.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 +130 -0
- package/dist/commands/app/check-updates.d.ts +13 -0
- package/dist/commands/app/check-updates.d.ts.map +1 -0
- package/dist/commands/app/check-updates.js +54 -0
- package/dist/commands/app/check-updates.js.map +1 -0
- package/dist/commands/app/disable.d.ts +16 -0
- package/dist/commands/app/disable.d.ts.map +1 -0
- package/dist/commands/app/disable.js +47 -0
- package/dist/commands/app/disable.js.map +1 -0
- package/dist/commands/app/enable.d.ts +16 -0
- package/dist/commands/app/enable.d.ts.map +1 -0
- package/dist/commands/app/enable.js +47 -0
- package/dist/commands/app/enable.js.map +1 -0
- package/dist/commands/app/info.d.ts +16 -0
- package/dist/commands/app/info.d.ts.map +1 -0
- package/dist/commands/app/info.js +64 -0
- package/dist/commands/app/info.js.map +1 -0
- package/dist/commands/app/install.d.ts +21 -0
- package/dist/commands/app/install.d.ts.map +1 -0
- package/dist/commands/app/install.js +54 -0
- package/dist/commands/app/install.js.map +1 -0
- package/dist/commands/app/list.d.ts +16 -0
- package/dist/commands/app/list.d.ts.map +1 -0
- package/dist/commands/app/list.js +60 -0
- package/dist/commands/app/list.js.map +1 -0
- package/dist/commands/app/remove.d.ts +22 -0
- package/dist/commands/app/remove.d.ts.map +1 -0
- package/dist/commands/app/remove.js +66 -0
- package/dist/commands/app/remove.js.map +1 -0
- package/dist/commands/app/upgrade.d.ts +20 -0
- package/dist/commands/app/upgrade.d.ts.map +1 -0
- package/dist/commands/app/upgrade.js +52 -0
- package/dist/commands/app/upgrade.js.map +1 -0
- package/dist/commands/clean/index.d.ts +0 -2
- package/dist/commands/clean/index.d.ts.map +1 -1
- package/dist/commands/clean/index.js +31 -19
- package/dist/commands/clean/index.js.map +1 -1
- package/dist/commands/codegen/5-0-fix-entity-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-entity-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-entity-names.js +104 -0
- package/dist/commands/codegen/5-0-fix-entity-names.js.map +1 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.js +92 -0
- package/dist/commands/codegen/5-0-fix-html-entity-names.js.map +1 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.d.ts +17 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.d.ts.map +1 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.js +93 -0
- package/dist/commands/codegen/5-0-fix-metadata-names.js.map +1 -0
- package/dist/commands/codegen/index.d.ts +4 -1
- package/dist/commands/codegen/index.d.ts.map +1 -1
- package/dist/commands/codegen/index.js +30 -5
- package/dist/commands/codegen/index.js.map +1 -1
- package/dist/commands/codegen/manifest.d.ts +4 -1
- package/dist/commands/codegen/manifest.d.ts.map +1 -1
- package/dist/commands/codegen/manifest.js +34 -11
- package/dist/commands/codegen/manifest.js.map +1 -1
- package/dist/commands/migrate/index.d.ts +5 -1
- package/dist/commands/migrate/index.d.ts.map +1 -1
- package/dist/commands/migrate/index.js +102 -229
- package/dist/commands/migrate/index.js.map +1 -1
- package/dist/commands/sync/init.js +1 -1
- package/dist/commands/sync/init.js.map +1 -1
- package/dist/commands/sync/pull.js +4 -4
- package/dist/commands/sync/pull.js.map +1 -1
- package/dist/config.d.ts +154 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +81 -48
- package/dist/config.js.map +1 -1
- package/dist/light-commands.d.ts +1 -1
- package/dist/light-commands.js +2 -2
- package/dist/light-commands.js.map +1 -1
- package/dist/utils/open-app-context.d.ts +48 -0
- package/dist/utils/open-app-context.d.ts.map +1 -0
- package/dist/utils/open-app-context.js +143 -0
- package/dist/utils/open-app-context.js.map +1 -0
- package/oclif.manifest.json +789 -247
- package/package.json +12 -12
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: `mj app remove <name>`.
|
|
4
|
+
*
|
|
5
|
+
* Removes an installed Open App, optionally preserving its database schema
|
|
6
|
+
* and data. Prompts for confirmation unless `--yes` is passed.
|
|
7
|
+
*/
|
|
8
|
+
export default class AppRemove extends Command {
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static args: {
|
|
12
|
+
name: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
'keep-data': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
17
|
+
yes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
|
+
verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/commands/app/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAMnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAAqC;IAEvD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwC3B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { confirm } from '@inquirer/prompts';
|
|
3
|
+
import ora from 'ora-classic';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { buildOrchestratorContext } from '../../utils/open-app-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* CLI command: `mj app remove <name>`.
|
|
8
|
+
*
|
|
9
|
+
* Removes an installed Open App, optionally preserving its database schema
|
|
10
|
+
* and data. Prompts for confirmation unless `--yes` is passed.
|
|
11
|
+
*/
|
|
12
|
+
export default class AppRemove extends Command {
|
|
13
|
+
static { this.description = 'Remove an installed MJ Open App'; }
|
|
14
|
+
static { this.examples = [
|
|
15
|
+
'<%= config.bin %> app remove acme-crm',
|
|
16
|
+
'<%= config.bin %> app remove acme-crm --keep-data',
|
|
17
|
+
'<%= config.bin %> app remove acme-crm --force',
|
|
18
|
+
]; }
|
|
19
|
+
static { this.args = {
|
|
20
|
+
name: Args.string({
|
|
21
|
+
description: 'Name of the installed app to remove',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
}; }
|
|
25
|
+
static { this.flags = {
|
|
26
|
+
'keep-data': Flags.boolean({ description: 'Keep the database schema and data' }),
|
|
27
|
+
force: Flags.boolean({ description: 'Force removal even if other apps depend on this one' }),
|
|
28
|
+
yes: Flags.boolean({ char: 'y', description: 'Skip confirmation prompt' }),
|
|
29
|
+
verbose: Flags.boolean({ char: 'v', description: 'Show detailed output' }),
|
|
30
|
+
}; }
|
|
31
|
+
async run() {
|
|
32
|
+
const { args, flags } = await this.parse(AppRemove);
|
|
33
|
+
const spinner = ora();
|
|
34
|
+
if (!flags.yes) {
|
|
35
|
+
const confirmed = await confirm({
|
|
36
|
+
message: `Are you sure you want to remove '${args.name}'?${flags['keep-data'] ? ' (data will be kept)' : ' This will DROP the app schema and all data.'}`,
|
|
37
|
+
default: false,
|
|
38
|
+
});
|
|
39
|
+
if (!confirmed) {
|
|
40
|
+
this.log(chalk.yellow('Removal cancelled.'));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const { RemoveApp } = await import('@memberjunction/open-app-engine');
|
|
46
|
+
const context = await buildOrchestratorContext(this, flags.verbose);
|
|
47
|
+
const result = await RemoveApp({ AppName: args.name, KeepData: flags['keep-data'], Force: flags.force, Verbose: flags.verbose }, context);
|
|
48
|
+
if (result.Success) {
|
|
49
|
+
spinner.succeed(chalk.green(`Removed ${result.AppName}`));
|
|
50
|
+
if (result.Summary) {
|
|
51
|
+
this.log(`\n${result.Summary}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
spinner.fail(chalk.red(`Remove failed: ${result.ErrorMessage}`));
|
|
56
|
+
this.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
spinner.fail('Remove failed');
|
|
61
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
62
|
+
this.error(message);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/commands/app/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;aACrC,gBAAW,GAAG,iCAAiC,CAAC;aAEhD,aAAQ,GAAG;QAChB,uCAAuC;QACvC,mDAAmD;QACnD,+CAA+C;KAChD,CAAC;aAEK,SAAI,GAAG;QACZ,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,qCAAqC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AAG,MAAM,SAAS,CAC5B,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAChG,OAAO,CACR,CAAC;YAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAC1D,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,IAAI,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBACjE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC9B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: `mj app upgrade <name>`.
|
|
4
|
+
*
|
|
5
|
+
* Upgrades an installed Open App to a newer version, running new migrations,
|
|
6
|
+
* updating packages, and recording upgrade history.
|
|
7
|
+
*/
|
|
8
|
+
export default class AppUpgrade extends Command {
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static args: {
|
|
12
|
+
name: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/commands/app/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAKnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,MAAM,CAAC,WAAW,SAAyD;IAE3E,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4B3B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import ora from 'ora-classic';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { buildOrchestratorContext } from '../../utils/open-app-context.js';
|
|
5
|
+
/**
|
|
6
|
+
* CLI command: `mj app upgrade <name>`.
|
|
7
|
+
*
|
|
8
|
+
* Upgrades an installed Open App to a newer version, running new migrations,
|
|
9
|
+
* updating packages, and recording upgrade history.
|
|
10
|
+
*/
|
|
11
|
+
export default class AppUpgrade extends Command {
|
|
12
|
+
static { this.description = 'Upgrade an installed MJ Open App to a newer version'; }
|
|
13
|
+
static { this.examples = [
|
|
14
|
+
'<%= config.bin %> app upgrade acme-crm',
|
|
15
|
+
'<%= config.bin %> app upgrade acme-crm --version 1.3.0',
|
|
16
|
+
]; }
|
|
17
|
+
static { this.args = {
|
|
18
|
+
name: Args.string({
|
|
19
|
+
description: 'Name of the installed app to upgrade',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
}; }
|
|
23
|
+
static { this.flags = {
|
|
24
|
+
version: Flags.string({ description: 'Specific version to upgrade to (default: latest)' }),
|
|
25
|
+
verbose: Flags.boolean({ char: 'v', description: 'Show detailed output' }),
|
|
26
|
+
}; }
|
|
27
|
+
async run() {
|
|
28
|
+
const { args, flags } = await this.parse(AppUpgrade);
|
|
29
|
+
const spinner = ora();
|
|
30
|
+
try {
|
|
31
|
+
const { UpgradeApp } = await import('@memberjunction/open-app-engine');
|
|
32
|
+
const context = await buildOrchestratorContext(this, flags.verbose);
|
|
33
|
+
const result = await UpgradeApp({ AppName: args.name, Version: flags.version, Verbose: flags.verbose }, context);
|
|
34
|
+
if (result.Success) {
|
|
35
|
+
spinner.succeed(chalk.green(`Upgraded ${result.AppName} to v${result.Version}`));
|
|
36
|
+
if (result.Summary) {
|
|
37
|
+
this.log(`\n${result.Summary}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
spinner.fail(chalk.red(`Upgrade failed: ${result.ErrorMessage}`));
|
|
42
|
+
this.exit(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
spinner.fail('Upgrade failed');
|
|
47
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
+
this.error(message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../src/commands/app/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,E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,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,MAAM,CAAC,OAAO,QAAQ,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBACjF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,IAAI,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
import type { ParserOutput } from '@oclif/core/lib/interfaces/parser';
|
|
3
2
|
export default class Clean extends Command {
|
|
4
3
|
static description: string;
|
|
5
4
|
static examples: string[];
|
|
6
5
|
static flags: {
|
|
7
6
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
7
|
};
|
|
9
|
-
flags: ParserOutput<Clean>['flags'];
|
|
10
8
|
run(): Promise<void>;
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/clean/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/clean/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAoE;IAEtF,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;MAEV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyC3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import {
|
|
3
|
-
import { getValidatedConfig, getFlywayConfig } from '../../config.js';
|
|
2
|
+
import { Skyway } from '@memberjunction/skyway-core';
|
|
4
3
|
import ora from 'ora-classic';
|
|
4
|
+
import { getValidatedConfig, getSkywayConfig } from '../../config.js';
|
|
5
5
|
export default class Clean extends Command {
|
|
6
6
|
static { this.description = 'Resets the MemberJunction database to a pre-installation state'; }
|
|
7
7
|
static { this.examples = [
|
|
@@ -12,30 +12,42 @@ export default class Clean extends Command {
|
|
|
12
12
|
verbose: Flags.boolean({ char: 'v', description: 'Enable additional logging' }),
|
|
13
13
|
}; }
|
|
14
14
|
async run() {
|
|
15
|
-
const
|
|
16
|
-
this.flags = parsed.flags;
|
|
15
|
+
const { flags } = await this.parse(Clean);
|
|
17
16
|
const config = getValidatedConfig();
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (config.cleanDisabled !== false) {
|
|
18
|
+
this.error('Clean is disabled. Set cleanDisabled: false in mj.config.cjs to enable.');
|
|
19
|
+
}
|
|
20
|
+
const skywayConfig = await getSkywayConfig(config);
|
|
21
|
+
const skyway = new Skyway(skywayConfig);
|
|
20
22
|
this.log('Resetting MJ database to pre-installation state');
|
|
21
23
|
this.log('Note that users and roles have not been dropped');
|
|
22
24
|
const spinner = ora('Cleaning up...');
|
|
23
25
|
spinner.start();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
try {
|
|
27
|
+
const result = await skyway.Clean();
|
|
28
|
+
if (result.Success) {
|
|
29
|
+
spinner.succeed();
|
|
30
|
+
this.log(`The database has been reset. ${result.ObjectsDropped} objects dropped.`);
|
|
31
|
+
if (result.DroppedObjects.length > 0) {
|
|
32
|
+
this.log(`Objects dropped:\n\t- ${result.DroppedObjects.join('\n\t- ')}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
spinner.fail();
|
|
37
|
+
this.logToStderr(`\nClean failed: ${result.ErrorMessage ?? 'unknown error'}`);
|
|
38
|
+
if (flags.verbose && result.DroppedObjects.length > 0) {
|
|
39
|
+
this.logToStderr(`Partial cleanup:\n\t- ${result.DroppedObjects.join('\n\t- ')}`);
|
|
36
40
|
}
|
|
41
|
+
this.error('Command failed');
|
|
37
42
|
}
|
|
38
|
-
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
spinner.fail();
|
|
46
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
47
|
+
this.error(`Clean error: ${message}`);
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
await skyway.Close();
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/clean/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/clean/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC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BACnF,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrC,IAAI,CAAC,GAAG,CAAC,yBAAyB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBAC5E,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,WAAW,CAAC,mBAAmB,MAAM,CAAC,YAAY,IAAI,eAAe,EAAE,CAAC,CAAC;gBAC9E,IAAI,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtD,IAAI,CAAC,WAAW,CAAC,yBAAyB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACpF,CAAC;gBACD,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,IAAI,CAAC,KAAK,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;QACxC,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class V50FixEntityNames extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: {
|
|
5
|
+
description: string;
|
|
6
|
+
command: string;
|
|
7
|
+
}[];
|
|
8
|
+
static flags: {
|
|
9
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
fix: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'entity-subclasses': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=5-0-fix-entity-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-entity-names.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-entity-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;IAClD,MAAM,CAAC,WAAW,SASgF;IAElG,MAAM,CAAC,QAAQ;;;QAiBb;IAEF,MAAM,CAAC,KAAK;;;;;;MAsBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsD7B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
export default class V50FixEntityNames extends Command {
|
|
3
|
+
static { this.description = `[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.
|
|
4
|
+
|
|
5
|
+
Three strategies are applied:
|
|
6
|
+
1. Class name renames (regex) — ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema, etc.
|
|
7
|
+
2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'
|
|
8
|
+
3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,
|
|
9
|
+
navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.
|
|
10
|
+
|
|
11
|
+
The rename map (272 entries) is built from entity_subclasses.ts @RegisterClass decorators plus
|
|
12
|
+
an embedded rename map for class name prefixes. Runs in dry-run mode by default; use --fix to apply.`; }
|
|
13
|
+
static { this.examples = [
|
|
14
|
+
{
|
|
15
|
+
description: 'Dry-run scan of the packages directory',
|
|
16
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: 'Scan a single file',
|
|
20
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/components/actions-overview.component.ts',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: 'Apply fixes across the codebase',
|
|
24
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/ --fix',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
description: 'Quiet mode (summary only)',
|
|
28
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/ -q',
|
|
29
|
+
},
|
|
30
|
+
]; }
|
|
31
|
+
static { this.flags = {
|
|
32
|
+
path: Flags.string({
|
|
33
|
+
char: 'p',
|
|
34
|
+
description: 'File or directory to scan. Accepts a single .ts file or a directory (scanned recursively). Defaults to the current working directory.',
|
|
35
|
+
}),
|
|
36
|
+
fix: Flags.boolean({
|
|
37
|
+
description: 'Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.',
|
|
38
|
+
default: false,
|
|
39
|
+
}),
|
|
40
|
+
'entity-subclasses': Flags.string({
|
|
41
|
+
description: 'Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.',
|
|
42
|
+
}),
|
|
43
|
+
quiet: Flags.boolean({
|
|
44
|
+
char: 'q',
|
|
45
|
+
description: 'Suppress detailed per-file output; only show the final summary counts.',
|
|
46
|
+
default: false,
|
|
47
|
+
}),
|
|
48
|
+
verbose: Flags.boolean({
|
|
49
|
+
char: 'v',
|
|
50
|
+
description: 'Show detailed progress including each file being scanned.',
|
|
51
|
+
default: false,
|
|
52
|
+
}),
|
|
53
|
+
}; }
|
|
54
|
+
async run() {
|
|
55
|
+
const { scanEntityNames } = await import('@memberjunction/codegen-lib');
|
|
56
|
+
const { flags } = await this.parse(V50FixEntityNames);
|
|
57
|
+
const result = await scanEntityNames({
|
|
58
|
+
TargetPath: flags.path || process.cwd(),
|
|
59
|
+
Fix: flags.fix,
|
|
60
|
+
EntitySubclassesPath: flags['entity-subclasses'],
|
|
61
|
+
Verbose: flags.verbose,
|
|
62
|
+
});
|
|
63
|
+
if (!result.Success) {
|
|
64
|
+
this.error(`Scan failed:\n${result.Errors.map((e) => ` - ${e}`).join('\n')}`);
|
|
65
|
+
}
|
|
66
|
+
if (!flags.quiet) {
|
|
67
|
+
this.log(`\nScanned ${result.FilesScanned} files, found ${result.Findings.length} reference(s) needing update`);
|
|
68
|
+
this.log(`Rename map: ${result.RenameMapSize} entity name mappings loaded`);
|
|
69
|
+
if (result.Findings.length > 0) {
|
|
70
|
+
// Strategy breakdown
|
|
71
|
+
const classNameCount = result.Findings.filter((f) => f.PatternKind === 'ClassName').length;
|
|
72
|
+
const multiWordCount = result.Findings.filter((f) => f.PatternKind === 'MultiWordEntityName').length;
|
|
73
|
+
const astCount = result.Findings.length - classNameCount - multiWordCount;
|
|
74
|
+
this.log(`\n Strategy breakdown:`);
|
|
75
|
+
if (classNameCount > 0)
|
|
76
|
+
this.log(` Class name renames: ${classNameCount}`);
|
|
77
|
+
if (multiWordCount > 0)
|
|
78
|
+
this.log(` Multi-word entity names: ${multiWordCount}`);
|
|
79
|
+
if (astCount > 0)
|
|
80
|
+
this.log(` Single-word entity names: ${astCount}`);
|
|
81
|
+
// Group by file for readable output
|
|
82
|
+
const byFile = new Map();
|
|
83
|
+
for (const f of result.Findings) {
|
|
84
|
+
if (!byFile.has(f.FilePath))
|
|
85
|
+
byFile.set(f.FilePath, []);
|
|
86
|
+
byFile.get(f.FilePath).push(f);
|
|
87
|
+
}
|
|
88
|
+
for (const [file, findings] of byFile) {
|
|
89
|
+
this.log(`\n ${file}:`);
|
|
90
|
+
for (const f of findings) {
|
|
91
|
+
this.log(` Line ${f.Line}: '${f.OldName}' -> '${f.NewName}' [${f.PatternKind}]`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (flags.fix) {
|
|
96
|
+
this.log(`\nFixed ${result.FixedFiles.length} file(s)`);
|
|
97
|
+
}
|
|
98
|
+
else if (result.Findings.length > 0) {
|
|
99
|
+
this.log(`\nRun with --fix to apply these changes`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=5-0-fix-entity-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-entity-names.js","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-entity-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;aAC3C,gBAAW,GAAG;;;;;;;;;qGAS4E,CAAC;aAE3F,aAAQ,GAAG;QACd;YACI,WAAW,EAAE,wCAAwC;YACrD,OAAO,EAAE,sDAAsD;SAClE;QACD;YACI,WAAW,EAAE,oBAAoB;YACjC,OAAO,EAAE,sIAAsI;SAClJ;QACD;YACI,WAAW,EAAE,iCAAiC;YAC9C,OAAO,EAAE,4DAA4D;SACxE;QACD;YACI,WAAW,EAAE,2BAA2B;YACxC,OAAO,EAAE,yDAAyD;SACrE;KACJ,CAAC;aAEK,UAAK,GAAG;QACX,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,uIAAuI;SACvJ,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;YACf,WAAW,EAAE,sGAAsG;YACnH,OAAO,EAAE,KAAK;SACjB,CAAC;QACF,mBAAmB,EAAE,KAAK,C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CAAC,IAAI,MAAM,EAAE,CAAC;oBACpC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;oBACzB,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;wBACvB,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC;oBACxF,CAAC;gBACL,CAAC;YACL,CAAC;YAED,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;gBACZ,IAAI,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;YACxD,CAAC;QACL,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class V50FixHtmlEntityNames extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: {
|
|
5
|
+
description: string;
|
|
6
|
+
command: string;
|
|
7
|
+
}[];
|
|
8
|
+
static flags: {
|
|
9
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
fix: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'entity-subclasses': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=5-0-fix-html-entity-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-html-entity-names.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-html-entity-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACtD,MAAM,CAAC,WAAW,SAQ4C;IAE9D,MAAM,CAAC,QAAQ;;;QAiBb;IAEF,MAAM,CAAC,KAAK;;;;;;MAsBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4C7B"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
export default class V50FixHtmlEntityNames extends Command {
|
|
3
|
+
static { this.description = `[v5.0 Migration] Scan Angular HTML template files for hardcoded entity names that need "MJ: " prefix updates.
|
|
4
|
+
|
|
5
|
+
Uses targeted regex patterns to find entity name references in template expressions
|
|
6
|
+
and attribute values. Detects method calls like navigateToEntity('Actions'),
|
|
7
|
+
OpenEntityRecord('Entities', id), and attribute values like RowsEntityName="Users".
|
|
8
|
+
Runs in dry-run mode by default; use --fix to apply.
|
|
9
|
+
|
|
10
|
+
The rename map is built dynamically from entity_subclasses.ts by parsing all
|
|
11
|
+
@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).`; }
|
|
12
|
+
static { this.examples = [
|
|
13
|
+
{
|
|
14
|
+
description: 'Dry-run scan of Angular templates',
|
|
15
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/Angular/',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
description: 'Apply fixes to HTML templates',
|
|
19
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/Angular/ --fix',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
description: 'Scan with verbose output',
|
|
23
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/ -v',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
description: 'Scan a single template file',
|
|
27
|
+
command: '<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/actions-dashboard.component.html',
|
|
28
|
+
},
|
|
29
|
+
]; }
|
|
30
|
+
static { this.flags = {
|
|
31
|
+
path: Flags.string({
|
|
32
|
+
char: 'p',
|
|
33
|
+
description: 'File or directory to scan. Accepts a single .html file or a directory (scanned recursively). Defaults to the current working directory.',
|
|
34
|
+
}),
|
|
35
|
+
fix: Flags.boolean({
|
|
36
|
+
description: 'Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.',
|
|
37
|
+
default: false,
|
|
38
|
+
}),
|
|
39
|
+
'entity-subclasses': Flags.string({
|
|
40
|
+
description: 'Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.',
|
|
41
|
+
}),
|
|
42
|
+
quiet: Flags.boolean({
|
|
43
|
+
char: 'q',
|
|
44
|
+
description: 'Suppress detailed per-file output; only show the final summary counts.',
|
|
45
|
+
default: false,
|
|
46
|
+
}),
|
|
47
|
+
verbose: Flags.boolean({
|
|
48
|
+
char: 'v',
|
|
49
|
+
description: 'Show detailed progress including each file being scanned.',
|
|
50
|
+
default: false,
|
|
51
|
+
}),
|
|
52
|
+
}; }
|
|
53
|
+
async run() {
|
|
54
|
+
const { scanHtmlEntityNames } = await import('@memberjunction/codegen-lib');
|
|
55
|
+
const { flags } = await this.parse(V50FixHtmlEntityNames);
|
|
56
|
+
const result = await scanHtmlEntityNames({
|
|
57
|
+
TargetPath: flags.path || process.cwd(),
|
|
58
|
+
Fix: flags.fix,
|
|
59
|
+
EntitySubclassesPath: flags['entity-subclasses'],
|
|
60
|
+
Verbose: flags.verbose,
|
|
61
|
+
});
|
|
62
|
+
if (!result.Success) {
|
|
63
|
+
this.error(`Scan failed:\n${result.Errors.map((e) => ` - ${e}`).join('\n')}`);
|
|
64
|
+
}
|
|
65
|
+
if (!flags.quiet) {
|
|
66
|
+
this.log(`\nScanned ${result.FilesScanned} files, found ${result.Findings.length} entity name(s) needing update`);
|
|
67
|
+
this.log(`Rename map: ${result.RenameMapSize} entity name mappings loaded`);
|
|
68
|
+
if (result.Findings.length > 0) {
|
|
69
|
+
// Group by file for readable output
|
|
70
|
+
const byFile = new Map();
|
|
71
|
+
for (const f of result.Findings) {
|
|
72
|
+
if (!byFile.has(f.FilePath))
|
|
73
|
+
byFile.set(f.FilePath, []);
|
|
74
|
+
byFile.get(f.FilePath).push(f);
|
|
75
|
+
}
|
|
76
|
+
for (const [file, findings] of byFile) {
|
|
77
|
+
this.log(`\n ${file}:`);
|
|
78
|
+
for (const f of findings) {
|
|
79
|
+
this.log(` Line ${f.Line}: '${f.OldName}' -> '${f.NewName}' [${f.PatternKind}]`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (flags.fix) {
|
|
84
|
+
this.log(`\nFixed ${result.FixedFiles.length} file(s)`);
|
|
85
|
+
}
|
|
86
|
+
else if (result.Findings.length > 0) {
|
|
87
|
+
this.log(`\nRun with --fix to apply these changes`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=5-0-fix-html-entity-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-html-entity-names.js","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-html-entity-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;aAC/C,gBAAW,GAAG;;;;;;;;iEAQwC,CAAC;aAEvD,aAAQ,GAAG;QACd;YACI,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,8DAA8D;SAC1E;QACD;YACI,WAAW,EAAE,+BAA+B;YAC5C,OAAO,EAA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AK,CAAC,GAAG,EAAE,CAAC;gBACZ,IAAI,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;YACxD,CAAC;QACL,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class V50FixMetadataNames extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: {
|
|
5
|
+
description: string;
|
|
6
|
+
command: string;
|
|
7
|
+
}[];
|
|
8
|
+
static flags: {
|
|
9
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
fix: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'entity-subclasses': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=5-0-fix-metadata-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"5-0-fix-metadata-names.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/5-0-fix-metadata-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IACpD,MAAM,CAAC,WAAW,SAS4C;IAE9D,MAAM,CAAC,QAAQ;;;QAiBb;IAEF,MAAM,CAAC,KAAK;;;;;;MAsBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4C7B"}
|