@memberjunction/cli 6.3.0-edge.1 → 6.3.0-edge.2
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 +1047 -359
- package/dist/baseline/connection.d.ts.map +1 -1
- package/dist/baseline/connection.js +12 -1
- package/dist/baseline/connection.js.map +1 -1
- package/dist/commands/agent/usage.d.ts +7 -0
- package/dist/commands/agent/usage.d.ts.map +1 -0
- package/dist/commands/agent/usage.js +10 -0
- package/dist/commands/agent/usage.js.map +1 -0
- package/dist/commands/codegen/manifest.d.ts +40 -0
- package/dist/commands/codegen/manifest.d.ts.map +1 -1
- package/dist/commands/codegen/manifest.js +124 -3
- package/dist/commands/codegen/manifest.js.map +1 -1
- package/dist/commands/diag/usage.d.ts +7 -0
- package/dist/commands/diag/usage.d.ts.map +1 -0
- package/dist/commands/diag/usage.js +10 -0
- package/dist/commands/diag/usage.js.map +1 -0
- package/dist/commands/doctor/index.d.ts +6 -0
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +42 -0
- package/dist/commands/doctor/index.js.map +1 -1
- package/dist/commands/explorer/postbuild.d.ts +14 -0
- package/dist/commands/explorer/postbuild.d.ts.map +1 -0
- package/dist/commands/explorer/postbuild.js +49 -0
- package/dist/commands/explorer/postbuild.js.map +1 -0
- package/dist/commands/explorer/usage.d.ts +7 -0
- package/dist/commands/explorer/usage.d.ts.map +1 -0
- package/dist/commands/explorer/usage.js +10 -0
- package/dist/commands/explorer/usage.js.map +1 -0
- package/dist/commands/harness/account/add.d.ts +22 -0
- package/dist/commands/harness/account/add.d.ts.map +1 -0
- package/dist/commands/harness/account/add.js +100 -0
- package/dist/commands/harness/account/add.js.map +1 -0
- package/dist/commands/harness/account/clear-cooldown.d.ts +13 -0
- package/dist/commands/harness/account/clear-cooldown.d.ts.map +1 -0
- package/dist/commands/harness/account/clear-cooldown.js +32 -0
- package/dist/commands/harness/account/clear-cooldown.js.map +1 -0
- package/dist/commands/harness/account/disable.d.ts +13 -0
- package/dist/commands/harness/account/disable.d.ts.map +1 -0
- package/dist/commands/harness/account/disable.js +34 -0
- package/dist/commands/harness/account/disable.js.map +1 -0
- package/dist/commands/harness/account/enable.d.ts +13 -0
- package/dist/commands/harness/account/enable.d.ts.map +1 -0
- package/dist/commands/harness/account/enable.js +34 -0
- package/dist/commands/harness/account/enable.js.map +1 -0
- package/dist/commands/harness/account/index.d.ts +7 -0
- package/dist/commands/harness/account/index.d.ts.map +1 -0
- package/dist/commands/harness/account/index.js +23 -0
- package/dist/commands/harness/account/index.js.map +1 -0
- package/dist/commands/harness/account/list.d.ts +15 -0
- package/dist/commands/harness/account/list.d.ts.map +1 -0
- package/dist/commands/harness/account/list.js +58 -0
- package/dist/commands/harness/account/list.js.map +1 -0
- package/dist/commands/harness/account/login.d.ts +16 -0
- package/dist/commands/harness/account/login.d.ts.map +1 -0
- package/dist/commands/harness/account/login.js +50 -0
- package/dist/commands/harness/account/login.js.map +1 -0
- package/dist/commands/harness/account/remove.d.ts +14 -0
- package/dist/commands/harness/account/remove.d.ts.map +1 -0
- package/dist/commands/harness/account/remove.js +43 -0
- package/dist/commands/harness/account/remove.js.map +1 -0
- package/dist/commands/harness/account/set-strategy.d.ts +13 -0
- package/dist/commands/harness/account/set-strategy.d.ts.map +1 -0
- package/dist/commands/harness/account/set-strategy.js +38 -0
- package/dist/commands/harness/account/set-strategy.js.map +1 -0
- package/dist/commands/harness/index.d.ts +7 -0
- package/dist/commands/harness/index.d.ts.map +1 -0
- package/dist/commands/harness/index.js +22 -0
- package/dist/commands/harness/index.js.map +1 -0
- package/dist/commands/harness/usage.d.ts +7 -0
- package/dist/commands/harness/usage.d.ts.map +1 -0
- package/dist/commands/harness/usage.js +10 -0
- package/dist/commands/harness/usage.js.map +1 -0
- package/dist/commands/migrate/convert.d.ts +25 -1
- package/dist/commands/migrate/convert.d.ts.map +1 -1
- package/dist/commands/migrate/convert.js +156 -38
- package/dist/commands/migrate/convert.js.map +1 -1
- package/dist/commands/migrate/index.d.ts +8 -0
- package/dist/commands/migrate/index.d.ts.map +1 -1
- package/dist/commands/migrate/index.js +41 -2
- package/dist/commands/migrate/index.js.map +1 -1
- package/dist/commands/migrate/rebake.d.ts +13 -0
- package/dist/commands/migrate/rebake.d.ts.map +1 -1
- package/dist/commands/migrate/rebake.js +45 -6
- package/dist/commands/migrate/rebake.js.map +1 -1
- package/dist/commands/queue/export-topology.d.ts +2 -0
- package/dist/commands/queue/export-topology.d.ts.map +1 -1
- package/dist/commands/queue/export-topology.js +3 -1
- package/dist/commands/queue/export-topology.js.map +1 -1
- package/dist/commands/queue/import-bindings.d.ts +2 -0
- package/dist/commands/queue/import-bindings.d.ts.map +1 -1
- package/dist/commands/queue/import-bindings.js +3 -1
- package/dist/commands/queue/import-bindings.js.map +1 -1
- package/dist/commands/queue/index.js +1 -1
- package/dist/commands/queue/index.js.map +1 -1
- package/dist/commands/queue/sweep.d.ts +4 -6
- package/dist/commands/queue/sweep.d.ts.map +1 -1
- package/dist/commands/queue/sweep.js +15 -23
- package/dist/commands/queue/sweep.js.map +1 -1
- package/dist/commands/queue/validate-bindings.d.ts +2 -0
- package/dist/commands/queue/validate-bindings.d.ts.map +1 -1
- package/dist/commands/queue/validate-bindings.js +3 -1
- package/dist/commands/queue/validate-bindings.js.map +1 -1
- package/dist/commands/queue/work.d.ts +2 -19
- package/dist/commands/queue/work.d.ts.map +1 -1
- package/dist/commands/queue/work.js +9 -29
- package/dist/commands/queue/work.js.map +1 -1
- package/dist/commands/rubric/usage.d.ts +7 -0
- package/dist/commands/rubric/usage.d.ts.map +1 -0
- package/dist/commands/rubric/usage.js +10 -0
- package/dist/commands/rubric/usage.js.map +1 -0
- package/dist/commands/test/regression/index.d.ts.map +1 -1
- package/dist/commands/test/regression/index.js +2 -0
- package/dist/commands/test/regression/index.js.map +1 -1
- package/dist/commands/test/regression/new.d.ts +21 -0
- package/dist/commands/test/regression/new.d.ts.map +1 -0
- package/dist/commands/test/regression/new.js +82 -0
- package/dist/commands/test/regression/new.js.map +1 -0
- package/dist/commands/test/regression/up.d.ts +1 -0
- package/dist/commands/test/regression/up.d.ts.map +1 -1
- package/dist/commands/test/regression/up.js +17 -0
- package/dist/commands/test/regression/up.js.map +1 -1
- package/dist/commands/test/scripts.d.ts +6 -4
- package/dist/commands/test/scripts.d.ts.map +1 -1
- package/dist/commands/test/scripts.js +14 -0
- package/dist/commands/test/scripts.js.map +1 -1
- package/dist/commands/test/suite.d.ts +1 -0
- package/dist/commands/test/suite.d.ts.map +1 -1
- package/dist/commands/test/suite.js +6 -0
- package/dist/commands/test/suite.js.map +1 -1
- package/dist/commands/usage.js +2 -1
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/user/usage.d.ts +7 -0
- package/dist/commands/user/usage.d.ts.map +1 -0
- package/dist/commands/user/usage.js +10 -0
- package/dist/commands/user/usage.js.map +1 -0
- package/dist/config.d.ts +119 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +43 -1
- package/dist/config.js.map +1 -1
- package/dist/init-templates/citizen-builder/.env.example +1 -0
- package/dist/init-templates/citizen-builder/docker-compose.yml +2 -0
- package/dist/init-templates/citizen-builder/scripts/docker-entrypoint.sh +2 -1
- package/dist/lib/db-preflight.d.ts.map +1 -1
- package/dist/lib/db-preflight.js +22 -0
- package/dist/lib/db-preflight.js.map +1 -1
- package/dist/lib/derived-usage.d.ts +8 -0
- package/dist/lib/derived-usage.d.ts.map +1 -1
- package/dist/lib/derived-usage.js +30 -20
- package/dist/lib/derived-usage.js.map +1 -1
- package/dist/lib/domain-profiles.d.ts.map +1 -1
- package/dist/lib/domain-profiles.js +24 -0
- package/dist/lib/domain-profiles.js.map +1 -1
- package/dist/lib/domain-usage-command.js +2 -1
- package/dist/lib/domain-usage-command.js.map +1 -1
- package/dist/lib/explorer-postbuild/public-page-html.d.ts +48 -0
- package/dist/lib/explorer-postbuild/public-page-html.d.ts.map +1 -0
- package/dist/lib/explorer-postbuild/public-page-html.js +284 -0
- package/dist/lib/explorer-postbuild/public-page-html.js.map +1 -0
- package/dist/lib/explorer-postbuild/service-worker-check.d.ts +13 -0
- package/dist/lib/explorer-postbuild/service-worker-check.d.ts.map +1 -0
- package/dist/lib/explorer-postbuild/service-worker-check.js +41 -0
- package/dist/lib/explorer-postbuild/service-worker-check.js.map +1 -0
- package/dist/lib/harness-account.d.ts +34 -0
- package/dist/lib/harness-account.d.ts.map +1 -0
- package/dist/lib/harness-account.js +105 -0
- package/dist/lib/harness-account.js.map +1 -0
- package/dist/lib/pg-preflight/checks.d.ts +28 -0
- package/dist/lib/pg-preflight/checks.d.ts.map +1 -0
- package/dist/lib/pg-preflight/checks.js +94 -0
- package/dist/lib/pg-preflight/checks.js.map +1 -0
- package/dist/lib/pg-preflight/extension-check.d.ts +28 -0
- package/dist/lib/pg-preflight/extension-check.d.ts.map +1 -0
- package/dist/lib/pg-preflight/extension-check.js +86 -0
- package/dist/lib/pg-preflight/extension-check.js.map +1 -0
- package/dist/lib/pg-preflight/extension-scan.d.ts +24 -0
- package/dist/lib/pg-preflight/extension-scan.d.ts.map +1 -0
- package/dist/lib/pg-preflight/extension-scan.js +58 -0
- package/dist/lib/pg-preflight/extension-scan.js.map +1 -0
- package/dist/lib/pg-preflight/pending-migrations.d.ts +28 -0
- package/dist/lib/pg-preflight/pending-migrations.d.ts.map +1 -0
- package/dist/lib/pg-preflight/pending-migrations.js +48 -0
- package/dist/lib/pg-preflight/pending-migrations.js.map +1 -0
- package/dist/lib/pg-preflight/preflight.d.ts +18 -0
- package/dist/lib/pg-preflight/preflight.d.ts.map +1 -0
- package/dist/lib/pg-preflight/preflight.js +43 -0
- package/dist/lib/pg-preflight/preflight.js.map +1 -0
- package/dist/lib/pg-preflight/remediation.d.ts +27 -0
- package/dist/lib/pg-preflight/remediation.d.ts.map +1 -0
- package/dist/lib/pg-preflight/remediation.js +82 -0
- package/dist/lib/pg-preflight/remediation.js.map +1 -0
- package/dist/lib/pg-preflight/render.d.ts +15 -0
- package/dist/lib/pg-preflight/render.d.ts.map +1 -0
- package/dist/lib/pg-preflight/render.js +48 -0
- package/dist/lib/pg-preflight/render.js.map +1 -0
- package/dist/lib/pg-preflight/run-for-config.d.ts +23 -0
- package/dist/lib/pg-preflight/run-for-config.d.ts.map +1 -0
- package/dist/lib/pg-preflight/run-for-config.js +45 -0
- package/dist/lib/pg-preflight/run-for-config.js.map +1 -0
- package/dist/lib/pg-preflight/types.d.ts +67 -0
- package/dist/lib/pg-preflight/types.d.ts.map +1 -0
- package/dist/lib/pg-preflight/types.js +8 -0
- package/dist/lib/pg-preflight/types.js.map +1 -0
- package/dist/lib/regression/test-scaffold.d.ts +52 -0
- package/dist/lib/regression/test-scaffold.d.ts.map +1 -0
- package/dist/lib/regression/test-scaffold.js +237 -0
- package/dist/lib/regression/test-scaffold.js.map +1 -0
- package/dist/lib/work-queue/queue-format.d.ts +4 -0
- package/dist/lib/work-queue/queue-format.d.ts.map +1 -1
- package/dist/lib/work-queue/queue-format.js +15 -0
- package/dist/lib/work-queue/queue-format.js.map +1 -1
- package/dist/lib/work-queue/queue-worker.d.ts +16 -1
- package/dist/lib/work-queue/queue-worker.d.ts.map +1 -1
- package/dist/lib/work-queue/queue-worker.js +18 -0
- package/dist/lib/work-queue/queue-worker.js.map +1 -1
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +34 -0
- package/dist/light-commands.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/open-app-context.d.ts +1 -0
- package/dist/utils/open-app-context.d.ts.map +1 -1
- package/dist/utils/open-app-context.js +7 -2
- package/dist/utils/open-app-context.js.map +1 -1
- package/oclif.manifest.json +2261 -1382
- package/package.json +31 -28
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
/**
|
|
3
|
-
* Runs one sweeper pass (#6274) — lease expiry, retention and dedup purge — for deployments where no long-running host
|
|
4
|
-
* sweeps, such as MJAPI configured publish-only. Schedule it with cron.
|
|
5
|
-
*/
|
|
2
|
+
/** One sweeper pass from a host that runs no subscriptions, for a cron where no MJAPI host sweeps. */
|
|
6
3
|
export default class QueueSweep extends Command {
|
|
7
4
|
static description: string;
|
|
8
5
|
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
-
/** One line per sweeper step, or a note that the pass did nothing (a failed pass reports no steps). */
|
|
12
|
-
export declare function FormatSweepCounts(counts: Record<string, number>): string;
|
|
13
11
|
//# sourceMappingURL=sweep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/sweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"sweep.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/sweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,sGAAsG;AACtG,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,MAAM,CAAC,WAAW,SAAkI;IAEpJ,MAAM,CAAC,QAAQ,WAAyF;IAExG,MAAM,CAAC,KAAK;;MAEV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyB3B"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { IndependentProviderSource, MJWorkLogger, WorkQueueEngine, WorkQueueHost } from '@memberjunction/work-queue-engine';
|
|
3
|
+
import { FormatSweep, SweepFailed } from '../../lib/work-queue/queue-format.js';
|
|
3
4
|
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
4
|
-
/**
|
|
5
|
-
* Runs one sweeper pass (#6274) — lease expiry, retention and dedup purge — for deployments where no long-running host
|
|
6
|
-
* sweeps, such as MJAPI configured publish-only. Schedule it with cron.
|
|
7
|
-
*/
|
|
5
|
+
/** One sweeper pass from a host that runs no subscriptions, for a cron where no MJAPI host sweeps. */
|
|
8
6
|
export default class QueueSweep extends Command {
|
|
9
|
-
static { this.description = 'Run one
|
|
10
|
-
static { this.examples = ['<%= config.bin %> <%= command.id %>']; }
|
|
7
|
+
static { this.description = 'Run one sweeper pass: expire leases, purge retention and the deduplication ledger, then exit (exit code 1 when a step fails)'; }
|
|
8
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --json']; }
|
|
9
|
+
static { this.flags = {
|
|
10
|
+
json: Flags.boolean({ description: 'Print JSON instead of text', default: false }),
|
|
11
|
+
}; }
|
|
11
12
|
async run() {
|
|
13
|
+
const { flags } = await this.parse(QueueSweep);
|
|
12
14
|
const session = await OpenWorkQueueSession();
|
|
13
15
|
let failure = null;
|
|
14
16
|
try {
|
|
15
17
|
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
16
|
-
const host = new WorkQueueHost({
|
|
17
|
-
InstanceID: `mj-queue-sweep-${process.pid}`,
|
|
18
|
-
Subscriptions: [],
|
|
19
|
-
IdlePollMinMs: 250, IdlePollMaxMs: 2000, ShutdownDrainMs: 0,
|
|
20
|
-
SweeperIntervalMs: 0, ReconcileIntervalMs: 0,
|
|
21
|
-
}, WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue sweep]'), { ProviderSource: new SharedProviderSource(session.Provider) });
|
|
18
|
+
const host = new WorkQueueHost({ InstanceID: `mj-queue-sweep-${process.pid}`, Subscriptions: [], IdlePollMinMs: 250, IdlePollMaxMs: 2000, ShutdownDrainMs: 0, SweeperIntervalMs: 0, ReconcileIntervalMs: 0 }, WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue sweep]'), { ProviderSource: new IndependentProviderSource(session.Provider) });
|
|
22
19
|
const counts = await host.RunSweeperOnce();
|
|
23
|
-
this.log(
|
|
20
|
+
this.log(flags.json ? JSON.stringify(counts, null, 2) : FormatSweep(counts));
|
|
21
|
+
if (SweepFailed(counts)) {
|
|
22
|
+
failure = 'Sweeper pass failed; see the log above.';
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
26
|
failure = error instanceof Error ? error.message : String(error);
|
|
@@ -33,12 +33,4 @@ export default class QueueSweep extends Command {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
/** One line per sweeper step, or a note that the pass did nothing (a failed pass reports no steps). */
|
|
37
|
-
export function FormatSweepCounts(counts) {
|
|
38
|
-
const steps = Object.entries(counts);
|
|
39
|
-
if (steps.length === 0) {
|
|
40
|
-
return 'Sweeper pass finished; no steps reported (nothing to do, or the pass failed — see the log above).';
|
|
41
|
-
}
|
|
42
|
-
return steps.map(([step, count]) => `${step}: ${count}`).join('\n');
|
|
43
|
-
}
|
|
44
36
|
//# sourceMappingURL=sweep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep.js","sourceRoot":"","sources":["../../../src/commands/queue/sweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sweep.js","sourceRoot":"","sources":["../../../src/commands/queue/sweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC5H,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,sGAAsG;AACtG,MAAM,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CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7E,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxB,OAAO,GAAG,yCAAyC,CAAC;YACtD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import '@memberjunction/work-queue-engine/aws';
|
|
3
|
+
import '@memberjunction/work-queue-engine/azure';
|
|
4
|
+
import '@memberjunction/work-queue-engine/gcp';
|
|
3
5
|
export default class QueueValidateBindings extends Command {
|
|
4
6
|
static description: string;
|
|
5
7
|
static examples: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-bindings.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/validate-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,OAAO,uCAAuC,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACxD,MAAM,CAAC,WAAW,SAA2E;IAE7F,MAAM,CAAC,QAAQ,WAAuG;IAEtH,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB3B"}
|
|
1
|
+
{"version":3,"file":"validate-bindings.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/validate-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACxD,MAAM,CAAC,WAAW,SAA2E;IAE7F,MAAM,CAAC,QAAQ,WAAuG;IAEtH,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB3B"}
|
|
@@ -2,8 +2,10 @@ import { Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import { WorkQueueValidateBindingsOperation } from '@memberjunction/core-entities';
|
|
3
3
|
import { FormatBindingIssues, HasBindingErrors, RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
|
|
4
4
|
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
-
// Registers the 'AWS' transport driver
|
|
5
|
+
// Registers the 'AWS', 'Azure', and 'GCP' transport driver factories and manifest enrichers for this command only (work-queue 03 §0).
|
|
6
6
|
import '@memberjunction/work-queue-engine/aws';
|
|
7
|
+
import '@memberjunction/work-queue-engine/azure';
|
|
8
|
+
import '@memberjunction/work-queue-engine/gcp';
|
|
7
9
|
export default class QueueValidateBindings extends Command {
|
|
8
10
|
static { this.description = 'Validate work-queue topology and cloud bindings; exits 1 on any error'; }
|
|
9
11
|
static { this.examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --transport AWS-prod']; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-bindings.js","sourceRoot":"","sources":["../../../src/commands/queue/validate-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAA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AAC,EAAE,aAAa,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9J,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;YAC5E,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACnG,IAAI,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpC,OAAO,GAAG,qCAAqC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC"}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
import type { WorkQueueProviderSource } from '@memberjunction/work-queue-engine';
|
|
3
|
-
import type { DatabaseProviderBase } from '@memberjunction/core';
|
|
4
2
|
import '@memberjunction/work-queue-engine/aws';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** Long-running mode: re-plan subscriptions; MJAPI's default (`workQueue.reconcileIntervalMs`). */
|
|
8
|
-
export declare const DEFAULT_RECONCILE_INTERVAL_MS = 30000;
|
|
9
|
-
/**
|
|
10
|
-
* The host timers for a run: none for a one-shot container job (it neither sweeps nor re-plans), the flag values for a
|
|
11
|
-
* long-running worker, which otherwise would never re-plan and, with MJAPI publish-only, leave nothing to purge.
|
|
12
|
-
*/
|
|
13
|
-
export declare function QueueWorkTimers(once: boolean, sweeperIntervalMs: number, reconcileIntervalMs: number): {
|
|
14
|
-
SweeperIntervalMs: number;
|
|
15
|
-
ReconcileIntervalMs: number;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* One provider for every delivery at concurrency 1; a connection-scoped provider per delivery above that, so parallel
|
|
19
|
-
* handlers do not share transaction state (#6273).
|
|
20
|
-
*/
|
|
21
|
-
export declare function QueueWorkProviderSource(provider: DatabaseProviderBase, concurrency: number): WorkQueueProviderSource;
|
|
3
|
+
import '@memberjunction/work-queue-engine/azure';
|
|
4
|
+
import '@memberjunction/work-queue-engine/gcp';
|
|
22
5
|
export default class QueueWork extends Command {
|
|
23
6
|
static description: string;
|
|
24
7
|
static examples: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC;AAK/C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAA8F;IAEhH,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;MAUV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB1B,0HAA0H;YAC5G,OAAO;YAgBP,cAAc;CAW7B"}
|
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { IndependentProviderSource, MJWorkLogger,
|
|
2
|
+
import { IndependentProviderSource, MJWorkLogger, WorkQueueEngine, WorkQueueHost } from '@memberjunction/work-queue-engine';
|
|
3
3
|
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
4
|
-
import { RunUntilStopped, WorkerStartFailure } from '../../lib/work-queue/queue-worker.js';
|
|
5
|
-
// Registers the 'AWS' transport driver
|
|
4
|
+
import { BuildWorkerHostConfig, RunUntilStopped, WorkerStartFailure } from '../../lib/work-queue/queue-worker.js';
|
|
5
|
+
// Registers the 'AWS', 'Azure', and 'GCP' transport driver factories and manifest enrichers for this command only (work-queue 03 §0).
|
|
6
6
|
import '@memberjunction/work-queue-engine/aws';
|
|
7
|
+
import '@memberjunction/work-queue-engine/azure';
|
|
8
|
+
import '@memberjunction/work-queue-engine/gcp';
|
|
7
9
|
const DEFAULT_IDLE_EXIT_MS = 5000;
|
|
8
10
|
const DEFAULT_SHUTDOWN_DRAIN_MS = 30000;
|
|
9
|
-
/** Long-running mode: retention and dedup purge, as MJAPI's sweeper does (#6274). */
|
|
10
|
-
export const DEFAULT_SWEEPER_INTERVAL_MS = 300000;
|
|
11
|
-
/** Long-running mode: re-plan subscriptions; MJAPI's default (`workQueue.reconcileIntervalMs`). */
|
|
12
|
-
export const DEFAULT_RECONCILE_INTERVAL_MS = 30000;
|
|
13
|
-
/**
|
|
14
|
-
* The host timers for a run: none for a one-shot container job (it neither sweeps nor re-plans), the flag values for a
|
|
15
|
-
* long-running worker, which otherwise would never re-plan and, with MJAPI publish-only, leave nothing to purge.
|
|
16
|
-
*/
|
|
17
|
-
export function QueueWorkTimers(once, sweeperIntervalMs, reconcileIntervalMs) {
|
|
18
|
-
return once ? { SweeperIntervalMs: 0, ReconcileIntervalMs: 0 } : { SweeperIntervalMs: sweeperIntervalMs, ReconcileIntervalMs: reconcileIntervalMs };
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* One provider for every delivery at concurrency 1; a connection-scoped provider per delivery above that, so parallel
|
|
22
|
-
* handlers do not share transaction state (#6273).
|
|
23
|
-
*/
|
|
24
|
-
export function QueueWorkProviderSource(provider, concurrency) {
|
|
25
|
-
return concurrency > 1 ? new IndependentProviderSource(provider) : new SharedProviderSource(provider);
|
|
26
|
-
}
|
|
27
11
|
export default class QueueWork extends Command {
|
|
28
12
|
static { this.description = 'Run work-queue subscriptions in this process: once for a container job, or until stopped'; }
|
|
29
13
|
static { this.examples = [
|
|
@@ -39,8 +23,8 @@ export default class QueueWork extends Command {
|
|
|
39
23
|
'max-duration-ms': Flags.integer({ description: "With --once: stop claiming after this long and drain (keep it below the scheduler's job deadline)", min: 1000, dependsOn: ['once'] }),
|
|
40
24
|
concurrency: Flags.integer({ description: 'Handlers in flight per subscription', default: 1, min: 1 }),
|
|
41
25
|
'shutdown-drain-ms': Flags.integer({ description: 'How long in-flight handlers get to finish on exit; the drain can take twice this', default: DEFAULT_SHUTDOWN_DRAIN_MS, min: 0 }),
|
|
42
|
-
'sweeper-interval-ms': Flags.integer({ description: '
|
|
43
|
-
'reconcile-interval-ms': Flags.integer({ description: '
|
|
26
|
+
'sweeper-interval-ms': Flags.integer({ description: 'Lease expiry and retention purge interval; 0 disables. Default 60000 long-running, 0 with --once', min: 0 }),
|
|
27
|
+
'reconcile-interval-ms': Flags.integer({ description: 'Re-planning interval; 0 plans only at start. Default 30000 long-running, 0 with --once', min: 0 }),
|
|
44
28
|
}; }
|
|
45
29
|
async run() {
|
|
46
30
|
const { flags } = await this.parse(QueueWork);
|
|
@@ -48,12 +32,8 @@ export default class QueueWork extends Command {
|
|
|
48
32
|
let failure = null;
|
|
49
33
|
try {
|
|
50
34
|
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Subscriptions: [{ Name: flags.subscription, Concurrency: flags.concurrency }],
|
|
54
|
-
IdlePollMinMs: 250, IdlePollMaxMs: 2000, ShutdownDrainMs: flags['shutdown-drain-ms'],
|
|
55
|
-
...QueueWorkTimers(flags.once, flags['sweeper-interval-ms'], flags['reconcile-interval-ms']),
|
|
56
|
-
}, WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue work]'), { ProviderSource: QueueWorkProviderSource(session.Provider, flags.concurrency) });
|
|
35
|
+
// One provider per delivery: handlers that open transactions must never share one (#6273).
|
|
36
|
+
const host = new WorkQueueHost(BuildWorkerHostConfig(flags, process.pid), WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue work]'), { ProviderSource: new IndependentProviderSource(session.Provider) });
|
|
57
37
|
failure = flags.once ? await this.runOnce(host, flags) : await this.runUntilSignal(host, flags.subscription);
|
|
58
38
|
}
|
|
59
39
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work.js","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"work.js","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAE5H,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAClH,sIAAsI;AACtI,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC;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AAkB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;QACrE,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,WAAW,SAAS,mCAAmC,CAAC,CAAC;QAClE,MAAM,eAAe,CAAC,IAAI,EAAE,IAAI,OAAO,CAAO,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `rubric` domain (`mj rubric usage`). */
|
|
3
|
+
export default class RubricUsage extends DomainUsageCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
protected Domain: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/rubric/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,gEAAgE;AAChE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,kBAAkB;IACvD,MAAM,CAAC,WAAW,SAAmF;IACrG,SAAS,CAAC,MAAM,SAAY;CAC/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `rubric` domain (`mj rubric usage`). */
|
|
3
|
+
export default class RubricUsage extends DomainUsageCommand {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.Domain = 'rubric';
|
|
7
|
+
}
|
|
8
|
+
static { this.description = 'Show usage, flags, examples, and runtime hints for every `mj rubric` command.'; }
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/commands/rubric/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,gEAAgE;AAChE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,kBAAkB;IAA3D;;QAEc,WAAM,GAAG,QAAQ,CAAC;IAChC,CAAC;aAFU,gBAAW,GAAG,+EAA+E,AAAlF,CAAmF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAC4D;IAE9E,MAAM,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAC4D;IAE9E,MAAM,CAAC,QAAQ,WAUb;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB3B"}
|
|
@@ -10,6 +10,7 @@ export default class TestRegression extends Command {
|
|
|
10
10
|
'<%= config.bin %> <%= command.id %> export # Export a run as a portable standalone HTML',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> remote --target=staging-mj # Mode B/C/D against a remote URL',
|
|
12
12
|
'<%= config.bin %> <%= command.id %> init generic-web # Scaffold one of the example dirs',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> new --name "..." --goal "..." --criteria "..." --priority P1 # Add a test to the suite',
|
|
13
14
|
]; }
|
|
14
15
|
async run() {
|
|
15
16
|
this.log('MJ Explorer Regression Test Suite\n');
|
|
@@ -22,6 +23,7 @@ export default class TestRegression extends Command {
|
|
|
22
23
|
this.log(' mj test regression export Export a run as a portable standalone HTML report');
|
|
23
24
|
this.log(' mj test regression remote --target=X Run against a remote URL (Mode B/C/D)');
|
|
24
25
|
this.log(' mj test regression init <name> Scaffold a starter example into the cwd');
|
|
26
|
+
this.log(' mj test regression new Add a new test file + suite member (no database)');
|
|
25
27
|
this.log('');
|
|
26
28
|
this.log('Most subcommands shell out to docker compose using the regression stack at');
|
|
27
29
|
this.log('docker/regression/. `init` works both inside the monorepo (copies locally) and');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aAC1C,gBAAW,GAChB,2EAA2E,CAAC;aAEvE,aAAQ,GAAG;QAChB,8FAA8F;QAC9F,gGAAgG;QAChG,8EAA8E;QAC9E,kFAAkF;QAClF,gFAAgF;QAChF,6FAA6F;QAC7F,mGAAmG;QACnG,oGAAoG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aAC1C,gBAAW,GAChB,2EAA2E,CAAC;aAEvE,aAAQ,GAAG;QAChB,8FAA8F;QAC9F,gGAAgG;QAChG,8EAA8E;QAC9E,kFAAkF;QAClF,gFAAgF;QAChF,6FAA6F;QAC7F,mGAAmG;QACnG,oGAAoG;QACpG,6HAA6H;KAC9H,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,sFAAsF,CAAC,CAAC;QACjG,IAAI,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;QAC7F,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;QAC9F,IAAI,CAAC,GAAG,CAAC,wFAAwF,CAAC,CAAC;QACnG,IAAI,CAAC,GAAG,CAAC,2FAA2F,CAAC,CAAC;QACtG,IAAI,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC1F,IAAI,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC5F,IAAI,CAAC,GAAG,CAAC,0FAA0F,CAAC,CAAC;QACrG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;QAC3F,IAAI,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC5F,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACtF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegressionNew extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
goal: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
criteria: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
priority: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
tags: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
'start-path': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
description: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'max-steps': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
from: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
'dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
private writeAndCheck;
|
|
19
|
+
private logNextSteps;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=new.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAa7C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;IACpD,MAAM,CAAC,WAAW,SAAkF;IAEpG,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;MAWV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAkCZ,aAAa;IAgB3B,OAAO,CAAC,YAAY;CAQrB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { RequireMonorepoRoot, SpawnInherit } from '../../../lib/regression/docker-helpers.js';
|
|
4
|
+
import { BuildScaffold, IsRegressionPriority, ParseTestNumber, REGRESSION_PARITY_SCRIPT, REGRESSION_SUITE_FILE, WriteScaffold, } from '../../../lib/regression/test-scaffold.js';
|
|
5
|
+
export default class TestRegressionNew extends Command {
|
|
6
|
+
static { this.description = 'Create a new MJ Explorer regression test and add it to the regression suite.'; }
|
|
7
|
+
static { this.examples = [
|
|
8
|
+
`<%= config.bin %> <%= command.id %> --name "Form builder clones a form" --priority P1 --tags form-builder \\
|
|
9
|
+
--start-path /app/form-builder --goal "Clone Contact Form and verify the copy opens in the editor." \\
|
|
10
|
+
--criteria "A form named Copy of Contact Form is listed" --criteria "The form editor is open on the copy"`,
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --name "..." --goal "..." --criteria "..." --priority P2 --from T149 --dry-run',
|
|
12
|
+
]; }
|
|
13
|
+
static { this.flags = {
|
|
14
|
+
name: Flags.string({ description: 'Test title, without the T### prefix. Must not contain "&".', required: true }),
|
|
15
|
+
goal: Flags.string({ description: 'What the agent must achieve, stated as the success state.', required: true }),
|
|
16
|
+
criteria: Flags.string({ description: 'A judge criterion (repeat the flag for more).', required: true, multiple: true }),
|
|
17
|
+
priority: Flags.string({ description: 'Release priority.', required: true, options: ['P0', 'P1', 'P2', 'P3'] }),
|
|
18
|
+
tags: Flags.string({ description: 'Comma-separated area tags, e.g. form-builder,crud.', default: '' }),
|
|
19
|
+
'start-path': Flags.string({ description: 'Path after http://localhost:4200, e.g. /app/form-builder.', default: '' }),
|
|
20
|
+
description: Flags.string({ description: 'Test description. Defaults to the goal.' }),
|
|
21
|
+
'max-steps': Flags.integer({ description: 'Controller step limit.', default: 25, min: 1 }),
|
|
22
|
+
from: Flags.string({ description: 'Copy Configuration from this test number, e.g. T149.' }),
|
|
23
|
+
'dry-run': Flags.boolean({ description: 'Print the files without writing them.', default: false }),
|
|
24
|
+
}; }
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(TestRegressionNew);
|
|
27
|
+
RequireMonorepoRoot();
|
|
28
|
+
const priority = flags.priority;
|
|
29
|
+
if (!IsRegressionPriority(priority))
|
|
30
|
+
this.error(`Unknown priority ${priority}.`);
|
|
31
|
+
const repoRoot = process.cwd();
|
|
32
|
+
let result;
|
|
33
|
+
try {
|
|
34
|
+
result = BuildScaffold(repoRoot, {
|
|
35
|
+
Title: flags.name,
|
|
36
|
+
Goal: flags.goal,
|
|
37
|
+
Criteria: flags.criteria,
|
|
38
|
+
Priority: priority,
|
|
39
|
+
Tags: flags.tags.split(','),
|
|
40
|
+
StartPath: flags['start-path'],
|
|
41
|
+
MaxSteps: flags['max-steps'],
|
|
42
|
+
Description: flags.description,
|
|
43
|
+
FromNumber: flags.from === undefined ? undefined : ParseTestNumber(flags.from),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
this.error(e instanceof Error ? e.message : String(e));
|
|
48
|
+
}
|
|
49
|
+
if (flags['dry-run']) {
|
|
50
|
+
this.log(`# ${result.TestFilePath}\n${result.TestFileContent}`);
|
|
51
|
+
this.log(`# ${REGRESSION_SUITE_FILE}: new member "${result.Name}" at Sequence ${result.Sequence}`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await this.writeAndCheck(repoRoot, result);
|
|
55
|
+
this.logNextSteps(result);
|
|
56
|
+
}
|
|
57
|
+
async writeAndCheck(repoRoot, result) {
|
|
58
|
+
try {
|
|
59
|
+
WriteScaffold(repoRoot, result);
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
this.error(e instanceof Error ? e.message : String(e));
|
|
63
|
+
}
|
|
64
|
+
this.log(`✓ Created ${result.Name}`);
|
|
65
|
+
this.log(` ${result.TestFilePath}`);
|
|
66
|
+
this.log(` Suite member added to ${REGRESSION_SUITE_FILE} at Sequence ${result.Sequence}`);
|
|
67
|
+
if (existsSync(REGRESSION_PARITY_SCRIPT)) {
|
|
68
|
+
const code = await SpawnInherit('node', [REGRESSION_PARITY_SCRIPT]);
|
|
69
|
+
if (code !== 0)
|
|
70
|
+
this.error('The regression suite parity check failed. Fix the problems listed above.');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
logNextSteps(result) {
|
|
74
|
+
const testNumber = result.Name.split(' ')[0];
|
|
75
|
+
this.log('\nNext steps:');
|
|
76
|
+
this.log(' 1. Read the new file and sharpen the goal and criteria.');
|
|
77
|
+
this.log(' 2. Load it into your database: pnpm mj sync push --dir=metadata-optional/regression-test');
|
|
78
|
+
this.log(` 3. Run it: pnpm mj test run --name "${result.Name}"`);
|
|
79
|
+
this.log(` If another PR takes ${testNumber} before yours merges, renumber this test after you rebase.`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=new.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,GAEd,MAAM,0CAA0C,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;aAC7C,gBAAW,GAAG,8EAA8E,CAAC;aAE7F,aAAQ,GAAG;QAChB;;4GAEwG;QACxG,oHAAoH;KACrH,CAAC;aAEK,UAAK,GAAG;QACb,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,QAA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M,CAAC,IAAI,GAAG,CAAC,CAAC;QAClE,IAAI,CAAC,GAAG,CAAC,yBAAyB,UAAU,4DAA4D,CAAC,CAAC;IAC5G,CAAC"}
|
|
@@ -7,6 +7,7 @@ export default class TestRegressionUp extends Command {
|
|
|
7
7
|
bacpac: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
8
|
'bacpac-no-upgrade': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
9
|
suite: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
test: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
11
|
metadata: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
12
|
image: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
13
|
'explorer-image': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAa7C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,OAAO;IACnD,MAAM,CAAC,WAAW,SAGuC;IAEzD,MAAM,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAa7C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,OAAO;IACnD,MAAM,CAAC,WAAW,SAGuC;IAEzD,MAAM,CAAC,QAAQ,WAMb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;MAgBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB1B,yEAAyE;YAC3D,aAAa;IAiC3B,qFAAqF;YACvE,WAAW;CA6C1B"}
|
|
@@ -9,6 +9,7 @@ export default class TestRegressionUp extends Command {
|
|
|
9
9
|
static { this.examples = [
|
|
10
10
|
'<%= config.bin %> <%= command.id %>',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --detach',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --test="T001 - Login Smoke" --test="T002 - Data Explorer Open Record"',
|
|
12
13
|
'<%= config.bin %> <%= command.id %> --bacpac=./db.bacpac --suite="My Suite" --metadata=./my-suite-metadata',
|
|
13
14
|
'<%= config.bin %> <%= command.id %> --bacpac=./db.bacpac --bacpac-no-upgrade',
|
|
14
15
|
]; }
|
|
@@ -20,6 +21,10 @@ export default class TestRegressionUp extends Command {
|
|
|
20
21
|
default: false,
|
|
21
22
|
}),
|
|
22
23
|
suite: Flags.string({ description: 'Test suite to run (TEST_SUITE_NAME). Use with --bacpac + --metadata.' }),
|
|
24
|
+
test: Flags.string({
|
|
25
|
+
description: 'Run only this suite test, by exact name (TEST_NAMES). Repeat the flag to run more than one. Monorepo stack only.',
|
|
26
|
+
multiple: true,
|
|
27
|
+
}),
|
|
23
28
|
metadata: Flags.string({ description: 'Directory of your test + test-suite metadata (pushed before the run). Requires --bacpac.' }),
|
|
24
29
|
image: Flags.string({ description: '(external) Published agentic-test-runner image. Default: ' + AGENTIC_TEST_RUNNER_IMAGE + '.' }),
|
|
25
30
|
'explorer-image': Flags.string({ description: '(external bacpac) Published Explorer image (prerequisite). Default: memberjunction/explorer:latest.' }),
|
|
@@ -30,6 +35,10 @@ export default class TestRegressionUp extends Command {
|
|
|
30
35
|
if ((flags['bacpac-no-upgrade'] || flags.metadata) && !flags.bacpac) {
|
|
31
36
|
this.error('--bacpac-no-upgrade and --metadata require --bacpac.');
|
|
32
37
|
}
|
|
38
|
+
const withComma = (flags.test ?? []).filter((name) => name.includes(','));
|
|
39
|
+
if (withComma.length > 0) {
|
|
40
|
+
this.error(`--test names cannot contain a comma, because TEST_NAMES is comma-separated: ${withComma.join('; ')}`);
|
|
41
|
+
}
|
|
33
42
|
if (IsInsideMonorepo()) {
|
|
34
43
|
await this.runInMonorepo(flags);
|
|
35
44
|
}
|
|
@@ -63,6 +72,11 @@ export default class TestRegressionUp extends Command {
|
|
|
63
72
|
childEnv.TEST_SUITE_NAME = flags.suite;
|
|
64
73
|
this.log(` Suite: ${flags.suite}`);
|
|
65
74
|
}
|
|
75
|
+
const testNames = flags.test ?? [];
|
|
76
|
+
if (testNames.length > 0) {
|
|
77
|
+
childEnv.TEST_NAMES = testNames.join(',');
|
|
78
|
+
this.log(` Tests: ${testNames.join(', ')}`);
|
|
79
|
+
}
|
|
66
80
|
const composeArgs = DockerComposeArgs('full', ['up'], overlays);
|
|
67
81
|
if (flags.detach)
|
|
68
82
|
composeArgs.push('-d');
|
|
@@ -72,6 +86,9 @@ export default class TestRegressionUp extends Command {
|
|
|
72
86
|
}
|
|
73
87
|
/** Outside the monorepo: only --bacpac is supported (published-image full stack). */
|
|
74
88
|
async runExternal(flags) {
|
|
89
|
+
if (flags.test) {
|
|
90
|
+
this.error('--test works only with the monorepo stack.');
|
|
91
|
+
}
|
|
75
92
|
if (!flags.bacpac) {
|
|
76
93
|
this.error('Plain `up` boots the full self-contained MJ stack built from source — monorepo-only.\n' +
|
|
77
94
|
' Outside the monorepo, use `up --bacpac=<file>` (published-image stack) or ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,Q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: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
promote: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
discard: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
test: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
promote: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
discard: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
|
+
yes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
format: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
12
|
};
|
|
11
13
|
run(): Promise<void>;
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../src/commands/test/scripts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../src/commands/test/scripts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,MAAM,CAAC,WAAW,SAGkE;IAEpF,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;MAwBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB3B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { TEST_FORMAT_FLAG, TEST_FORMAT_MAP, ResolveLegacyFormat } from '../../lib/format-compat.js';
|
|
2
3
|
export default class TestScripts extends Command {
|
|
3
4
|
static { this.description = 'Review and promote recorded replay scripts. A run that re-derives a test which already had a ' +
|
|
4
5
|
'script stores the new one as pending rather than replacing what replay uses, so a UI change ' +
|
|
@@ -9,6 +10,7 @@ export default class TestScripts extends Command {
|
|
|
9
10
|
'<%= config.bin %> <%= command.id %> --promote --test "T042 - Filter Grid"',
|
|
10
11
|
'<%= config.bin %> <%= command.id %> --promote --yes',
|
|
11
12
|
'<%= config.bin %> <%= command.id %> --discard --test "T042 - Filter Grid"',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --format=md --output=drift.md',
|
|
12
14
|
]; }
|
|
13
15
|
static { this.flags = {
|
|
14
16
|
test: Flags.string({
|
|
@@ -29,6 +31,11 @@ export default class TestScripts extends Command {
|
|
|
29
31
|
description: 'Confirm a bulk --promote/--discard that was not narrowed with --test',
|
|
30
32
|
default: false,
|
|
31
33
|
}),
|
|
34
|
+
format: TEST_FORMAT_FLAG,
|
|
35
|
+
output: Flags.string({
|
|
36
|
+
char: 'o',
|
|
37
|
+
description: 'Write the pending-script report to this file',
|
|
38
|
+
}),
|
|
32
39
|
}; }
|
|
33
40
|
async run() {
|
|
34
41
|
const { flags } = await this.parse(TestScripts);
|
|
@@ -40,6 +47,13 @@ export default class TestScripts extends Command {
|
|
|
40
47
|
promote: flags.promote,
|
|
41
48
|
discard: flags.discard,
|
|
42
49
|
yes: flags.yes,
|
|
50
|
+
format: ResolveLegacyFormat({
|
|
51
|
+
Format: flags.format,
|
|
52
|
+
Legacy: 'console',
|
|
53
|
+
LegacyDefault: 'console',
|
|
54
|
+
Map: TEST_FORMAT_MAP,
|
|
55
|
+
}),
|
|
56
|
+
output: flags.output,
|
|
43
57
|
});
|
|
44
58
|
}
|
|
45
59
|
catch (error) {
|