@memberjunction/cli 5.34.1 → 5.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ArtifactsReclassify extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ 'conversation-id': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ since: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ apply: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ private findReclassifyTargets;
14
+ }
15
+ //# sourceMappingURL=reclassify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reclassify.d.ts","sourceRoot":"","sources":["../../../src/commands/artifacts/reclassify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAqB7C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IACpD,MAAM,CAAC,WAAW,SAIsG;IAExH,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;;;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA+FZ,qBAAqB;CA6FtC"}
@@ -0,0 +1,189 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import ora from 'ora-classic';
3
+ import sql from 'mssql';
4
+ import { ArtifactMetadataEngine } from '@memberjunction/core-entities';
5
+ import { RunView, LogStatus, SetProductionStatus } from '@memberjunction/core';
6
+ import { UUIDsEqual } from '@memberjunction/global';
7
+ import { setupSQLServerClient, SQLServerProviderConfigData, UserCache } from '@memberjunction/sqlserver-dataprovider';
8
+ import { getValidatedConfig } from '../../config.js';
9
+ const JSON_FALLBACK_ID = 'AE674C7E-EA0D-49EA-89E4-0649F5EB20D4';
10
+ export default class ArtifactsReclassify extends Command {
11
+ static { this.description = 'Upgrade-recovery utility for v5.35 artifact unification. Re-evaluates rows whose TypeID is the deleted JSON fallback but whose actual content does not parse as JSON. ' +
12
+ 'Normally a no-op: the v5.35 backfill migration handles this automatically. This command is only relevant when the migration ran BEFORE the artifact-type metadata ' +
13
+ '(Generic Text / Generic Binary) was pushed via `mj sync push`, in which case the migration prints a notice telling you to run this. ' +
14
+ 'Reports "no candidates" once everything is reconciled. Dry-run by default; --apply writes through Record Changes.'; }
15
+ static { this.examples = [
16
+ `<%= config.bin %> <%= command.id %>`,
17
+ `<%= config.bin %> <%= command.id %> --apply --limit 50`,
18
+ ]; }
19
+ static { this.flags = {
20
+ 'conversation-id': Flags.string({ description: 'Scope to artifacts attached to the given conversation.' }),
21
+ since: Flags.string({ description: 'Scope to artifacts created on/after this ISO date.' }),
22
+ limit: Flags.integer({ description: 'Maximum number of rows to inspect.', default: 100 }),
23
+ apply: Flags.boolean({ description: 'Write changes. Without this flag, this command only reports what it would do.', default: false }),
24
+ verbose: Flags.boolean({ char: 'v', description: 'Print every candidate row, not just the summary.' }),
25
+ }; }
26
+ async run() {
27
+ const { flags } = await this.parse(ArtifactsReclassify);
28
+ SetProductionStatus(false);
29
+ const spinner = ora('Connecting to database...').start();
30
+ const config = getValidatedConfig();
31
+ const pool = new sql.ConnectionPool({
32
+ server: config.dbHost,
33
+ port: config.dbPort,
34
+ user: config.codeGenLogin,
35
+ password: config.codeGenPassword,
36
+ database: config.dbDatabase,
37
+ options: {
38
+ encrypt: config.dbHost.includes('.database.windows.net'),
39
+ trustServerCertificate: config.dbTrustServerCertificate ?? true,
40
+ },
41
+ });
42
+ await pool.connect();
43
+ const providerConfig = new SQLServerProviderConfigData(pool, config.coreSchema ?? '__mj');
44
+ await setupSQLServerClient(providerConfig);
45
+ const sysUser = UserCache.Instance.GetSystemUser();
46
+ if (!sysUser) {
47
+ spinner.fail('System user not found in UserCache.');
48
+ await pool.close();
49
+ this.error('Cannot resolve system user for artifact reclassification.');
50
+ }
51
+ await ArtifactMetadataEngine.Instance.Config(true, sysUser);
52
+ spinner.succeed('Connected.');
53
+ // Phase B candidates only — phase A (attachment backfill) ran in the
54
+ // migration. The CLI tightens the loop on JSON-fallback typed rows
55
+ // whose actual content doesn't parse as JSON.
56
+ const targets = await this.findReclassifyTargets(flags, sysUser);
57
+ if (targets.length === 0) {
58
+ this.log('No JSON-fallback artifact versions found that need reclassification.');
59
+ await pool.close();
60
+ return;
61
+ }
62
+ const byProposed = new Map();
63
+ for (const t of targets) {
64
+ const key = t.proposedTypeName ?? '<no match — leave alone>';
65
+ byProposed.set(key, (byProposed.get(key) ?? 0) + 1);
66
+ }
67
+ this.log(`Found ${targets.length} candidate(s):`);
68
+ for (const [name, n] of byProposed) {
69
+ this.log(` ${n.toString().padStart(6)} → ${name}`);
70
+ }
71
+ if (flags.verbose) {
72
+ this.log('');
73
+ for (const t of targets) {
74
+ this.log(` ${t.artifactVersionId} ${t.currentTypeName} → ${t.proposedTypeName ?? '(no match)'}: ${t.reason}`);
75
+ }
76
+ }
77
+ if (!flags.apply) {
78
+ this.log('\nDry run. Re-run with --apply to write changes (passes through Record Changes).');
79
+ await pool.close();
80
+ return;
81
+ }
82
+ const writeable = targets.filter(t => t.proposedTypeID && !UUIDsEqual(t.proposedTypeID, t.currentTypeID));
83
+ if (writeable.length === 0) {
84
+ this.log('\nNothing to apply (all rows either have no match or already point to the correct type).');
85
+ await pool.close();
86
+ return;
87
+ }
88
+ const applySpinner = ora(`Applying ${writeable.length} change(s)...`).start();
89
+ let updated = 0;
90
+ let failed = 0;
91
+ for (const t of writeable) {
92
+ try {
93
+ await pool.request()
94
+ .input('artifactId', sql.UniqueIdentifier, t.artifactId)
95
+ .input('typeId', sql.UniqueIdentifier, t.proposedTypeID)
96
+ .query("UPDATE __mj.Artifact SET TypeID = @typeId WHERE ID = @artifactId");
97
+ updated++;
98
+ }
99
+ catch (err) {
100
+ failed++;
101
+ LogStatus(` Failed to update artifact ${t.artifactId}: ${err instanceof Error ? err.message : String(err)}`);
102
+ }
103
+ }
104
+ applySpinner.succeed(`Applied ${updated} update(s). ${failed} failure(s).`);
105
+ if (failed > 0) {
106
+ this.error(`${failed} update(s) failed — see log above.`);
107
+ }
108
+ await pool.close();
109
+ }
110
+ async findReclassifyTargets(flags, contextUser) {
111
+ const rv = new RunView();
112
+ const filters = [`TypeID='${JSON_FALLBACK_ID}'`];
113
+ if (flags.since)
114
+ filters.push(`__mj_CreatedAt >= '${flags.since}'`);
115
+ const extraFilter = filters.join(' AND ');
116
+ const artifactsResult = await rv.RunView({
117
+ EntityName: 'MJ: Artifacts',
118
+ ExtraFilter: extraFilter,
119
+ Fields: ['ID', 'TypeID', 'Type'],
120
+ MaxRows: flags.limit,
121
+ ResultType: 'simple',
122
+ }, contextUser);
123
+ if (!artifactsResult.Success || artifactsResult.Results.length === 0)
124
+ return [];
125
+ const artifactIds = artifactsResult.Results.map(a => `'${a.ID}'`).join(',');
126
+ const versionsResult = await rv.RunView({
127
+ EntityName: 'MJ: Artifact Versions',
128
+ ExtraFilter: `ArtifactID IN (${artifactIds}) AND VersionNumber = 1`,
129
+ Fields: ['ID', 'ArtifactID', 'Content', 'ContentMode', 'MimeType', 'FileName'],
130
+ ResultType: 'simple',
131
+ }, contextUser);
132
+ if (!versionsResult.Success)
133
+ return [];
134
+ const genericText = ArtifactMetadataEngine.Instance.ArtifactTypes.find(t => t.Name === 'Generic Text');
135
+ const genericBinary = ArtifactMetadataEngine.Instance.ArtifactTypes.find(t => t.Name === 'Generic Binary');
136
+ const targets = [];
137
+ for (const v of versionsResult.Results) {
138
+ const artifact = artifactsResult.Results.find(a => UUIDsEqual(a.ID, v.ArtifactID));
139
+ let proposedTypeID = null;
140
+ let proposedTypeName = null;
141
+ let reason = '';
142
+ // 1. Try the MIME resolver first — most precise.
143
+ if (v.MimeType) {
144
+ const ext = v.FileName?.includes('.') ? v.FileName.split('.').pop() : undefined;
145
+ const resolved = ArtifactMetadataEngine.Instance.GetArtifactTypeByMimeType(v.MimeType, ext);
146
+ if (resolved && !UUIDsEqual(resolved.ID, artifact.TypeID)) {
147
+ proposedTypeID = resolved.ID;
148
+ proposedTypeName = resolved.Name;
149
+ reason = `MIME "${v.MimeType}" resolves to ${resolved.Name}`;
150
+ }
151
+ }
152
+ // 2. File-backed without a useful MIME → Generic Binary.
153
+ if (!proposedTypeID && v.ContentMode === 'File' && genericBinary) {
154
+ proposedTypeID = genericBinary.ID;
155
+ proposedTypeName = genericBinary.Name;
156
+ reason = 'File-backed version with no registered MIME → Generic Binary';
157
+ }
158
+ // 3. Inline text that fails JSON parse → Generic Text.
159
+ if (!proposedTypeID && v.Content && genericText) {
160
+ let isJson = false;
161
+ try {
162
+ JSON.parse(v.Content);
163
+ isJson = true;
164
+ }
165
+ catch {
166
+ isJson = false;
167
+ }
168
+ if (!isJson) {
169
+ proposedTypeID = genericText.ID;
170
+ proposedTypeName = genericText.Name;
171
+ reason = 'Inline content does not parse as JSON → Generic Text';
172
+ }
173
+ }
174
+ if (!proposedTypeID)
175
+ continue;
176
+ targets.push({
177
+ artifactVersionId: v.ID,
178
+ artifactId: artifact.ID,
179
+ currentTypeID: artifact.TypeID,
180
+ currentTypeName: artifact.Type ?? 'JSON',
181
+ proposedTypeID,
182
+ proposedTypeName,
183
+ reason,
184
+ });
185
+ }
186
+ return targets;
187
+ }
188
+ }
189
+ //# sourceMappingURL=reclassify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reclassify.js","sourceRoot":"","sources":["../../../src/commands/artifacts/reclassify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,GAAG,MAAM,OA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,139 @@
338
338
  "upgrade.js"
