@memberjunction/cli 6.2.0-edge.2 → 6.2.0-edge.4
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 +9 -0
- package/dist/commands/artifacts/reclassify.d.ts.map +1 -1
- package/dist/commands/artifacts/reclassify.js +4 -2
- package/dist/commands/artifacts/reclassify.js.map +1 -1
- package/dist/commands/cache/clear.d.ts +25 -0
- package/dist/commands/cache/clear.d.ts.map +1 -0
- package/dist/commands/cache/clear.js +79 -0
- package/dist/commands/cache/clear.js.map +1 -0
- package/dist/commands/cache/usage.d.ts +7 -0
- package/dist/commands/cache/usage.d.ts.map +1 -0
- package/dist/commands/cache/usage.js +10 -0
- package/dist/commands/cache/usage.js.map +1 -0
- package/dist/commands/codegen/index.d.ts +15 -6
- package/dist/commands/codegen/index.d.ts.map +1 -1
- package/dist/commands/codegen/index.js +35 -4
- package/dist/commands/codegen/index.js.map +1 -1
- package/dist/commands/install/index.d.ts.map +1 -1
- package/dist/commands/install/index.js +7 -1
- package/dist/commands/install/index.js.map +1 -1
- package/dist/commands/migrate/index.d.ts +10 -0
- package/dist/commands/migrate/index.d.ts.map +1 -1
- package/dist/commands/migrate/index.js +42 -0
- package/dist/commands/migrate/index.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/evaluate.d.ts +3 -0
- package/dist/commands/rubric/evaluate.d.ts.map +1 -1
- package/dist/commands/rubric/evaluate.js +9 -2
- package/dist/commands/rubric/evaluate.js.map +1 -1
- package/dist/commands/sync/push.d.ts +33 -8
- package/dist/commands/sync/push.d.ts.map +1 -1
- package/dist/commands/sync/push.js +94 -6
- package/dist/commands/sync/push.js.map +1 -1
- package/dist/commands/user/clone.d.ts +27 -0
- package/dist/commands/user/clone.d.ts.map +1 -0
- package/dist/commands/user/clone.js +106 -0
- package/dist/commands/user/clone.js.map +1 -0
- package/dist/hooks/postrun.d.ts +1 -1
- package/dist/hooks/prerun.d.ts.map +1 -1
- package/dist/hooks/prerun.js +9 -0
- package/dist/hooks/prerun.js.map +1 -1
- package/dist/lib/domain-profiles.d.ts.map +1 -1
- package/dist/lib/domain-profiles.js +8 -0
- package/dist/lib/domain-profiles.js.map +1 -1
- package/dist/lib/keep-awake.d.ts +45 -0
- package/dist/lib/keep-awake.d.ts.map +1 -0
- package/dist/lib/keep-awake.js +71 -0
- package/dist/lib/keep-awake.js.map +1 -0
- package/dist/lib/shared-cache.d.ts +84 -0
- package/dist/lib/shared-cache.d.ts.map +1 -0
- package/dist/lib/shared-cache.js +160 -0
- package/dist/lib/shared-cache.js.map +1 -0
- 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 +8 -0
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +36 -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 +2041 -1155
- package/package.json +29 -25
|
@@ -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,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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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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,sBAAs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,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"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { MJWorkLogger, SharedProviderSource, WorkQueueEngine, WorkQueueHost } from '@memberjunction/work-queue-engine';
|
|
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 factory and manifest enricher for this command only (work-queue 03 §0).
|
|
6
|
+
import '@memberjunction/work-queue-engine/aws';
|
|
7
|
+
const DEFAULT_IDLE_EXIT_MS = 5000;
|
|
8
|
+
const DEFAULT_SHUTDOWN_DRAIN_MS = 30000;
|
|
9
|
+
export default class QueueWork extends Command {
|
|
10
|
+
static { this.description = 'Run work-queue subscriptions in this process: once for a container job, or until stopped'; }
|
|
11
|
+
static { this.examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --subscription venue-import --once',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --subscription venue-import --once --max 5 --concurrency 2 --max-duration-ms 3300000',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --subscription "*"',
|
|
15
|
+
]; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
subscription: Flags.string({ char: 's', description: "Subscription name, or '*' for every MJWorker subscription", required: true }),
|
|
18
|
+
once: Flags.boolean({ description: 'Receive up to --max deliveries, drain and exit (container-job mode)', default: false }),
|
|
19
|
+
max: Flags.integer({ description: 'With --once: how many deliveries to receive', default: 1, min: 1, dependsOn: ['once'] }),
|
|
20
|
+
'idle-exit-ms': Flags.integer({ description: 'With --once: exit after this long with an empty queue', default: DEFAULT_IDLE_EXIT_MS, min: 0, dependsOn: ['once'] }),
|
|
21
|
+
'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'] }),
|
|
22
|
+
concurrency: Flags.integer({ description: 'Handlers in flight per subscription', default: 1, min: 1 }),
|
|
23
|
+
'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 }),
|
|
24
|
+
}; }
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(QueueWork);
|
|
27
|
+
const session = await OpenWorkQueueSession();
|
|
28
|
+
let failure = null;
|
|
29
|
+
try {
|
|
30
|
+
await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
|
|
31
|
+
const host = new WorkQueueHost({
|
|
32
|
+
InstanceID: `mj-queue-work-${process.pid}`,
|
|
33
|
+
Subscriptions: [{ Name: flags.subscription, Concurrency: flags.concurrency }],
|
|
34
|
+
IdlePollMinMs: 250, IdlePollMaxMs: 2000, ShutdownDrainMs: flags['shutdown-drain-ms'],
|
|
35
|
+
SweeperIntervalMs: 0, ReconcileIntervalMs: 0, // a short-lived job neither sweeps nor re-plans
|
|
36
|
+
}, WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue work]'), { ProviderSource: new SharedProviderSource(session.Provider) });
|
|
37
|
+
failure = flags.once ? await this.runOnce(host, flags) : await this.runUntilSignal(host, flags.subscription);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
await session.Close(); // only after the drain: RunUntilStopped awaits host.Shutdown() first
|
|
44
|
+
}
|
|
45
|
+
if (failure) {
|
|
46
|
+
this.error(failure, { exit: 1 });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** One-shot mode. Exit 0 for an empty queue, a spent budget, MaxDuration or a signal; non-zero when nothing could run. */
|
|
50
|
+
async runOnce(host, flags) {
|
|
51
|
+
let result = { Processed: 0, Reason: 'Shutdown' };
|
|
52
|
+
const work = host
|
|
53
|
+
.RunOnce({ MaxDeliveries: flags.max, IdleExitMs: flags['idle-exit-ms'], MaxDurationMs: flags['max-duration-ms'] })
|
|
54
|
+
.then(r => { result = r; });
|
|
55
|
+
await RunUntilStopped(host, work);
|
|
56
|
+
// RunOnce returns at once when nothing could run (Task 3b); the health says why. The host is shut down by now,
|
|
57
|
+
// so a subscription that did run reports HOST_SHUT_DOWN_REASON.
|
|
58
|
+
const startFailure = WorkerStartFailure(host.GetHealth(), flags.subscription);
|
|
59
|
+
if (startFailure) {
|
|
60
|
+
return startFailure;
|
|
61
|
+
}
|
|
62
|
+
this.log(`Processed ${result.Processed} deliver${result.Processed === 1 ? 'y' : 'ies'} (${result.Reason}).`);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
async runUntilSignal(host, requested) {
|
|
66
|
+
await host.Start();
|
|
67
|
+
const startFailure = WorkerStartFailure(host.GetHealth(), requested);
|
|
68
|
+
if (startFailure) {
|
|
69
|
+
await host.Shutdown();
|
|
70
|
+
return startFailure;
|
|
71
|
+
}
|
|
72
|
+
this.log(`Running ${requested}; send SIGINT or SIGTERM to stop.`);
|
|
73
|
+
await RunUntilStopped(host, new Promise(() => undefined));
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=work.js.map
|
|
@@ -0,0 +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,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,+GAA+G;AAC/G,OAAO,uCAAuC,CAAC;AAE/C,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;aACrC,gBAAW,GAAG,0FAA0F,CAAC;aAEzG,aAAQ,GAAG;QAChB,wEAAwE;QACxE,0HAA0H;QAC1H,wDAAwD;KACzD,CAAC;aAEK,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,2DAA2D,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACnI,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,qEAAqE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC3H,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,E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E,CAAC;aACjH,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,+GAA+G;QAC/G,gEAAgE;QAChE,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9E,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,SAAS,WAAW,MAAM,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;QAC7G,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,IAAmB,EAAE,SAAiB;QACjE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,YAAY,GAAG,kBAAkB,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"}
|
|
@@ -6,6 +6,9 @@ export default class RubricEvaluate extends Command {
|
|
|
6
6
|
entity: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
record: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
evaluator: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
prompt: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
model: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
mode: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
12
|
};
|
|
10
13
|
run(): Promise<void>;
|
|
11
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAA6D;IAC/E,MAAM,CAAC,KAAK
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAA6D;IAC/E,MAAM,CAAC,KAAK;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
|
|
@@ -5,13 +5,20 @@ export default class RubricEvaluate extends Command {
|
|
|
5
5
|
rubric: Flags.string({ required: true, description: 'Rubric name or id, optionally @version' }),
|
|
6
6
|
entity: Flags.string({ required: true, description: 'Subject entity name' }),
|
|
7
7
|
record: Flags.string({ required: true, description: 'Subject record id' }),
|
|
8
|
-
evaluator: Flags.string({ description: 'LLM or
|
|
8
|
+
evaluator: Flags.string({ description: 'A registered evaluator: LLM, Decision, Agent, Deterministic, or a custom one', default: 'LLM' }),
|
|
9
|
+
prompt: Flags.string({ description: 'LLM: the judge prompt composed into Rubric Evaluator (default Rubric Evaluator - Default Judge). Decision: the decision prompt (default Default Decision)' }),
|
|
10
|
+
model: Flags.string({ description: 'AI Model ID to pin. Otherwise the prompt\'s bindings choose' }),
|
|
11
|
+
mode: Flags.string({ description: 'LLM only: SinglePass or PerCriterion', options: ['SinglePass', 'PerCriterion'] }),
|
|
9
12
|
}; }
|
|
10
13
|
async run() {
|
|
11
14
|
const { CloseMJProvider, RubricCommands } = await import('@memberjunction/testing-cli');
|
|
12
15
|
const { flags } = await this.parse(RubricEvaluate);
|
|
13
16
|
try {
|
|
14
|
-
await new RubricCommands().Evaluate(flags.rubric, flags.entity, flags.record, flags.evaluator
|
|
17
|
+
await new RubricCommands().Evaluate(flags.rubric, flags.entity, flags.record, flags.evaluator, {
|
|
18
|
+
...(flags.prompt ? { PromptName: flags.prompt } : {}),
|
|
19
|
+
...(flags.model ? { ModelID: flags.model } : {}),
|
|
20
|
+
...(flags.mode === 'SinglePass' || flags.mode === 'PerCriterion' ? { Mode: flags.mode } : {}),
|
|
21
|
+
});
|
|
15
22
|
}
|
|
16
23
|
finally {
|
|
17
24
|
await CloseMJProvider();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aAC1C,gBAAW,GAAG,yDAAyD,CAAC;aACxE,UAAK,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;QAC/F,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE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,eAAe,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QACxF,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,IAAI,cAAc,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE;gBAC7F,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrD,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChD,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9F,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC"}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { MJCLIResult, PluginUsage } from '@memberjunction/cli-core';
|
|
2
|
+
import { SyncPushPlugin } from '@memberjunction/metadata-sync/plugins';
|
|
3
|
+
export default class SyncPush extends SyncPushPlugin {
|
|
4
|
+
static flags: {
|
|
5
|
+
'skip-cache-clear': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
6
|
+
dir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
'dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
ci: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
9
|
+
'no-validate': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
'delete-db-only': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
'isolated-transactions': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
'parallel-batch-size': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
include: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
exclude: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
incremental: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
|
+
'change-detail': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
static Usage: PluginUsage;
|
|
19
|
+
protected Execute(): Promise<MJCLIResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a failed push left rows in the database. False only when the outcome positively says
|
|
22
|
+
* the push rolled back and committed nothing; anything unreadable counts as "it may have".
|
|
23
|
+
*/
|
|
24
|
+
private failedPushLeftWrites;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a successful push positively reports that it wrote nothing: it was cancelled before
|
|
27
|
+
* writing, or it created, updated and deleted no rows. A result without those counts counts as
|
|
28
|
+
* "it may have written".
|
|
29
|
+
*/
|
|
30
|
+
private successfulPushWroteNothing;
|
|
31
|
+
/** Clears the shared cache unless this was a dry run (which writes nothing). */
|
|
32
|
+
private clearSharedCache;
|
|
33
|
+
}
|
|
9
34
|
//# sourceMappingURL=push.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/push.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/push.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAOvE,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;IAClD,MAAM,CAAC,KAAK;;;;;;;;;;;;;MAKV;IAEF,MAAM,CAAC,KAAK,EAAE,WAAW,CAMvB;cAEuB,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAwBxD;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAWlC,gFAAgF;YAClE,gBAAgB;CAI/B"}
|
|
@@ -1,9 +1,97 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `@memberjunction/metadata-sync/plugins
|
|
4
|
-
*
|
|
5
|
-
* the
|
|
6
|
-
*
|
|
2
|
+
* oclif entry for `mj sync push`. The logic lives in {@link SyncPushPlugin} in
|
|
3
|
+
* `@memberjunction/metadata-sync/plugins`; this subclass only adds the shared-cache clear that must
|
|
4
|
+
* follow a database write, before the plugin's Cleanup() ends the process. Running servers never
|
|
5
|
+
* hear about rows written here, so without the clear they keep serving the old ones.
|
|
6
|
+
*
|
|
7
|
+
* The clear runs only when the push may have changed the database:
|
|
8
|
+
* - A successful push clears unless it reports that it wrote nothing: it was cancelled before
|
|
9
|
+
* writing, or it created, updated and deleted no rows. Clearing after a no-op push would drop
|
|
10
|
+
* every server's cache on every deploy for nothing.
|
|
11
|
+
* - A failed push clears only when it left something behind. An atomic push (the default) rolls its
|
|
12
|
+
* writes back, and `PushAbortedError` says so: `rolledBack`, plus the rows a non-atomic push
|
|
13
|
+
* committed anyway.
|
|
14
|
+
* - When the outcome cannot be read, the clear still runs: a needless reload is cheaper than a fleet
|
|
15
|
+
* serving rows that are no longer in the database.
|
|
7
16
|
*/
|
|
8
|
-
|
|
17
|
+
import { Flags } from '@oclif/core';
|
|
18
|
+
import { SyncPushPlugin } from '@memberjunction/metadata-sync/plugins';
|
|
19
|
+
import { PushAbortedError } from '@memberjunction/metadata-sync';
|
|
20
|
+
import { AppendSharedCacheClear, ClearSharedCacheAfterWrite, SKIP_CACHE_CLEAR_ENV } from '../../lib/shared-cache.js';
|
|
21
|
+
export default class SyncPush extends SyncPushPlugin {
|
|
22
|
+
static { this.flags = {
|
|
23
|
+
...SyncPushPlugin.flags,
|
|
24
|
+
'skip-cache-clear': Flags.boolean({
|
|
25
|
+
description: `Do not clear the shared Redis cache (REDIS_URL) after pushing. Also: ${SKIP_CACHE_CLEAR_ENV}=1`,
|
|
26
|
+
}),
|
|
27
|
+
}; }
|
|
28
|
+
static { this.Usage = {
|
|
29
|
+
...SyncPushPlugin.Usage,
|
|
30
|
+
flags: [
|
|
31
|
+
...(SyncPushPlugin.Usage?.flags ?? []),
|
|
32
|
+
{ name: '--skip-cache-clear', type: 'boolean', description: 'Do not clear the shared Redis cache after pushing' },
|
|
33
|
+
],
|
|
34
|
+
}; }
|
|
35
|
+
async Execute() {
|
|
36
|
+
let result;
|
|
37
|
+
try {
|
|
38
|
+
result = await super.Execute();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
// Runs after the plugin's rollback, so servers reload whatever the push did commit.
|
|
42
|
+
if (this.failedPushLeftWrites(undefined, error)) {
|
|
43
|
+
const report = await this.clearSharedCache('mj sync push (failed)');
|
|
44
|
+
if (report) {
|
|
45
|
+
this.Host.Log(report.Message, report.Ok ? 'info' : 'warn');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
if (!result.success && !this.failedPushLeftWrites(result, undefined)) {
|
|
51
|
+
return result; // rolled back cleanly: nothing in the database changed, so nothing is stale
|
|
52
|
+
}
|
|
53
|
+
if (result.success && this.successfulPushWroteNothing(result)) {
|
|
54
|
+
return result; // cancelled, or a no-op: nothing in the database changed
|
|
55
|
+
}
|
|
56
|
+
const report = await this.clearSharedCache(result.success ? 'mj sync push' : 'mj sync push (failed)');
|
|
57
|
+
return AppendSharedCacheClear(result, report, this.Host);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether a failed push left rows in the database. False only when the outcome positively says
|
|
61
|
+
* the push rolled back and committed nothing; anything unreadable counts as "it may have".
|
|
62
|
+
*/
|
|
63
|
+
failedPushLeftWrites(result, error) {
|
|
64
|
+
if (error instanceof PushAbortedError) {
|
|
65
|
+
return !error.rolledBack || error.committedWrites.length > 0;
|
|
66
|
+
}
|
|
67
|
+
if (error) {
|
|
68
|
+
return true; // an error the push did not describe
|
|
69
|
+
}
|
|
70
|
+
const data = result?.data;
|
|
71
|
+
if (typeof data?.rolledBack !== 'boolean') {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return !data.rolledBack || (data.committedOutsideTransaction ?? 0) > 0;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether a successful push positively reports that it wrote nothing: it was cancelled before
|
|
78
|
+
* writing, or it created, updated and deleted no rows. A result without those counts counts as
|
|
79
|
+
* "it may have written".
|
|
80
|
+
*/
|
|
81
|
+
successfulPushWroteNothing(result) {
|
|
82
|
+
const data = result.data;
|
|
83
|
+
if (data?.cancelled === true) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (typeof data?.created !== 'number' || typeof data.updated !== 'number' || typeof data.deleted !== 'number') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return data.created + data.updated + data.deleted === 0;
|
|
90
|
+
}
|
|
91
|
+
/** Clears the shared cache unless this was a dry run (which writes nothing). */
|
|
92
|
+
async clearSharedCache(commandName) {
|
|
93
|
+
const flags = this.GetFlags();
|
|
94
|
+
return flags['dry-run'] ? null : ClearSharedCacheAfterWrite(commandName, flags['skip-cache-clear']);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
9
97
|
//# sourceMappingURL=push.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/sync/push.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/sync/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKrH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;aAC3C,UAAK,GAAG;QACb,GAAG,cAAc,CAAC,KAAK;QACvB,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC;YAChC,WAAW,EAAE,wEAAwE,oBAAoB,IAAI;SAC9G,CAAC;KACH,CAAC;aAEK,UAAK,GAAgB;QAC1B,GAAG,cAAc,CAAC,KAAK;QACvB,KAAK,EAAE;YACL,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC;YACtC,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,mDAAmD,EAAE;SAClH;KACF,CAAC;IAEiB,KAAK,CAAC,OAAO;QAC9B,IAAI,MAAmB,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,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AAC,qCAAqC;QACpD,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,EAAE,IAAkF,CAAC;QACxG,IAAI,OAAO,IAAI,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,2BAA2B,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACK,0BAA0B,CAAC,MAAmB;QACpD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAiG,CAAC;QACtH,IAAI,IAAI,EAAE,SAAS,KAAK,IAAI,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,OAAO,IAAI,EAAE,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9G,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,gFAAgF;IACxE,KAAK,CAAC,gBAAgB,CAAC,WAAmB;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAsB,CAAC;QAClD,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,WAAW,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtG,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: `mj user clone`.
|
|
4
|
+
*
|
|
5
|
+
* Creates a new user as a copy of an existing one through the `MJ: Users` clone configuration. From a
|
|
6
|
+
* template user (IsTemplate) the default `template` preset copies everything the template was set up
|
|
7
|
+
* with, dashboards and conversations included; from an ordinary user, choose one of the other presets.
|
|
8
|
+
* Runs as the system user, so it needs no sign-in; it is meant for administrators and install scripts
|
|
9
|
+
* (an app's post-install hook pre-provisions the person who will sign in).
|
|
10
|
+
*/
|
|
11
|
+
export default class UserClone extends Command {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static flags: {
|
|
15
|
+
from: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
email: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
first: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
18
|
+
last: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
|
+
preset: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
20
|
+
inactive: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
21
|
+
'dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
/** The user with this email, if any. */
|
|
25
|
+
private findUser;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=clone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../src/commands/user/clone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAc7C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAAqE;IAEvF,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAWV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA4D1B,wCAAwC;YAC1B,QAAQ;CAavB"}
|