@memberjunction/cli 6.2.0-edge.3 → 6.2.0-edge.5

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.
Files changed (62) hide show
  1. package/README.md +9 -0
  2. package/dist/commands/artifacts/reclassify.d.ts.map +1 -1
  3. package/dist/commands/artifacts/reclassify.js +4 -2
  4. package/dist/commands/artifacts/reclassify.js.map +1 -1
  5. package/dist/commands/cache/clear.d.ts +25 -0
  6. package/dist/commands/cache/clear.d.ts.map +1 -0
  7. package/dist/commands/cache/clear.js +79 -0
  8. package/dist/commands/cache/clear.js.map +1 -0
  9. package/dist/commands/cache/usage.d.ts +7 -0
  10. package/dist/commands/cache/usage.d.ts.map +1 -0
  11. package/dist/commands/cache/usage.js +10 -0
  12. package/dist/commands/cache/usage.js.map +1 -0
  13. package/dist/commands/codegen/index.d.ts +15 -6
  14. package/dist/commands/codegen/index.d.ts.map +1 -1
  15. package/dist/commands/codegen/index.js +35 -4
  16. package/dist/commands/codegen/index.js.map +1 -1
  17. package/dist/commands/dbdoc/analyze.d.ts +1 -0
  18. package/dist/commands/dbdoc/analyze.d.ts.map +1 -1
  19. package/dist/commands/dbdoc/analyze.js +7 -0
  20. package/dist/commands/dbdoc/analyze.js.map +1 -1
  21. package/dist/commands/dbdoc/export.d.ts +6 -0
  22. package/dist/commands/dbdoc/export.d.ts.map +1 -1
  23. package/dist/commands/dbdoc/export.js +32 -0
  24. package/dist/commands/dbdoc/export.js.map +1 -1
  25. package/dist/commands/install/index.d.ts.map +1 -1
  26. package/dist/commands/install/index.js +7 -1
  27. package/dist/commands/install/index.js.map +1 -1
  28. package/dist/commands/migrate/index.d.ts +10 -0
  29. package/dist/commands/migrate/index.d.ts.map +1 -1
  30. package/dist/commands/migrate/index.js +42 -0
  31. package/dist/commands/migrate/index.js.map +1 -1
  32. package/dist/commands/sync/push.d.ts +33 -8
  33. package/dist/commands/sync/push.d.ts.map +1 -1
  34. package/dist/commands/sync/push.js +94 -6
  35. package/dist/commands/sync/push.js.map +1 -1
  36. package/dist/commands/sync/watch.d.ts.map +1 -1
  37. package/dist/commands/sync/watch.js +3 -5
  38. package/dist/commands/sync/watch.js.map +1 -1
  39. package/dist/commands/user/clone.d.ts +27 -0
  40. package/dist/commands/user/clone.d.ts.map +1 -0
  41. package/dist/commands/user/clone.js +106 -0
  42. package/dist/commands/user/clone.js.map +1 -0
  43. package/dist/hooks/prerun.d.ts.map +1 -1
  44. package/dist/hooks/prerun.js +9 -0
  45. package/dist/hooks/prerun.js.map +1 -1
  46. package/dist/lib/domain-profiles.d.ts.map +1 -1
  47. package/dist/lib/domain-profiles.js +4 -0
  48. package/dist/lib/domain-profiles.js.map +1 -1
  49. package/dist/lib/keep-awake.d.ts +45 -0
  50. package/dist/lib/keep-awake.d.ts.map +1 -0
  51. package/dist/lib/keep-awake.js +71 -0
  52. package/dist/lib/keep-awake.js.map +1 -0
  53. package/dist/lib/shared-cache.d.ts +84 -0
  54. package/dist/lib/shared-cache.d.ts.map +1 -0
  55. package/dist/lib/shared-cache.js +160 -0
  56. package/dist/lib/shared-cache.js.map +1 -0
  57. package/dist/light-commands.d.ts +8 -0
  58. package/dist/light-commands.d.ts.map +1 -1
  59. package/dist/light-commands.js +33 -0
  60. package/dist/light-commands.js.map +1 -1
  61. package/oclif.manifest.json +3550 -3289
  62. package/package.json +29 -27
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Keeps the machine awake while a long-running database command runs.
3
+ *
4
+ * `mj install` and `mj app install` run for many minutes, and a laptop left alone in that time
5
+ * idles into sleep. Sleep pauses everything at once — the CLI, the local database (often a Docker
6
+ * VM), and every socket between them — and on wake each in-flight request's timer fires together:
7
+ * a migration batch that was doing nothing wrong reports `Timeout: Request failed to complete in
8
+ * 300000ms`, a GitHub download reports `read ECONNRESET`, and the app being installed is rolled
9
+ * back. Clean end-user installs of MJ + a multi-app Open App chain failed this way repeatedly.
10
+ *
11
+ * On macOS this holds a `caffeinate` assertion tied to the CLI's own pid, so it ends the moment
12
+ * the command does — no cleanup, nothing left behind. Elsewhere it is a no-op. Set
13
+ * {@link KEEP_AWAKE_OPT_OUT_ENV_VAR} to opt out.
14
+ *
15
+ * Either way, {@link SleepNoticeForCommand} tells the user at the start: no assertion survives
16
+ * a closed lid, and on Windows and Linux nothing holds the machine awake at all.
17
+ */
18
+ import { spawn } from 'node:child_process';
19
+ /** Set to `1` (or `true`) to let the machine sleep during long commands. */
20
+ export declare const KEEP_AWAKE_OPT_OUT_ENV_VAR = "MJ_ALLOW_SLEEP";
21
+ /** Commands long and database-bound enough that sleeping mid-run breaks them. */
22
+ export declare const KEEP_AWAKE_COMMANDS: ReadonlySet<string>;
23
+ /** The pieces of the environment this depends on, injectable for tests. */
24
+ export interface KeepAwakeEnvironment {
25
+ Platform: NodeJS.Platform;
26
+ Env: NodeJS.ProcessEnv;
27
+ Pid: number;
28
+ Spawn: typeof spawn;
29
+ }
30
+ /**
31
+ * Starts the keep-awake assertion for `commandId` when it applies.
32
+ *
33
+ * @returns true when an assertion was started. Never throws: failing to keep the machine awake
34
+ * must not fail the command it was meant to protect.
35
+ */
36
+ export declare function KeepAwakeForCommand(commandId: string, environment?: KeepAwakeEnvironment): boolean;
37
+ /**
38
+ * The one-line warning to show when a long database command starts, or `undefined` for commands
39
+ * that are not long enough to need it.
40
+ *
41
+ * @param commandId - The oclif command id.
42
+ * @param keptAwake - Whether {@link KeepAwakeForCommand} started an assertion for this run.
43
+ */
44
+ export declare function SleepNoticeForCommand(commandId: string, keptAwake: boolean): string | undefined;
45
+ //# sourceMappingURL=keep-awake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keep-awake.d.ts","sourceRoot":"","sources":["../../src/lib/keep-awake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAE3D,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAKlD,CAAC;AAEH,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB;AASD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,GAAE,oBAA0C,GAAG,OAAO,CAavH;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAK/F"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Keeps the machine awake while a long-running database command runs.
3
+ *
4
+ * `mj install` and `mj app install` run for many minutes, and a laptop left alone in that time
5
+ * idles into sleep. Sleep pauses everything at once — the CLI, the local database (often a Docker
6
+ * VM), and every socket between them — and on wake each in-flight request's timer fires together:
7
+ * a migration batch that was doing nothing wrong reports `Timeout: Request failed to complete in
8
+ * 300000ms`, a GitHub download reports `read ECONNRESET`, and the app being installed is rolled
9
+ * back. Clean end-user installs of MJ + a multi-app Open App chain failed this way repeatedly.
10
+ *
11
+ * On macOS this holds a `caffeinate` assertion tied to the CLI's own pid, so it ends the moment
12
+ * the command does — no cleanup, nothing left behind. Elsewhere it is a no-op. Set
13
+ * {@link KEEP_AWAKE_OPT_OUT_ENV_VAR} to opt out.
14
+ *
15
+ * Either way, {@link SleepNoticeForCommand} tells the user at the start: no assertion survives
16
+ * a closed lid, and on Windows and Linux nothing holds the machine awake at all.
17
+ */
18
+ import { spawn } from 'node:child_process';
19
+ /** Set to `1` (or `true`) to let the machine sleep during long commands. */
20
+ export const KEEP_AWAKE_OPT_OUT_ENV_VAR = 'MJ_ALLOW_SLEEP';
21
+ /** Commands long and database-bound enough that sleeping mid-run breaks them. */
22
+ export const KEEP_AWAKE_COMMANDS = new Set([
23
+ 'install',
24
+ 'app:install',
25
+ 'app:upgrade',
26
+ 'migrate',
27
+ ]);
28
+ const DEFAULT_ENVIRONMENT = {
29
+ Platform: process.platform,
30
+ Env: process.env,
31
+ Pid: process.pid,
32
+ Spawn: spawn,
33
+ };
34
+ /**
35
+ * Starts the keep-awake assertion for `commandId` when it applies.
36
+ *
37
+ * @returns true when an assertion was started. Never throws: failing to keep the machine awake
38
+ * must not fail the command it was meant to protect.
39
+ */
40
+ export function KeepAwakeForCommand(commandId, environment = DEFAULT_ENVIRONMENT) {
41
+ if (!KEEP_AWAKE_COMMANDS.has(commandId) || environment.Platform !== 'darwin')
42
+ return false;
43
+ const optOut = (environment.Env[KEEP_AWAKE_OPT_OUT_ENV_VAR] ?? '').trim().toLowerCase();
44
+ if (optOut === '1' || optOut === 'true')
45
+ return false;
46
+ try {
47
+ // -i: no idle sleep. -s: no system sleep while on AC power. -w: exit when the CLI exits.
48
+ const child = environment.Spawn('caffeinate', ['-i', '-s', '-w', String(environment.Pid)], { stdio: 'ignore' });
49
+ child.on('error', () => undefined); // caffeinate missing or refused — carry on without it
50
+ child.unref(); // never keep the CLI alive for its sake
51
+ return true;
52
+ }
53
+ catch {
54
+ return false;
55
+ }
56
+ }
57
+ /**
58
+ * The one-line warning to show when a long database command starts, or `undefined` for commands
59
+ * that are not long enough to need it.
60
+ *
61
+ * @param commandId - The oclif command id.
62
+ * @param keptAwake - Whether {@link KeepAwakeForCommand} started an assertion for this run.
63
+ */
64
+ export function SleepNoticeForCommand(commandId, keptAwake) {
65
+ if (!KEEP_AWAKE_COMMANDS.has(commandId))
66
+ return undefined;
67
+ return keptAwake
68
+ ? 'This can take 15 minutes or more. MJ is keeping this Mac awake until it finishes, but closing the lid will still put it to sleep and can make the command fail partway.'
69
+ : "This can take 15 minutes or more. Don't let this machine sleep until it finishes: sleep pauses the database connection and can make the command fail partway.";
70
+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AC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,sDAAsD;QAC1F,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,wCAAwC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,SAAkB;IACzE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1D,OAAO,SAAS;QACd,CAAC,CAAC,yKAAyK;QAC3K,CAAC,CAAC,+JAA+J,CAAC;AACtK,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { RedisProviderConfig, SharedCacheCategoryClear } from '@memberjunction/redis-provider';
2
+ /** Setting this to `1`/`true` disables the automatic clear (the explicit command still works). */
3
+ export declare const SKIP_CACHE_CLEAR_ENV = "MJ_SKIP_SHARED_CACHE_CLEAR";
4
+ /** What the user asked to clear, mapped onto the names the cache actually uses. */
5
+ export type ResolvedCacheCategories = {
6
+ /** Canonical category names, safe to hand to the store. */
7
+ Categories: string[];
8
+ /** Anything that matched no known category, in the spelling the user gave. */
9
+ Unknown: string[];
10
+ };
11
+ /**
12
+ * Maps requested category names onto their canonical spelling.
13
+ *
14
+ * Names are accepted case-insensitively because nobody should have to remember that it is
15
+ * `RunViewCache` and not `runviewcache`. But Redis keys ARE case-sensitive, so accepting a
16
+ * spelling and then using it verbatim scanned `{prefix}:runviewcache:*`, matched nothing, and
17
+ * reported a successful clear of 0 keys — the operator is told the fleet will reload and it never
18
+ * does. Accept the spelling, then hand the store the canonical name.
19
+ */
20
+ export declare function ResolveCacheCategories(requested: readonly string[] | undefined): ResolvedCacheCategories;
21
+ /** What a `mj migrate` run did, as far as the command can tell. */
22
+ export type MigrationOutcome = {
23
+ /** The migration engine threw instead of returning a result. */
24
+ Threw: boolean;
25
+ /** The run reported success. */
26
+ Succeeded: boolean;
27
+ /** Migrations the run reports as applied. Meaningful only on success. */
28
+ MigrationsApplied: number;
29
+ /** At least one migration began executing — the only reliable "the database may have changed". */
30
+ StartedApplying: boolean;
31
+ };
32
+ /**
33
+ * Whether a migration run may have changed the database, and so whether the fleet's cache is stale.
34
+ *
35
+ * On success the count is authoritative: a run that found nothing pending must NOT make every server
36
+ * drop its cache and reload every engine for nothing.
37
+ *
38
+ * On a failure — including one that threw rather than returning — the count is not trustworthy and
39
+ * neither is the detail list, which can be empty precisely because the run died before assembling
40
+ * it. What IS known is whether a migration started executing. DDL is not transactional across
41
+ * batches on SQL Server, so a migration that began and failed can still have committed statements;
42
+ * a run that never started one cannot have. That makes "did anything start" the honest gate: a bad
43
+ * connection string or a config error leaves the fleet alone, and anything that touched the database
44
+ * clears.
45
+ */
46
+ export declare function MigrationChangedDatabase(outcome: MigrationOutcome): boolean;
47
+ /** The category names a clear can be asked for, for error messages and help text. */
48
+ export declare function KnownCacheCategories(): string[];
49
+ /** The shared cache the environment points at, or null when none is configured. */
50
+ export interface SharedCacheTarget {
51
+ Connection: RedisProviderConfig;
52
+ /** Host, port and key prefix — never credentials. For messages. */
53
+ Description: string;
54
+ }
55
+ /** What an automatic clear did, for the command's log and result. */
56
+ export interface SharedCacheClearReport {
57
+ Ok: boolean;
58
+ Message: string;
59
+ Categories: SharedCacheCategoryClear[];
60
+ }
61
+ /** Resolves the shared cache from `REDIS_URL` / `REDIS_KEY_PREFIX`, the variables MJAPI reads. */
62
+ export declare function ResolveSharedCacheTarget(env?: NodeJS.ProcessEnv): SharedCacheTarget | null;
63
+ /** `host:port/db` of a Redis URL, without user or password. */
64
+ export declare function DescribeRedisUrl(url: string): string;
65
+ /** True when the automatic clear has been switched off by flag or environment. */
66
+ export declare function IsAutomaticClearDisabled(skipFlag: boolean | undefined, env?: NodeJS.ProcessEnv): boolean;
67
+ /**
68
+ * Clears the shared cache after `commandName` changed the database. Returns null when there is
69
+ * nothing to do (no `REDIS_URL`, or disabled).
70
+ */
71
+ export declare function ClearSharedCacheAfterWrite(commandName: string, skipFlag?: boolean): Promise<SharedCacheClearReport | null>;
72
+ /** The subset of the CLI runtime host a clear report is logged through. */
73
+ export interface SharedCacheReportSink {
74
+ Log(message: string, level?: 'info' | 'warn' | 'error'): void;
75
+ }
76
+ /**
77
+ * Logs a clear report and folds it into a plugin command's result: `data.sharedCacheClear`
78
+ * always, and a warning when the clear failed. Returns the result unchanged when there is no report.
79
+ */
80
+ export declare function AppendSharedCacheClear<R extends {
81
+ data?: Record<string, unknown>;
82
+ warnings?: string[];
83
+ }>(result: R, report: SharedCacheClearReport | null, sink: SharedCacheReportSink): R;
84
+ //# sourceMappingURL=shared-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-cache.d.ts","sourceRoot":"","sources":["../../src/lib/shared-cache.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAEpG,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AAKjE,mFAAmF;AACnF,MAAM,MAAM,uBAAuB,GAAG;IAClC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,uBAAuB,CAiBxG;AAED,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,gEAAgE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,gCAAgC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;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,sBAAsB,GAAG,IAAI,EACrC,IAAI,EAAE,qBAAqB,GAC5B,CAAC,CAWH"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Clearing the shared (Redis) cache after the CLI changes the database.
3
+ *
4
+ * `mj sync push`, `mj codegen` and `mj migrate` write to the database from a process that is not
5
+ * part of the server fleet's cache, so no server hears about the change and each keeps serving what
6
+ * it cached before — indefinitely, because server-side cache hits are never re-validated (#4083).
7
+ * When `REDIS_URL` is configured (in the environment or the dotenv file the CLI loads), these
8
+ * commands clear the cache categories and the metadata snapshot afterwards; every server reloads its
9
+ * engines and re-checks its metadata. `mj cache clear` does the same on demand.
10
+ *
11
+ * A failed clear never fails the command — the database change already succeeded — but it is
12
+ * reported loudly, with the command to run by hand.
13
+ */
14
+ import { ClearSharedCacheCategories, SHARED_CACHE_WRITE_CATEGORIES } from '@memberjunction/redis-provider';
15
+ /** Setting this to `1`/`true` disables the automatic clear (the explicit command still works). */
16
+ export const SKIP_CACHE_CLEAR_ENV = 'MJ_SKIP_SHARED_CACHE_CLEAR';
17
+ /** The categories a clear may target: everything a CLI write invalidates, plus the proxy-key store. */
18
+ const CLEARABLE_CATEGORIES = [...SHARED_CACHE_WRITE_CATEGORIES, 'default'];
19
+ /**
20
+ * Maps requested category names onto their canonical spelling.
21
+ *
22
+ * Names are accepted case-insensitively because nobody should have to remember that it is
23
+ * `RunViewCache` and not `runviewcache`. But Redis keys ARE case-sensitive, so accepting a
24
+ * spelling and then using it verbatim scanned `{prefix}:runviewcache:*`, matched nothing, and
25
+ * reported a successful clear of 0 keys — the operator is told the fleet will reload and it never
26
+ * does. Accept the spelling, then hand the store the canonical name.
27
+ */
28
+ export function ResolveCacheCategories(requested) {
29
+ if (!requested?.length) {
30
+ return { Categories: [...SHARED_CACHE_WRITE_CATEGORIES], Unknown: [] };
31
+ }
32
+ const resolved = [];
33
+ const unknown = [];
34
+ for (const raw of requested) {
35
+ const canonical = CLEARABLE_CATEGORIES.find(known => known.toLowerCase() === raw.trim().toLowerCase());
36
+ if (canonical) {
37
+ if (!resolved.includes(canonical)) {
38
+ resolved.push(canonical);
39
+ }
40
+ }
41
+ else {
42
+ unknown.push(raw);
43
+ }
44
+ }
45
+ return { Categories: resolved, Unknown: unknown };
46
+ }
47
+ /**
48
+ * Whether a migration run may have changed the database, and so whether the fleet's cache is stale.
49
+ *
50
+ * On success the count is authoritative: a run that found nothing pending must NOT make every server
51
+ * drop its cache and reload every engine for nothing.
52
+ *
53
+ * On a failure — including one that threw rather than returning — the count is not trustworthy and
54
+ * neither is the detail list, which can be empty precisely because the run died before assembling
55
+ * it. What IS known is whether a migration started executing. DDL is not transactional across
56
+ * batches on SQL Server, so a migration that began and failed can still have committed statements;
57
+ * a run that never started one cannot have. That makes "did anything start" the honest gate: a bad
58
+ * connection string or a config error leaves the fleet alone, and anything that touched the database
59
+ * clears.
60
+ */
61
+ export function MigrationChangedDatabase(outcome) {
62
+ if (outcome.Threw || !outcome.Succeeded) {
63
+ return outcome.StartedApplying;
64
+ }
65
+ return outcome.MigrationsApplied > 0;
66
+ }
67
+ /** The category names a clear can be asked for, for error messages and help text. */
68
+ export function KnownCacheCategories() {
69
+ return [...CLEARABLE_CATEGORIES];
70
+ }
71
+ /** Resolves the shared cache from `REDIS_URL` / `REDIS_KEY_PREFIX`, the variables MJAPI reads. */
72
+ export function ResolveSharedCacheTarget(env = process.env) {
73
+ const url = env.REDIS_URL?.trim();
74
+ if (!url) {
75
+ return null;
76
+ }
77
+ const keyPrefix = env.REDIS_KEY_PREFIX || 'mj';
78
+ return { Connection: { url, keyPrefix }, Description: `${DescribeRedisUrl(url)} (prefix "${keyPrefix}")` };
79
+ }
80
+ /** `host:port/db` of a Redis URL, without user or password. */
81
+ export function DescribeRedisUrl(url) {
82
+ try {
83
+ const parsed = new URL(url);
84
+ const db = parsed.pathname && parsed.pathname !== '/' ? parsed.pathname : '';
85
+ return `${parsed.protocol}//${parsed.hostname}${parsed.port ? `:${parsed.port}` : ''}${db}`;
86
+ }
87
+ catch {
88
+ return '(unparseable REDIS_URL)';
89
+ }
90
+ }
91
+ /** True when the automatic clear has been switched off by flag or environment. */
92
+ export function IsAutomaticClearDisabled(skipFlag, env = process.env) {
93
+ if (skipFlag) {
94
+ return true;
95
+ }
96
+ const value = env[SKIP_CACHE_CLEAR_ENV]?.trim().toLowerCase();
97
+ return value === '1' || value === 'true';
98
+ }
99
+ /**
100
+ * Clears the shared cache after `commandName` changed the database. Returns null when there is
101
+ * nothing to do (no `REDIS_URL`, or disabled).
102
+ */
103
+ export async function ClearSharedCacheAfterWrite(commandName, skipFlag) {
104
+ const target = ResolveSharedCacheTarget();
105
+ if (!target || IsAutomaticClearDisabled(skipFlag)) {
106
+ return null;
107
+ }
108
+ try {
109
+ const categories = await ClearSharedCacheCategories({
110
+ Connection: target.Connection, Categories: SHARED_CACHE_WRITE_CATEGORIES, IncludeMetadataSnapshot: true,
111
+ });
112
+ const total = categories.reduce((n, c) => n + c.KeyCount, 0);
113
+ // A category can fail on its own: ClearSharedCacheCategories reports per-category Ok/Error
114
+ // and returns normally on a partial failure. Reporting the whole clear as a success then
115
+ // told the operator "servers will reload" about categories that were never cleared, which
116
+ // is the same false-success the per-category outcomes were added to expose.
117
+ const failed = categories.filter(c => c.Ok === false);
118
+ if (failed.length > 0) {
119
+ const detail = failed.map(c => `${c.Category} (${c.Error ?? 'unknown error'})`).join('; ');
120
+ return {
121
+ Ok: false,
122
+ Message: `${commandName} changed the database and the shared cache on ${target.Description} was only partly cleared — ` +
123
+ `${failed.length} of ${categories.length} categories failed: ${detail}. ` +
124
+ `Servers may serve stale data for those categories until you run: mj cache clear`,
125
+ Categories: categories,
126
+ };
127
+ }
128
+ return {
129
+ Ok: true,
130
+ Message: `Cleared ${total} shared cache entr${total === 1 ? 'y' : 'ies'} on ${target.Description} after ${commandName}; running servers will reload.`,
131
+ Categories: categories,
132
+ };
133
+ }
134
+ catch (e) {
135
+ const reason = e instanceof Error ? e.message : String(e);
136
+ return {
137
+ Ok: false,
138
+ Message: `${commandName} changed the database but the shared cache on ${target.Description} could not be cleared (${reason}). ` +
139
+ `Running servers may serve stale data until you run: mj cache clear`,
140
+ Categories: [],
141
+ };
142
+ }
143
+ }
144
+ /**
145
+ * Logs a clear report and folds it into a plugin command's result: `data.sharedCacheClear`
146
+ * always, and a warning when the clear failed. Returns the result unchanged when there is no report.
147
+ */
148
+ export function AppendSharedCacheClear(result, report, sink) {
149
+ if (!report) {
150
+ return result;
151
+ }
152
+ sink.Log(report.Message, report.Ok ? 'info' : 'warn');
153
+ const warnings = report.Ok ? result.warnings : [...(result.warnings ?? []), report.Message];
154
+ return {
155
+ ...result,
156
+ data: { ...(result.data ?? {}), sharedCacheClear: { ok: report.Ok, categories: report.Categories } },
157
+ warnings,
158
+ };
159
+ }
160
+ //# sourceMappingURL=shared-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-cache.js","sourceRoot":"","sources":["../../src/lib/shared-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAG3G,kGAAkG;AAClG,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE,uGAAuG;AACvG,MAAM,oBAAoB,GAAsB,CAAC,GAAG,6BAA6B,EAAE,SAAS,CAAC,CAAC;AAU9F;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAwC;IAC3E,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,6BAA6B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC3E,CAAC;IACD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC1B,MAAM,SAAS,GAAG,oBAAoB,CAA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,EAAE,KAAK;YACT,OAAO,EAAE,GAAG,WAAW,iDAAiD,MAAM,CAAC,WAAW,0BAA0B,MAAM,KAAK;gBAC3H,oEAAoE;YACxE,UAAU,EAAE,EAAE;SACjB,CAAC;IACN,CAAC;AACL,CAAC;AAOD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAClC,MAAS,EACT,MAAqC,EACrC,IAA2B;IAE3B,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5F,OAAO;QACH,GAAG,MAAM;QACT,IAAI,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE;QACpG,QAAQ;KACX,CAAC;AACN,CAAC"}
@@ -13,5 +13,13 @@
13
13
  * - If the command uses only standard npm packages or light @memberjunction
14
14
  * packages (like @memberjunction/config), add its oclif command ID here.
15
15
  */
16
+ /**
17
+ * NOTE on spelling: oclif command ids are **colon**-separated (`cache:clear`), whatever
18
+ * `topicSeparator` is set to — that only affects how a user types it. The space forms below are
19
+ * kept because they read the way the command is invoked, but each one is paired with its colon id,
20
+ * which is what `Command.id` actually equals at runtime. Without the colon form the entry never
21
+ * matches and the command silently pays the full bootstrap: `cache clear` measured 4.4-7.4 s
22
+ * against 0.19-0.29 s. `light-commands.ids.test.ts` fails on a space-only entry.
23
+ */
16
24
  export declare const LIGHT_COMMANDS: ReadonlySet<string>;
17
25
  //# sourceMappingURL=light-commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAkH7C,CAAC"}
1
+ {"version":3,"file":"light-commands.d.ts","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CA4I7C,CAAC"}
@@ -13,6 +13,14 @@
13
13
  * - If the command uses only standard npm packages or light @memberjunction
14
14
  * packages (like @memberjunction/config), add its oclif command ID here.
15
15
  */
16
+ /**
17
+ * NOTE on spelling: oclif command ids are **colon**-separated (`cache:clear`), whatever
18
+ * `topicSeparator` is set to — that only affects how a user types it. The space forms below are
19
+ * kept because they read the way the command is invoked, but each one is paired with its colon id,
20
+ * which is what `Command.id` actually equals at runtime. Without the colon form the entry never
21
+ * matches and the command silently pays the full bootstrap: `cache clear` measured 4.4-7.4 s
22
+ * against 0.19-0.29 s. `light-commands.ids.test.ts` fails on a space-only entry.
23
+ */
16
24
  export const LIGHT_COMMANDS = new Set([
17
25
  // Built-in oclif plugins
18
26
  'version',
@@ -21,8 +29,11 @@ export const LIGHT_COMMANDS = new Set([
21
29
  // metadata only; no bootstrap needed. Plugin entry points are light.
22
30
  'usage',
23
31
  'sync usage',
32
+ 'sync:usage',
24
33
  'codegen usage',
34
+ 'codegen:usage',
25
35
  'dev usage',
36
+ 'dev:usage',
26
37
  // Every remaining domain's tier-2 page. These compose oclif's own manifest plus the
27
38
  // light plugin entry points — the whole point of the surface is that an agent can
28
39
  // read it without paying for a runtime boot. Both id spellings are listed because
@@ -70,13 +81,22 @@ export const LIGHT_COMMANDS = new Set([
70
81
  'update:usage',
71
82
  // Plugin registry editing — just writes mj-cli-plugins.json
72
83
  'plugin add',
84
+ 'plugin:add',
73
85
  // Bump - uses zod, fast-glob, fs only
74
86
  'bump',
87
+ // Shared cache - uses @memberjunction/redis-provider (ioredis + core) only
88
+ 'cache',
89
+ 'cache clear',
90
+ 'cache:clear',
91
+ 'cache usage',
92
+ 'cache:usage',
75
93
  // Database commands - use @memberjunction/skyway-core + config only
76
94
  'clean',
77
95
  'migrate',
78
96
  'migrate convert',
97
+ 'migrate:convert',
79
98
  'migrate create',
99
+ 'migrate:create',
80
100
  // Install wizard - uses @memberjunction/installer engine (lightweight, no bootstrap)
81
101
  'install',
82
102
  // Doctor - uses @memberjunction/installer engine (lightweight, no bootstrap)
@@ -87,14 +107,19 @@ export const LIGHT_COMMANDS = new Set([
87
107
  'ai',
88
108
  'queue',
89
109
  'ai audit',
110
+ 'ai:audit',
90
111
  'test',
91
112
  'dbdoc',
92
113
  'dev',
93
114
  // Dev workspace generator - node stdlib + chalk only, no bootstrap
94
115
  'dev workspace',
116
+ 'dev:workspace',
95
117
  'dev workspace status',
118
+ 'dev:workspace:status',
96
119
  'dev workspace doctor',
120
+ 'dev:workspace:doctor',
97
121
  'dev workspace clean',
122
+ 'dev:workspace:clean',
98
123
  // SQL conversion commands - use @memberjunction/sql-converter + sqlglot-ts only
99
124
  'sql-convert',
100
125
  'sql-audit',
@@ -106,13 +131,21 @@ export const LIGHT_COMMANDS = new Set([
106
131
  // Must be light to break the circular dependency: server-bootstrap-lite's prebuild calls
107
132
  // `mj codegen manifest`, but bootstrap-lite must be built before MJCLI's prerun can import it.
108
133
  'codegen manifest',
134
+ 'codegen:manifest',
109
135
  // DBDoc commands - already use dynamic imports internally
110
136
  'dbdoc init',
137
+ 'dbdoc:init',
111
138
  'dbdoc analyze',
139
+ 'dbdoc:analyze',
112
140
  'dbdoc export',
141
+ 'dbdoc:export',
113
142
  'dbdoc export-sample-queries',
143
+ 'dbdoc:export-sample-queries',
114
144
  'dbdoc generate-queries',
145
+ 'dbdoc:generate-queries',
115
146
  'dbdoc reset',
147
+ 'dbdoc:reset',
116
148
  'dbdoc status',
149
+ 'dbdoc:status',
117
150
  ]);
118
151
  //# sourceMappingURL=light-commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,0EAA0E;IAC1E,qEAAqE;IACrE,OAAO;IACP,YAAY;IACZ,eAAe;IACf,WAAW;IACX,oFAAoF;IACpF,kFAAkF;IAClF,kFAAkF;IAClF,oFAAoF;IACpF,2CAA2C;IAC3C,UAAU;IACV,UAAU;IACV,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,qBAAqB;IACrB,qBAAqB;IACrB,cAAc;IACd,cAAc;IAEd,4DAA4D;IAC5D,YAAY;IAEZ,sCAAsC;IACtC,MAAM;IAEN,oEAAoE;IACpE,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAEhB,qFAAqF;IACrF,SAAS;IAET,6EAA6E;IAC7E,QAAQ;IAER,4FAA4F;IAC5F,QAAQ;IAER,kEAAkE;IAClE,IAAI;IACJ,OAAO;IACP,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IAEL,mEAAmE;IACnE,eAAe;IACf,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IAErB,gFAAgF;IAChF,aAAa;IACb,WAAW;IAEX,8EAA8E;IAC9E,oCAAoC;IACpC,gBAAgB;IAChB,eAAe;IAEf,kGAAkG;IAClG,yFAAyF;IACzF,+FAA+F;IAC/F,kBAAkB;IAElB,0DAA0D;IAC1D,YAAY;IACZ,eAAe;IACf,cAAc;IACd,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;IACb,cAAc;CACf,CAAC,CAAC"}
1
+ {"version":3,"file":"light-commands.js","sourceRoot":"","sources":["../src/light-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,yBAAyB;IACzB,SAAS;IACT,MAAM;IAEN,0EAA0E;IAC1E,qEAAqE;IACrE,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,eAAe;IACf,WAAW;IACX,WAAW;IACX,oFAAoF;IACpF,kFAAkF;IAClF,kFAAkF;IAClF,oFAAoF;IACpF,2CAA2C;IAC3C,UAAU;IACV,UAAU;IACV,aAAa;IACb,aAAa;IACb,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ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