339
339
  ]
340
340
  },
341
+ "artifacts:reclassify": {
342
+ "aliases": [],
343
+ "args": {},
344
+ "description": "Upgrade-recovery utility for v5.35 artifact unification. Re-evaluates rows whose TypeID is the deleted JSON fallback but whose actual content does not parse as JSON. Normally a no-op: the v5.35 backfill migration handles this automatically. This command is only relevant when the migration ran BEFORE the artifact-type metadata (Generic Text / Generic Binary) was pushed via `mj sync push`, in which case the migration prints a notice telling you to run this. Reports \"no candidates\" once everything is reconciled. Dry-run by default; --apply writes through Record Changes.",
345
+ "examples": [
346
+ "<%= config.bin %> <%= command.id %>",
347
+ "<%= config.bin %> <%= command.id %> --apply --limit 50"
348
+ ],
349
+ "flags": {
350
+ "conversation-id": {
351
+ "description": "Scope to artifacts attached to the given conversation.",
352
+ "name": "conversation-id",
353
+ "hasDynamicHelp": false,
354
+ "multiple": false,
355
+ "type": "option"
356
+ },
357
+ "since": {
358
+ "description": "Scope to artifacts created on/after this ISO date.",
359
+ "name": "since",
360
+ "hasDynamicHelp": false,
361
+ "multiple": false,
362
+ "type": "option"
363
+ },
364
+ "limit": {
365
+ "description": "Maximum number of rows to inspect.",
366
+ "name": "limit",
367
+ "default": 100,
368
+ "hasDynamicHelp": false,
369
+ "multiple": false,
370
+ "type": "option"
371
+ },
372
+ "apply": {
373
+ "description": "Write changes. Without this flag, this command only reports what it would do.",
374
+ "name": "apply",
375
+ "allowNo": false,
376
+ "type": "boolean"
377
+ },
378
+ "verbose": {
379
+ "char": "v",
380
+ "description": "Print every candidate row, not just the summary.",
381
+ "name": "verbose",
382
+ "allowNo": false,
383
+ "type": "boolean"
384
+ }
385
+ },
386
+ "hasDynamicHelp": false,
387
+ "hiddenAliases": [],
388
+ "id": "artifacts:reclassify",
389
+ "pluginAlias": "@memberjunction/cli",
390
+ "pluginName": "@memberjunction/cli",
391
+ "pluginType": "core",
392
+ "strict": true,
393
+ "enableJsonFlag": false,
394
+ "isESM": true,
395
+ "relativePath": [
396
+ "dist",
397
+ "commands",
398
+ "artifacts",
399
+ "reclassify.js"
400
+ ]
401
+ },
402
+ "bump": {
403
+ "aliases": [],
404
+ "args": {},
405
+ "description": "Bumps MemberJunction dependency versions",
406
+ "examples": [
407
+ {
408
+ "command": "<%= config.bin %> <%= command.id %>",
409
+ "description": "Bump all @memberjunction/* dependencies in the current directory's package.json to the CLI version"
410
+ },
411
+ {
412
+ "command": "<%= config.bin %> <%= command.id %> -rdv",
413
+ "description": "Preview all recursive packages bumps without writing any changes."
414
+ },
415
+ {
416
+ "command": "<%= config.bin %> <%= command.id %> -rqt v2.10.0 | xargs -n1 -I{} npm install --prefix {}",
417
+ "description": "Recursively bump all @memberjunction/* dependencies in all packages to version v2.10.0 and output only the paths containing the updated package.json files. Pipe the output to xargs to run npm install in each directory and update the package-lock.json files as well."
418
+ }
419
+ ],
420
+ "flags": {
421
+ "verbose": {
422
+ "char": "v",
423
+ "description": "Enable additional logging",
424
+ "name": "verbose",
425
+ "allowNo": false,
426
+ "type": "boolean"
427
+ },
428
+ "recursive": {
429
+ "char": "r",
430
+ "description": "Bump version in current directory and all subdirectories",
431
+ "name": "recursive",
432
+ "allowNo": false,
433
+ "type": "boolean"
434
+ },
435
+ "tag": {
436
+ "char": "t",
437
+ "description": "Version tag to bump target for bump (e.g. v2.10.0), defaults to the CLI version",
438
+ "name": "tag",
439
+ "hasDynamicHelp": false,
440
+ "multiple": false,
441
+ "type": "option"
442
+ },
443
+ "quiet": {
444
+ "char": "q",
445
+ "description": "Only output paths for updated packages",
446
+ "name": "quiet",
447
+ "allowNo": false,
448
+ "type": "boolean"
449
+ },
450
+ "dry": {
451
+ "char": "d",
452
+ "description": "Dry run, do not write changes to package.json files",
453
+ "name": "dry",
454
+ "allowNo": false,
455
+ "type": "boolean"
456
+ }
457
+ },
458
+ "hasDynamicHelp": false,
459
+ "hiddenAliases": [],
460
+ "id": "bump",
461
+ "pluginAlias": "@memberjunction/cli",
462
+ "pluginName": "@memberjunction/cli",
463
+ "pluginType": "core",
464
+ "strict": true,
465
+ "enableJsonFlag": false,
466
+ "isESM": true,
467
+ "relativePath": [
468
+ "dist",
469
+ "commands",
470
+ "bump",
471
+ "index.js"
472
+ ]
473
+ },
341
474
  "clean": {
342
475
  "aliases": [],
343
476
  "args": {},
@@ -773,78 +906,6 @@
773
906
  "manifest.js"
774
907
  ]
