@memberjunction/cli 6.2.0-edge.1 → 6.2.0-edge.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent/init.d.ts +12 -0
- package/dist/commands/agent/init.d.ts.map +1 -1
- package/dist/commands/agent/init.js +42 -8
- package/dist/commands/agent/init.js.map +1 -1
- package/dist/commands/migrate/convert.d.ts.map +1 -1
- package/dist/commands/migrate/convert.js +15 -1
- package/dist/commands/migrate/convert.js.map +1 -1
- package/dist/commands/migrate/rebake.d.ts.map +1 -1
- package/dist/commands/migrate/rebake.js +7 -0
- package/dist/commands/migrate/rebake.js.map +1 -1
- package/dist/commands/queue/backlog.d.ts +11 -0
- package/dist/commands/queue/backlog.d.ts.map +1 -0
- package/dist/commands/queue/backlog.js +32 -0
- package/dist/commands/queue/backlog.js.map +1 -0
- package/dist/commands/queue/dead-letters.d.ts +13 -0
- package/dist/commands/queue/dead-letters.d.ts.map +1 -0
- package/dist/commands/queue/dead-letters.js +35 -0
- package/dist/commands/queue/dead-letters.js.map +1 -0
- package/dist/commands/queue/discard.d.ts +12 -0
- package/dist/commands/queue/discard.d.ts.map +1 -0
- package/dist/commands/queue/discard.js +45 -0
- package/dist/commands/queue/discard.js.map +1 -0
- package/dist/commands/queue/export-topology.d.ts +12 -0
- package/dist/commands/queue/export-topology.d.ts.map +1 -0
- package/dist/commands/queue/export-topology.js +40 -0
- package/dist/commands/queue/export-topology.js.map +1 -0
- package/dist/commands/queue/import-bindings.d.ts +14 -0
- package/dist/commands/queue/import-bindings.d.ts.map +1 -0
- package/dist/commands/queue/import-bindings.js +41 -0
- package/dist/commands/queue/import-bindings.js.map +1 -0
- package/dist/commands/queue/index.d.ts +7 -0
- package/dist/commands/queue/index.d.ts.map +1 -0
- package/dist/commands/queue/index.js +25 -0
- package/dist/commands/queue/index.js.map +1 -0
- package/dist/commands/queue/partitions.d.ts +14 -0
- package/dist/commands/queue/partitions.d.ts.map +1 -0
- package/dist/commands/queue/partitions.js +36 -0
- package/dist/commands/queue/partitions.js.map +1 -0
- package/dist/commands/queue/publish.d.ts +35 -0
- package/dist/commands/queue/publish.d.ts.map +1 -0
- package/dist/commands/queue/publish.js +94 -0
- package/dist/commands/queue/publish.js.map +1 -0
- package/dist/commands/queue/replay.d.ts +12 -0
- package/dist/commands/queue/replay.d.ts.map +1 -0
- package/dist/commands/queue/replay.js +42 -0
- package/dist/commands/queue/replay.js.map +1 -0
- package/dist/commands/queue/stats.d.ts +11 -0
- package/dist/commands/queue/stats.d.ts.map +1 -0
- package/dist/commands/queue/stats.js +35 -0
- package/dist/commands/queue/stats.js.map +1 -0
- package/dist/commands/queue/usage.d.ts +7 -0
- package/dist/commands/queue/usage.d.ts.map +1 -0
- package/dist/commands/queue/usage.js +10 -0
- package/dist/commands/queue/usage.js.map +1 -0
- package/dist/commands/queue/validate-bindings.d.ts +12 -0
- package/dist/commands/queue/validate-bindings.d.ts.map +1 -0
- package/dist/commands/queue/validate-bindings.js +37 -0
- package/dist/commands/queue/validate-bindings.js.map +1 -0
- package/dist/commands/queue/work.d.ts +20 -0
- package/dist/commands/queue/work.d.ts.map +1 -0
- package/dist/commands/queue/work.js +77 -0
- package/dist/commands/queue/work.js.map +1 -0
- package/dist/commands/rubric/diff.d.ts +11 -0
- package/dist/commands/rubric/diff.d.ts.map +1 -0
- package/dist/commands/rubric/diff.js +20 -0
- package/dist/commands/rubric/diff.js.map +1 -0
- package/dist/commands/rubric/evaluate.d.ts +15 -0
- package/dist/commands/rubric/evaluate.d.ts.map +1 -0
- package/dist/commands/rubric/evaluate.js +28 -0
- package/dist/commands/rubric/evaluate.js.map +1 -0
- package/dist/commands/rubric/index.d.ts +6 -0
- package/dist/commands/rubric/index.d.ts.map +1 -0
- package/dist/commands/rubric/index.js +13 -0
- package/dist/commands/rubric/index.js.map +1 -0
- package/dist/commands/rubric/list.d.ts +6 -0
- package/dist/commands/rubric/list.d.ts.map +1 -0
- package/dist/commands/rubric/list.js +14 -0
- package/dist/commands/rubric/list.js.map +1 -0
- package/dist/commands/rubric/show.d.ts +9 -0
- package/dist/commands/rubric/show.d.ts.map +1 -0
- package/dist/commands/rubric/show.js +16 -0
- package/dist/commands/rubric/show.js.map +1 -0
- package/dist/commands/rubric/validate.d.ts +9 -0
- package/dist/commands/rubric/validate.d.ts.map +1 -0
- package/dist/commands/rubric/validate.js +16 -0
- package/dist/commands/rubric/validate.js.map +1 -0
- package/dist/commands/test/index.d.ts.map +1 -1
- package/dist/commands/test/index.js +2 -0
- package/dist/commands/test/index.js.map +1 -1
- package/dist/commands/test/promote-criteria.d.ts +10 -0
- package/dist/commands/test/promote-criteria.d.ts.map +1 -0
- package/dist/commands/test/promote-criteria.js +25 -0
- package/dist/commands/test/promote-criteria.js.map +1 -0
- package/dist/commands/test/report.d.ts +9 -0
- package/dist/commands/test/report.d.ts.map +1 -0
- package/dist/commands/test/report.js +18 -0
- package/dist/commands/test/report.js.map +1 -0
- package/dist/commands/test/run.d.ts +1 -0
- package/dist/commands/test/run.d.ts.map +1 -1
- package/dist/commands/test/run.js +4 -0
- package/dist/commands/test/run.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 +4 -0
- package/dist/commands/test/suite.js.map +1 -1
- package/dist/hooks/postrun.d.ts +1 -1
- package/dist/init-templates/citizen-builder/.env.example +6 -0
- package/dist/init-templates/citizen-builder/docker/Dockerfile +10 -2
- package/dist/init-templates/citizen-builder/docker-compose.yml +6 -0
- package/dist/init-templates/citizen-builder/scripts/docker-entrypoint.sh +56 -20
- package/dist/lib/domain-profiles.d.ts.map +1 -1
- package/dist/lib/domain-profiles.js +4 -0
- package/dist/lib/domain-profiles.js.map +1 -1
- package/dist/lib/work-queue/queue-format.d.ts +17 -0
- package/dist/lib/work-queue/queue-format.d.ts.map +1 -0
- package/dist/lib/work-queue/queue-format.js +125 -0
- package/dist/lib/work-queue/queue-format.js.map +1 -0
- package/dist/lib/work-queue/queue-session.d.ts +9 -0
- package/dist/lib/work-queue/queue-session.d.ts.map +1 -0
- package/dist/lib/work-queue/queue-session.js +8 -0
- package/dist/lib/work-queue/queue-session.js.map +1 -0
- package/dist/lib/work-queue/queue-worker.d.ts +24 -0
- package/dist/lib/work-queue/queue-worker.d.ts.map +1 -0
- package/dist/lib/work-queue/queue-worker.js +50 -0
- package/dist/lib/work-queue/queue-worker.js.map +1 -0
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +3 -0
- package/dist/light-commands.js.map +1 -1
- package/dist/utils/open-app-context.d.ts +6 -0
- package/dist/utils/open-app-context.d.ts.map +1 -1
- package/dist/utils/open-app-context.js +3 -3
- package/dist/utils/open-app-context.js.map +1 -1
- package/oclif.manifest.json +3522 -2581
- package/package.json +24 -22
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import { Command, Flags } from '@oclif/core';
|
|
3
|
+
import { WorkQueueEngine } from '@memberjunction/work-queue-engine';
|
|
4
|
+
// Registers the 'AWS' transport driver factory and manifest enricher for this command only (work-queue 03 §0).
|
|
5
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
6
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
7
|
+
export default class QueueExportTopology extends Command {
|
|
8
|
+
static { this.description = 'Write the topology manifest for one transport (input to the Terraform module)'; }
|
|
9
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %> --transport AWS-prod --output infrastructure/work-queue/manifest.json']; }
|
|
10
|
+
static { this.flags = {
|
|
11
|
+
transport: Flags.string({ char: 't', description: 'Transport name', required: true }),
|
|
12
|
+
output: Flags.string({ char: 'o', description: 'File to write; stdout when omitted' }),
|
|
13
|
+
}; }
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(QueueExportTopology);
|
|
16
|
+
const session = await OpenWorkQueueSession();
|
|
17
|
+
let failure = null;
|
|
18
|
+
try {
|
|
19
|
+
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
20
|
+
const manifest = JSON.stringify(WorkQueueEngine.Instance.ExportManifest(flags.transport), null, 2);
|
|
21
|
+
if (flags.output) {
|
|
22
|
+
await writeFile(flags.output, `${manifest}\n`, 'utf8');
|
|
23
|
+
this.log(`Wrote ${flags.output}`);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.log(manifest);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
await session.Close();
|
|
34
|
+
}
|
|
35
|
+
if (failure) {
|
|
36
|
+
this.error(failure, { exit: 1 });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=export-topology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-topology.js","sourceRoot":"","sources":["../../../src/commands/queue/export-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,+GAA+G;AAC/G,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;aAC/C,gBAAW,GAAG,+EAA+E,CAAC;aAE9F,aAAQ,GAAG,CAAC,2GAA2G,CAAC,CAAC;aAEzH,UAAK,GAAG;QACb,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACrF,MAAM,E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nC,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
3
|
+
export default class QueueImportBindings extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
file: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=import-bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-bindings.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/import-bindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAGnD,OAAO,uCAAuC,CAAC;AAI/C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IACtD,MAAM,CAAC,WAAW,SAA8F;IAEhH,MAAM,CAAC,QAAQ,WAA0H;IAEzI,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,KAAK;;MAEV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB3B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
3
|
+
import { WorkQueueEngine } from '@memberjunction/work-queue-engine';
|
|
4
|
+
// Registers the 'AWS' transport driver factory and manifest enricher for this command only (work-queue 03 §0).
|
|
5
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
6
|
+
import { FormatBindingIssues, HasBindingErrors, ParseBindingImport } from '../../lib/work-queue/queue-format.js';
|
|
7
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
8
|
+
export default class QueueImportBindings extends Command {
|
|
9
|
+
static { this.description = 'Record cloud resource bindings (Terraform output) on work-queue topics and subscriptions'; }
|
|
10
|
+
static { this.examples = ['terraform output -json mj_work_queue_bindings > bindings.json && <%= config.bin %> <%= command.id %> bindings.json']; }
|
|
11
|
+
static { this.args = {
|
|
12
|
+
file: Args.string({ description: 'BindingImport JSON file', required: true }),
|
|
13
|
+
}; }
|
|
14
|
+
static { this.flags = {
|
|
15
|
+
json: Flags.boolean({ description: 'Print issues as JSON', default: false }),
|
|
16
|
+
}; }
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(QueueImportBindings);
|
|
19
|
+
const session = await OpenWorkQueueSession();
|
|
20
|
+
let failure = null;
|
|
21
|
+
try {
|
|
22
|
+
const bindings = ParseBindingImport(await readFile(args.file, 'utf8'));
|
|
23
|
+
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
24
|
+
const issues = await WorkQueueEngine.Instance.ImportBindings(bindings, session.User);
|
|
25
|
+
this.log(flags.json ? JSON.stringify(issues, null, 2) : FormatBindingIssues(issues));
|
|
26
|
+
if (HasBindingErrors(issues)) {
|
|
27
|
+
failure = 'Binding import reported errors.';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await session.Close();
|
|
35
|
+
}
|
|
36
|
+
if (failure) {
|
|
37
|
+
this.error(failure, { exit: 1 });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=import-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-bindings.js","sourceRoot":"","sources":["../../../src/commands/queue/import-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,O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E,OAAO,CAAC,IAAI,CAAC,CAAC;YACrF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;YACrF,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7B,OAAO,GAAG,iCAAiC,CAAC;YAC9C,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAoC;IAEtD,MAAM,CAAC,QAAQ,WAIb;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAe3B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Queue extends Command {
|
|
3
|
+
static { this.description = 'Operate the durable work queue'; }
|
|
4
|
+
static { this.examples = [
|
|
5
|
+
'<%= config.bin %> <%= command.id %> publish --topic samples.hello --payload \'{"name":"Paul"}\'',
|
|
6
|
+
'<%= config.bin %> <%= command.id %> stats',
|
|
7
|
+
'<%= config.bin %> <%= command.id %> dead-letters --subscription email.unsubscribe',
|
|
8
|
+
]; }
|
|
9
|
+
async run() {
|
|
10
|
+
this.log('MemberJunction Work Queue\n');
|
|
11
|
+
this.log(' mj queue publish - Publish test messages to a topic from this machine');
|
|
12
|
+
this.log(' mj queue stats - Counts per subscription');
|
|
13
|
+
this.log(" mj queue dead-letters - List a subscription's dead letters");
|
|
14
|
+
this.log(' mj queue partitions - List in-flight / blocked partition keys');
|
|
15
|
+
this.log(' mj queue replay - Replay one dead letter');
|
|
16
|
+
this.log(' mj queue discard - Discard a pending or dead-lettered delivery, or cancel one in flight');
|
|
17
|
+
this.log(' mj queue backlog - The autoscaler metric for one subscription');
|
|
18
|
+
this.log(' mj queue work - Run subscriptions here: --once for a container job, or until stopped');
|
|
19
|
+
this.log(' mj queue export-topology - Write the topology manifest for Terraform');
|
|
20
|
+
this.log(' mj queue import-bindings - Record cloud resource bindings from Terraform output');
|
|
21
|
+
this.log(' mj queue validate-bindings - Check topology and cloud bindings');
|
|
22
|
+
this.log('\nRun "mj queue COMMAND --help" for details.');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/queue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;aACjC,gBAAW,GAAG,gCAAgC,CAAC;aAE/C,aAAQ,GAAG;QAChB,iGAAiG;QACjG,2CAA2C;QAC3C,mFAAmF;KACpF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,uFAAuF,CAAC,CAAC;QAClG,IAAI,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;QACvE,IAAI,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;QAClF,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,yGAAyG,CAAC,CAAC;QACpH,IAAI,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC1F,IAAI,CAAC,GAAG,CAAC,yGAAyG,CAAC,CAAC;QACpH,IAAI,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC;QACzF,IAAI,CAAC,GAAG,CAAC,yFAAyF,CAAC,CAAC;QACpG,IAAI,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;QACjF,IAAI,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC3D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class QueuePartitions extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
condition: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
cursor: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
'page-size': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=partitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partitions.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/partitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,MAAM,CAAC,WAAW,SAA0E;IAE5F,MAAM,CAAC,QAAQ,WAAgG;IAE/G,MAAM,CAAC,KAAK;;;;;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { WorkQueueListPartitionsOperation } from '@memberjunction/core-entities';
|
|
3
|
+
import { FormatPartitions, PARTITION_CONDITION_OPTIONS, RequireOperationOutput, ToPartitionCondition } from '../../lib/work-queue/queue-format.js';
|
|
4
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
+
export default class QueuePartitions extends Command {
|
|
6
|
+
static { this.description = "List a work-queue subscription's in-flight or blocked partition keys"; }
|
|
7
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %> --subscription integration.apply --condition Blocked']; }
|
|
8
|
+
static { this.flags = {
|
|
9
|
+
subscription: Flags.string({ char: 's', description: 'Subscription name', required: true }),
|
|
10
|
+
condition: Flags.string({ description: 'Only keys in this condition', options: [...PARTITION_CONDITION_OPTIONS] }),
|
|
11
|
+
cursor: Flags.string({ description: 'nextCursor from a previous page' }),
|
|
12
|
+
'page-size': Flags.integer({ description: 'Items per page (1–500)', default: 50 }),
|
|
13
|
+
json: Flags.boolean({ description: 'Print JSON instead of a table', default: false }),
|
|
14
|
+
}; }
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(QueuePartitions);
|
|
17
|
+
const session = await OpenWorkQueueSession();
|
|
18
|
+
let failure = null;
|
|
19
|
+
try {
|
|
20
|
+
const input = { subscriptionName: flags.subscription, condition: ToPartitionCondition(flags.condition), cursor: flags.cursor, pageSize: flags['page-size'] };
|
|
21
|
+
const result = await new WorkQueueListPartitionsOperation().Execute(input, { provider: session.Provider, user: session.User });
|
|
22
|
+
const output = RequireOperationOutput(result, 'WorkQueue.ListPartitions');
|
|
23
|
+
this.log(flags.json ? JSON.stringify(output, null, 2) : FormatPartitions(output));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
await session.Close();
|
|
30
|
+
}
|
|
31
|
+
if (failure) {
|
|
32
|
+
this.error(failure, { exit: 1 });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=partitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partitions.js","sourceRoot":"","sources":["../../../src/commands/queue/partitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACnJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;aAC3C,gBAAW,GAAG,sEAAsE,CAAC;aAErF,aAAQ,GAAG,CAAC,0FAA0F,CAAC,CAAC;aAExG,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC3F,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,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AAC;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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import type { PublishRequest, PublishResult, WorkJson } from '@memberjunction/work-queue-core';
|
|
3
|
+
/** Turns `key=value` flags into message attributes; the first `=` splits, so values may contain `=`. */
|
|
4
|
+
export declare function ParseAttributes(pairs: string[] | undefined): Record<string, string>;
|
|
5
|
+
/** Parses the --payload JSON; any JSON value is a legal payload, an object is the useful one. */
|
|
6
|
+
export declare function ParsePayload(json: string): WorkJson;
|
|
7
|
+
export interface PublishFlags {
|
|
8
|
+
Payload: WorkJson;
|
|
9
|
+
PartitionKey?: string;
|
|
10
|
+
DedupKey?: string;
|
|
11
|
+
Attributes: Record<string, string>;
|
|
12
|
+
Count: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One request per copy. With --count above 1 each copy carries a `sequence` attribute (1-based) so the copies can
|
|
16
|
+
* be told apart in logs and dead-letter lists; a --dedup-key applies to the first copy only, since the ledger
|
|
17
|
+
* would (correctly) report every later copy as a Duplicate.
|
|
18
|
+
*/
|
|
19
|
+
export declare function BuildPublishRequests(flags: PublishFlags): PublishRequest[];
|
|
20
|
+
export declare function FormatPublishResults(results: PublishResult[]): string;
|
|
21
|
+
export default class QueuePublish extends Command {
|
|
22
|
+
static description: string;
|
|
23
|
+
static examples: string[];
|
|
24
|
+
static flags: {
|
|
25
|
+
topic: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
26
|
+
payload: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
27
|
+
'partition-key': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
28
|
+
'dedup-key': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
29
|
+
attribute: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
30
|
+
count: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
31
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
32
|
+
};
|
|
33
|
+
run(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAK/F,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUnF;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAMnD;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,QAAQ,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,EAAE,CAc1E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CAKrE;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAC/C,MAAM,CAAC,WAAW,SAAkG;IAEpH,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B3B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { WorkQueueEngine } from '@memberjunction/work-queue-engine';
|
|
3
|
+
import { FormatTable } from '../../lib/work-queue/queue-format.js';
|
|
4
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
+
/** Turns `key=value` flags into message attributes; the first `=` splits, so values may contain `=`. */
|
|
6
|
+
export function ParseAttributes(pairs) {
|
|
7
|
+
const attributes = {};
|
|
8
|
+
for (const pair of pairs ?? []) {
|
|
9
|
+
const separator = pair.indexOf('=');
|
|
10
|
+
if (separator <= 0) {
|
|
11
|
+
throw new Error(`--attribute expects key=value, got '${pair}'`);
|
|
12
|
+
}
|
|
13
|
+
attributes[pair.slice(0, separator)] = pair.slice(separator + 1);
|
|
14
|
+
}
|
|
15
|
+
return attributes;
|
|
16
|
+
}
|
|
17
|
+
/** Parses the --payload JSON; any JSON value is a legal payload, an object is the useful one. */
|
|
18
|
+
export function ParsePayload(json) {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(json);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error(`--payload is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* One request per copy. With --count above 1 each copy carries a `sequence` attribute (1-based) so the copies can
|
|
28
|
+
* be told apart in logs and dead-letter lists; a --dedup-key applies to the first copy only, since the ledger
|
|
29
|
+
* would (correctly) report every later copy as a Duplicate.
|
|
30
|
+
*/
|
|
31
|
+
export function BuildPublishRequests(flags) {
|
|
32
|
+
return Array.from({ length: flags.Count }, (_, index) => {
|
|
33
|
+
const request = { Payload: flags.Payload, Attributes: { ...flags.Attributes } };
|
|
34
|
+
if (flags.Count > 1) {
|
|
35
|
+
request.Attributes = { ...request.Attributes, sequence: String(index + 1) };
|
|
36
|
+
}
|
|
37
|
+
if (flags.PartitionKey !== undefined) {
|
|
38
|
+
request.PartitionKey = flags.PartitionKey;
|
|
39
|
+
}
|
|
40
|
+
if (flags.DedupKey !== undefined && index === 0) {
|
|
41
|
+
request.DeduplicationKey = flags.DedupKey;
|
|
42
|
+
}
|
|
43
|
+
return request;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export function FormatPublishResults(results) {
|
|
47
|
+
return FormatTable(['#', 'Message ID', 'Status', 'Error'], results.map((result, index) => [String(index + 1), result.MessageID, result.Status, result.Error ? `${result.Error.Code}: ${result.Error.Message}` : '']));
|
|
48
|
+
}
|
|
49
|
+
export default class QueuePublish extends Command {
|
|
50
|
+
static { this.description = 'Publish messages to a work-queue topic from this machine through MJ code (no API key needed)'; }
|
|
51
|
+
static { this.examples = [
|
|
52
|
+
'<%= config.bin %> <%= command.id %> --topic samples.hello --payload \'{"name":"Paul"}\'',
|
|
53
|
+
'<%= config.bin %> <%= command.id %> --topic samples.hello --payload \'{"sleepMs":60000}\' --partition-key customer-42',
|
|
54
|
+
'<%= config.bin %> <%= command.id %> --topic samples.hello --count 5 --partition-key k1 --attribute source=demo',
|
|
55
|
+
]; }
|
|
56
|
+
static { this.flags = {
|
|
57
|
+
topic: Flags.string({ char: 't', description: 'Topic name', required: true }),
|
|
58
|
+
payload: Flags.string({ char: 'p', description: 'Message payload as JSON', default: '{}' }),
|
|
59
|
+
'partition-key': Flags.string({ char: 'k', description: 'PartitionKey for Exclusive / Ordered subscriptions' }),
|
|
60
|
+
'dedup-key': Flags.string({ description: 'DeduplicationKey: a repeat within the topic TTL is reported as Duplicate' }),
|
|
61
|
+
attribute: Flags.string({ char: 'a', description: 'Message attribute as key=value (repeatable)', multiple: true }),
|
|
62
|
+
count: Flags.integer({ char: 'n', description: 'How many copies to publish in one batch', default: 1, min: 1 }),
|
|
63
|
+
json: Flags.boolean({ description: 'Print the publish results as JSON', default: false }),
|
|
64
|
+
}; }
|
|
65
|
+
async run() {
|
|
66
|
+
const { flags } = await this.parse(QueuePublish);
|
|
67
|
+
const requests = BuildPublishRequests({
|
|
68
|
+
Payload: ParsePayload(flags.payload), PartitionKey: flags['partition-key'], DedupKey: flags['dedup-key'],
|
|
69
|
+
Attributes: ParseAttributes(flags.attribute), Count: flags.count,
|
|
70
|
+
});
|
|
71
|
+
const session = await OpenWorkQueueSession();
|
|
72
|
+
let failure = null;
|
|
73
|
+
let rejected = 0;
|
|
74
|
+
try {
|
|
75
|
+
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
76
|
+
const results = await WorkQueueEngine.Instance.PublishAs(flags.topic, requests, { ContextUser: session.User });
|
|
77
|
+
rejected = results.filter(result => result.Status === 'Rejected').length;
|
|
78
|
+
this.log(flags.json ? JSON.stringify(results, null, 2) : FormatPublishResults(results));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
await session.Close();
|
|
85
|
+
}
|
|
86
|
+
if (failure) {
|
|
87
|
+
this.error(failure, { exit: 1 });
|
|
88
|
+
}
|
|
89
|
+
if (rejected > 0) {
|
|
90
|
+
this.error(`${rejected} of ${requests.length} message(s) were rejected`, { exit: 1 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/commands/queue/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,wGAAwG;AACxG,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,GAAG,CAAC,CAAC;QAClE,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAa,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5G,CAAC;AACH,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,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,CAAC,GAAG,QAAQ,OAAO,QAAQ,CAAC,MAAM,2BAA2B,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class QueueReplay extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
delivery: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
note: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,MAAM,CAAC,WAAW,SAAkD;IAEpE,MAAM,CAAC,QAAQ,WAAmH;IAElI,MAAM,CAAC,KAAK;;;;MAIV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB3B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { WorkQueueReplayDeadLetterOperation } from '@memberjunction/core-entities';
|
|
3
|
+
import { RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
|
|
4
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
+
export default class QueueReplay extends Command {
|
|
6
|
+
static { this.description = 'Replay one dead-lettered work-queue delivery'; }
|
|
7
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %> --subscription integration.apply --delivery <id> --note "mapping fixed"']; }
|
|
8
|
+
static { this.flags = {
|
|
9
|
+
subscription: Flags.string({ char: 's', description: 'Subscription name', required: true }),
|
|
10
|
+
delivery: Flags.string({ char: 'd', description: 'DeliveryID from `mj queue dead-letters`', required: true }),
|
|
11
|
+
note: Flags.string({ description: 'Operator note stored with the resolution' }),
|
|
12
|
+
}; }
|
|
13
|
+
async run() {
|
|
14
|
+
const { flags } = await this.parse(QueueReplay);
|
|
15
|
+
const session = await OpenWorkQueueSession();
|
|
16
|
+
let failure = null;
|
|
17
|
+
try {
|
|
18
|
+
const input = { subscriptionName: flags.subscription, deliveryID: flags.delivery, note: flags.note };
|
|
19
|
+
const result = await new WorkQueueReplayDeadLetterOperation().Execute(input, { provider: session.Provider, user: session.User });
|
|
20
|
+
const output = RequireOperationOutput(result, 'WorkQueue.ReplayDeadLetter');
|
|
21
|
+
if (!output.supported) {
|
|
22
|
+
failure = "This subscription's transport cannot replay a single dead letter.";
|
|
23
|
+
}
|
|
24
|
+
else if (!output.replayed) {
|
|
25
|
+
failure = 'Nothing replayed: the delivery does not exist or is not dead-lettered.';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.log(`Replayed ${flags.delivery}.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
await session.Close();
|
|
36
|
+
}
|
|
37
|
+
if (failure) {
|
|
38
|
+
this.error(failure, { exit: 1 });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../../src/commands/queue/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;aACvC,gBAAW,GAAG,8CAA8C,CAAC;aAE7D,aAAQ,GAAG,CAAC,6GAA6G,CAAC,CAAC;aAE3H,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC3F,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC7G,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;KAChF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAC7C,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,EAAE,gBAAgB,EAAE,KAAK,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACrG,MAAM,MAAM,GAAG,MAAM,IAAI,kCAAkC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACjI,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;YAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;gBACtB,OAAO,GAAG,mEAAmE,CAAC;YAChF,CAAC;iBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC5B,OAAO,GAAG,wEAAwE,CAAC;YACrF,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC1C,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class QueueStats extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,MAAM,CAAC,WAAW,SAAmF;IAErG,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { WorkQueueGetSubscriptionStatsOperation } from '@memberjunction/core-entities';
|
|
3
|
+
import { FormatStatsTable, RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
|
|
4
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
+
export default class QueueStats extends Command {
|
|
6
|
+
static { this.description = 'Show pending, in-flight and dead-lettered counts for work-queue subscriptions'; }
|
|
7
|
+
static { this.examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --subscription email.unsubscribe --json',
|
|
10
|
+
]; }
|
|
11
|
+
static { this.flags = {
|
|
12
|
+
subscription: Flags.string({ char: 's', description: 'Subscription name; omit for every subscription' }),
|
|
13
|
+
json: Flags.boolean({ description: 'Print JSON instead of a table', default: false }),
|
|
14
|
+
}; }
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(QueueStats);
|
|
17
|
+
const session = await OpenWorkQueueSession();
|
|
18
|
+
let failure = null;
|
|
19
|
+
try {
|
|
20
|
+
const result = await new WorkQueueGetSubscriptionStatsOperation().Execute({ subscriptionName: flags.subscription }, { provider: session.Provider, user: session.User });
|
|
21
|
+
const output = RequireOperationOutput(result, 'WorkQueue.GetSubscriptionStats');
|
|
22
|
+
this.log(flags.json ? JSON.stringify(output, null, 2) : FormatStatsTable(output.subscriptions, output.failures));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
await session.Close();
|
|
29
|
+
}
|
|
30
|
+
if (failure) {
|
|
31
|
+
this.error(failure, { exit: 1 });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/commands/queue/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;aACtC,gBAAW,GAAG,+EAA+E,CAAC;aAE9F,aAAQ,GAAG;QAChB,qCAAqC;QACrC,6EAA6E;KAC9E,CAAC;aAEK,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;QACxG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KACtF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAC7C,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,sCAAsC,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACxK,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;YAChF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnH,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `queue` domain (`mj queue usage`). */
|
|
3
|
+
export default class QueueUsage 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/queue/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,kBAAkB;IACxD,MAAM,CAAC,WAAW,SAAkF;IACpG,SAAS,CAAC,MAAM,SAAW;CAC5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `queue` domain (`mj queue usage`). */
|
|
3
|
+
export default class QueueUsage extends DomainUsageCommand {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.Domain = 'queue';
|
|
7
|
+
}
|
|
8
|
+
static { this.description = 'Show usage, flags, examples, and runtime hints for every `mj queue` command.'; }
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/commands/queue/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,kBAAkB;IAA1D;;QAEY,WAAM,GAAG,OAAO,CAAC;IAC7B,CAAC;aAFQ,gBAAW,GAAG,8EAA8E,AAAjF,CAAkF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
3
|
+
export default class QueueValidateBindings extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
transport: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=validate-bindings.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { WorkQueueValidateBindingsOperation } from '@memberjunction/core-entities';
|
|
3
|
+
import { FormatBindingIssues, HasBindingErrors, RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
|
|
4
|
+
import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
|
|
5
|
+
// Registers the 'AWS' transport driver factory and manifest enricher for this command only (work-queue 03 §0).
|
|
6
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
7
|
+
export default class QueueValidateBindings extends Command {
|
|
8
|
+
static { this.description = 'Validate work-queue topology and cloud bindings; exits 1 on any error'; }
|
|
9
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --transport AWS-prod']; }
|
|
10
|
+
static { this.flags = {
|
|
11
|
+
transport: Flags.string({ char: 't', description: "Validate one transport's bindings against its resources" }),
|
|
12
|
+
json: Flags.boolean({ description: 'Print issues as JSON', default: false }),
|
|
13
|
+
}; }
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(QueueValidateBindings);
|
|
16
|
+
const session = await OpenWorkQueueSession();
|
|
17
|
+
let failure = null;
|
|
18
|
+
try {
|
|
19
|
+
const result = await new WorkQueueValidateBindingsOperation().Execute({ transportName: flags.transport }, { provider: session.Provider, user: session.User });
|
|
20
|
+
const output = RequireOperationOutput(result, 'WorkQueue.ValidateBindings');
|
|
21
|
+
this.log(flags.json ? JSON.stringify(output.issues, null, 2) : FormatBindingIssues(output.issues));
|
|
22
|
+
if (HasBindingErrors(output.issues)) {
|
|
23
|
+
failure = 'Binding validation reported errors.';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
await session.Close();
|
|
31
|
+
}
|
|
32
|
+
if (failure) {
|
|
33
|
+
this.error(failure, { exit: 1 });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=validate-bindings.js.map
|
|
@@ -0,0 +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,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACrH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,+GAA+G;AAC/G,OAAO,uCAAuC,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;aACjD,gBAAW,GAAG,uEAAuE,CAAC;aAEtF,aA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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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
3
|
+
export default class QueueWork extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
once: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
|
+
max: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
'idle-exit-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
'max-duration-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
concurrency: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'shutdown-drain-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
/** One-shot mode. Exit 0 for an empty queue, a spent budget, MaxDuration or a signal; non-zero when nothing could run. */
|
|
17
|
+
private runOnce;
|
|
18
|
+
private runUntilSignal;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=work.d.ts.map
|
|
@@ -0,0 +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;AAM7C,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;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA2B1B,0HAA0H;YAC5G,OAAO;YAgBP,cAAc;CAW7B"}
|