@memberjunction/cli 2.116.0 → 2.118.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.
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const testing_cli_1 = require("@memberjunction/testing-cli");
5
+ class TestHistory extends core_1.Command {
6
+ static description = 'View test execution history';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --test=<test-id>',
10
+ '<%= config.bin %> <%= command.id %> --suite=<suite-id>',
11
+ '<%= config.bin %> <%= command.id %> --since="2024-01-01"',
12
+ '<%= config.bin %> <%= command.id %> --limit=50',
13
+ ];
14
+ static flags = {
15
+ test: core_1.Flags.string({
16
+ char: 't',
17
+ description: 'Filter by test ID',
18
+ }),
19
+ recent: core_1.Flags.integer({
20
+ char: 'r',
21
+ description: 'Number of recent runs to show',
22
+ }),
23
+ from: core_1.Flags.string({
24
+ description: 'Show history from date (YYYY-MM-DD)',
25
+ }),
26
+ status: core_1.Flags.string({
27
+ char: 's',
28
+ description: 'Filter by status',
29
+ }),
30
+ format: core_1.Flags.string({
31
+ char: 'f',
32
+ description: 'Output format',
33
+ options: ['console', 'json', 'markdown'],
34
+ default: 'console',
35
+ }),
36
+ output: core_1.Flags.string({
37
+ char: 'o',
38
+ description: 'Output file path',
39
+ }),
40
+ verbose: core_1.Flags.boolean({
41
+ char: 'v',
42
+ description: 'Show detailed information',
43
+ default: false,
44
+ }),
45
+ };
46
+ async run() {
47
+ const { flags } = await this.parse(TestHistory);
48
+ try {
49
+ // Create HistoryCommand instance and execute
50
+ // Context user will be fetched internally after MJ provider initialization
51
+ const historyCommand = new testing_cli_1.HistoryCommand();
52
+ await historyCommand.execute(flags.test, {
53
+ recent: flags.recent,
54
+ from: flags.from,
55
+ status: flags.status,
56
+ format: flags.format,
57
+ output: flags.output,
58
+ verbose: flags.verbose,
59
+ });
60
+ }
61
+ catch (error) {
62
+ this.error(error);
63
+ }
64
+ }
65
+ }
66
+ exports.default = TestHistory;
@@ -0,0 +1,6 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Test extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ class Test extends core_1.Command {
5
+ static description = 'MemberJunction Testing Framework - Execute and manage tests';
6
+ static examples = [
7
+ '<%= config.bin %> <%= command.id %> run <test-id>',
8
+ '<%= config.bin %> <%= command.id %> run --name="Active Members Count"',
9
+ '<%= config.bin %> <%= command.id %> suite <suite-id>',
10
+ '<%= config.bin %> <%= command.id %> list',
11
+ '<%= config.bin %> <%= command.id %> list --suites',
12
+ '<%= config.bin %> <%= command.id %> validate --all',
13
+ ];
14
+ async run() {
15
+ this.log('MemberJunction Testing Framework\n');
16
+ this.log('Available commands:');
17
+ this.log(' mj test run <test-id> - Execute a single test');
18
+ this.log(' mj test suite <suite-id> - Execute a test suite');
19
+ this.log(' mj test list - List available tests');
20
+ this.log(' mj test validate - Validate test definitions');
21
+ this.log(' mj test history - View test execution history');
22
+ this.log(' mj test compare - Compare test runs for regressions');
23
+ this.log('');
24
+ this.log('Legacy commands (file-based evals):');
25
+ this.log(' mj test eval <eval-id> - Run file-based AI evaluation');
26
+ this.log(' mj test report --type=eval - Generate eval report');
27
+ this.log('');
28
+ this.log('Run "mj test COMMAND --help" for more information on a command.');
29
+ }
30
+ }
31
+ exports.default = Test;
@@ -0,0 +1,16 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class TestList extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ suites: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ types: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ tag: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const testing_cli_1 = require("@memberjunction/testing-cli");
5
+ class TestList extends core_1.Command {
6
+ static description = 'List available tests, suites, and types';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --suites',
10
+ '<%= config.bin %> <%= command.id %> --types',
11
+ '<%= config.bin %> <%= command.id %> --type=agent-eval',
12
+ '<%= config.bin %> <%= command.id %> --tag=smoke',
13
+ '<%= config.bin %> <%= command.id %> --status=active --verbose',
14
+ ];
15
+ static flags = {
16
+ suites: core_1.Flags.boolean({
17
+ description: 'List test suites instead of tests',
18
+ default: false,
19
+ }),
20
+ types: core_1.Flags.boolean({
21
+ description: 'List test types',
22
+ default: false,
23
+ }),
24
+ type: core_1.Flags.string({
25
+ char: 't',
26
+ description: 'Filter by test type',
27
+ }),
28
+ tag: core_1.Flags.string({
29
+ description: 'Filter by tag',
30
+ }),
31
+ status: core_1.Flags.string({
32
+ char: 's',
33
+ description: 'Filter by status',
34
+ }),
35
+ format: core_1.Flags.string({
36
+ char: 'f',
37
+ description: 'Output format',
38
+ options: ['console', 'json', 'markdown'],
39
+ default: 'console',
40
+ }),
41
+ output: core_1.Flags.string({
42
+ char: 'o',
43
+ description: 'Output file path',
44
+ }),
45
+ verbose: core_1.Flags.boolean({
46
+ char: 'v',
47
+ description: 'Show detailed information',
48
+ default: false,
49
+ }),
50
+ };
51
+ async run() {
52
+ const { flags } = await this.parse(TestList);
53
+ try {
54
+ // Create ListCommand instance and execute
55
+ // Context user will be fetched internally after MJ provider initialization
56
+ const listCommand = new testing_cli_1.ListCommand();
57
+ await listCommand.execute({
58
+ suites: flags.suites,
59
+ types: flags.types,
60
+ type: flags.type,
61
+ tag: flags.tag,
62
+ status: flags.status,
63
+ format: flags.format,
64
+ output: flags.output,
65
+ verbose: flags.verbose,
66
+ });
67
+ }
68
+ catch (error) {
69
+ this.error(error);
70
+ }
71
+ }
72
+ }
73
+ exports.default = TestList;
@@ -0,0 +1,17 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class TestRun extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ testId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const testing_cli_1 = require("@memberjunction/testing-cli");
5
+ class TestRun extends core_1.Command {
6
+ static description = 'Execute a single test by ID or name';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> <test-id>',
9
+ '<%= config.bin %> <%= command.id %> --name="Active Members Count"',
10
+ '<%= config.bin %> <%= command.id %> <test-id> --environment=staging',
11
+ '<%= config.bin %> <%= command.id %> <test-id> --format=json --output=results.json',
12
+ '<%= config.bin %> <%= command.id %> <test-id> --dry-run',
13
+ ];
14
+ static args = {
15
+ testId: core_1.Args.string({
16
+ description: 'Test ID to execute',
17
+ required: false,
18
+ }),
19
+ };
20
+ static flags = {
21
+ name: core_1.Flags.string({
22
+ char: 'n',
23
+ description: 'Test name to execute',
24
+ }),
25
+ environment: core_1.Flags.string({
26
+ char: 'e',
27
+ description: 'Environment context (dev, staging, prod)',
28
+ }),
29
+ format: core_1.Flags.string({
30
+ char: 'f',
31
+ description: 'Output format',
32
+ options: ['console', 'json', 'markdown'],
33
+ default: 'console',
34
+ }),
35
+ output: core_1.Flags.string({
36
+ char: 'o',
37
+ description: 'Output file path',
38
+ }),
39
+ 'dry-run': core_1.Flags.boolean({
40
+ description: 'Validate without executing',
41
+ default: false,
42
+ }),
43
+ verbose: core_1.Flags.boolean({
44
+ char: 'v',
45
+ description: 'Show detailed execution information',
46
+ default: false,
47
+ }),
48
+ };
49
+ async run() {
50
+ const { args, flags } = await this.parse(TestRun);
51
+ try {
52
+ // Create RunCommand instance and execute
53
+ // Context user will be fetched internally after MJ provider initialization
54
+ const runCommand = new testing_cli_1.RunCommand();
55
+ await runCommand.execute(args.testId, {
56
+ name: flags.name,
57
+ environment: flags.environment,
58
+ format: flags.format,
59
+ output: flags.output,
60
+ dryRun: flags['dry-run'],
61
+ verbose: flags.verbose,
62
+ });
63
+ }
64
+ catch (error) {
65
+ this.error(error);
66
+ }
67
+ }
68
+ }
69
+ exports.default = TestRun;
@@ -0,0 +1,15 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class TestSuite extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ suiteId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const testing_cli_1 = require("@memberjunction/testing-cli");
5
+ class TestSuite extends core_1.Command {
6
+ static description = 'Execute a test suite';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> <suite-id>',
9
+ '<%= config.bin %> <%= command.id %> --name="Agent Quality Suite"',
10
+ '<%= config.bin %> <%= command.id %> <suite-id> --format=json',
11
+ '<%= config.bin %> <%= command.id %> <suite-id> --output=suite-results.json',
12
+ ];
13
+ static args = {
14
+ suiteId: core_1.Args.string({
15
+ description: 'Test suite ID to execute',
16
+ required: false,
17
+ }),
18
+ };
19
+ static flags = {
20
+ name: core_1.Flags.string({
21
+ char: 'n',
22
+ description: 'Test suite name to execute',
23
+ }),
24
+ format: core_1.Flags.string({
25
+ char: 'f',
26
+ description: 'Output format',
27
+ options: ['console', 'json', 'markdown'],
28
+ default: 'console',
29
+ }),
30
+ output: core_1.Flags.string({
31
+ char: 'o',
32
+ description: 'Output file path',
33
+ }),
34
+ verbose: core_1.Flags.boolean({
35
+ char: 'v',
36
+ description: 'Show detailed execution information',
37
+ default: false,
38
+ }),
39
+ };
40
+ async run() {
41
+ const { args, flags } = await this.parse(TestSuite);
42
+ try {
43
+ // Create SuiteCommand instance and execute
44
+ // Context user will be fetched internally after MJ provider initialization
45
+ const suiteCommand = new testing_cli_1.SuiteCommand();
46
+ await suiteCommand.execute(args.suiteId, {
47
+ name: flags.name,
48
+ format: flags.format,
49
+ output: flags.output,
50
+ verbose: flags.verbose,
51
+ });
52
+ }
53
+ catch (error) {
54
+ this.error(error);
55
+ }
56
+ }
57
+ }
58
+ exports.default = TestSuite;
@@ -0,0 +1,17 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class TestValidate extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ testId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'save-report': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const testing_cli_1 = require("@memberjunction/testing-cli");
5
+ class TestValidate extends core_1.Command {
6
+ static description = 'Validate test definitions without executing';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> <test-id>',
9
+ '<%= config.bin %> <%= command.id %> --all',
10
+ '<%= config.bin %> <%= command.id %> --type=agent-eval',
11
+ '<%= config.bin %> <%= command.id %> --all --save-report',
12
+ '<%= config.bin %> <%= command.id %> --all --output=validation-report.md',
13
+ ];
14
+ static args = {
15
+ testId: core_1.Args.string({
16
+ description: 'Test ID to validate',
17
+ required: false,
18
+ }),
19
+ };
20
+ static flags = {
21
+ all: core_1.Flags.boolean({
22
+ char: 'a',
23
+ description: 'Validate all tests',
24
+ default: false,
25
+ }),
26
+ type: core_1.Flags.string({
27
+ char: 't',
28
+ description: 'Validate tests by type',
29
+ }),
30
+ 'save-report': core_1.Flags.boolean({
31
+ description: 'Save validation report to file',
32
+ default: false,
33
+ }),
34
+ format: core_1.Flags.string({
35
+ char: 'f',
36
+ description: 'Output format',
37
+ options: ['console', 'json', 'markdown'],
38
+ default: 'console',
39
+ }),
40
+ output: core_1.Flags.string({
41
+ char: 'o',
42
+ description: 'Output file path',
43
+ }),
44
+ verbose: core_1.Flags.boolean({
45
+ char: 'v',
46
+ description: 'Show detailed information',
47
+ default: false,
48
+ }),
49
+ };
50
+ async run() {
51
+ const { args, flags } = await this.parse(TestValidate);
52
+ try {
53
+ // Create ValidateCommand instance and execute
54
+ // Context user will be fetched internally after MJ provider initialization
55
+ const validateCommand = new testing_cli_1.ValidateCommand();
56
+ await validateCommand.execute(args.testId, {
57
+ all: flags.all,
58
+ type: flags.type,
59
+ saveReport: flags['save-report'],
60
+ format: flags.format,
61
+ output: flags.output,
62
+ verbose: flags.verbose,
63
+ });
64
+ }
65
+ catch (error) {
66
+ this.error(error);
67
+ }
68
+ }
69
+ }
70
+ exports.default = TestValidate;