775
908
  },
776
- "bump": {
777
- "aliases": [],
778
- "args": {},
779
- "description": "Bumps MemberJunction dependency versions",
780
- "examples": [
781
- {
782
- "command": "<%= config.bin %> <%= command.id %>",
783
- "description": "Bump all @memberjunction/* dependencies in the current directory's package.json to the CLI version"
784
- },
785
- {
786
- "command": "<%= config.bin %> <%= command.id %> -rdv",
787
- "description": "Preview all recursive packages bumps without writing any changes."
788
- },
789
- {
790
- "command": "<%= config.bin %> <%= command.id %> -rqt v2.10.0 | xargs -n1 -I{} npm install --prefix {}",
791
- "description": "Recursively bump all @memberjunction/* dependencies in all packages to version v2.10.0 and output only the paths containing the updated package.json files. Pipe the output to xargs to run npm install in each directory and update the package-lock.json files as well."
792
- }
793
- ],
794
- "flags": {
795
- "verbose": {
796
- "char": "v",
797
- "description": "Enable additional logging",
798
- "name": "verbose",
799
- "allowNo": false,
800
- "type": "boolean"
801
- },
802
- "recursive": {
803
- "char": "r",
804
- "description": "Bump version in current directory and all subdirectories",
805
- "name": "recursive",
806
- "allowNo": false,
807
- "type": "boolean"
808
- },
809
- "tag": {
810
- "char": "t",
811
- "description": "Version tag to bump target for bump (e.g. v2.10.0), defaults to the CLI version",
812
- "name": "tag",
813
- "hasDynamicHelp": false,
814
- "multiple": false,
815
- "type": "option"
816
- },
817
- "quiet": {
818
- "char": "q",
819
- "description": "Only output paths for updated packages",
820
- "name": "quiet",
821
- "allowNo": false,
822
- "type": "boolean"
823
- },
824
- "dry": {
825
- "char": "d",
826
- "description": "Dry run, do not write changes to package.json files",
827
- "name": "dry",
828
- "allowNo": false,
829
- "type": "boolean"
830
- }
831
- },
832
- "hasDynamicHelp": false,
833
- "hiddenAliases": [],
834
- "id": "bump",
835
- "pluginAlias": "@memberjunction/cli",
836
- "pluginName": "@memberjunction/cli",
837
- "pluginType": "core",
838
- "strict": true,
839
- "enableJsonFlag": false,
840
- "isESM": true,
841
- "relativePath": [
842
- "dist",
843
- "commands",
844
- "bump",
845
- "index.js"
846
- ]
847
- },
848
909
  "dbdoc:analyze": {
849
910
  "aliases": [],
850
911
  "args": {},
@@ -3766,5 +3827,5 @@
3766
3827
  ]
3767
3828
  }
3768
3829
  },
3769
- "version": "5.34.1"
3830
+ "version": "5.36.0"
3770
3831
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/cli",
3
3
  "type": "module",
4
- "version": "5.34.1",
4
+ "version": "5.36.0",
5
5
  "description": "MemberJunction command line tools",
6
6
  "keywords": [
7
7
  "oclif"
@@ -54,23 +54,23 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@inquirer/prompts": "^8.2.0",
57
- "@memberjunction/ai-cli": "5.34.1",
58
- "@memberjunction/codegen-lib": "5.34.1",
59
- "@memberjunction/config": "5.34.1",
60
- "@memberjunction/core": "5.34.1",
61
- "@memberjunction/generic-database-provider": "5.34.1",
62
- "@memberjunction/installer": "5.34.1",
63
- "@memberjunction/db-auto-doc": "5.34.1",
64
- "@memberjunction/metadata-sync": "5.34.1",
65
- "@memberjunction/open-app-engine": "5.34.1",
66
- "@memberjunction/query-gen": "5.34.1",
67
- "@memberjunction/server-bootstrap-lite": "5.34.1",
57
+ "@memberjunction/ai-cli": "5.36.0",
58
+ "@memberjunction/codegen-lib": "5.36.0",
59
+ "@memberjunction/config": "5.36.0",
60
+ "@memberjunction/core": "5.36.0",
61
+ "@memberjunction/generic-database-provider": "5.36.0",
62
+ "@memberjunction/installer": "5.36.0",
63
+ "@memberjunction/db-auto-doc": "5.36.0",
64
+ "@memberjunction/metadata-sync": "5.36.0",
65
+ "@memberjunction/open-app-engine": "5.36.0",
66
+ "@memberjunction/query-gen": "5.36.0",
67
+ "@memberjunction/server-bootstrap-lite": "5.36.0",
68
68
  "@memberjunction/skyway-core": "^0.6.1",
69
69
  "@memberjunction/skyway-postgres": "^0.6.1",
70
70
  "@memberjunction/skyway-sqlserver": "^0.6.1",
71
- "@memberjunction/sql-converter": "5.34.1",
72
- "@memberjunction/sqlserver-dataprovider": "5.34.1",
73
- "@memberjunction/testing-cli": "5.34.1",
71
+ "@memberjunction/sql-converter": "5.36.0",
72
+ "@memberjunction/sqlserver-dataprovider": "5.36.0",
73
+ "@memberjunction/testing-cli": "5.36.0",
74
74
  "@oclif/core": "^3.27.0",
75
75
  "@oclif/plugin-help": "^6.2.37",
76
76
  "@oclif/plugin-version": "^2.2.36",