@contentstack/cli-audit 1.16.0 → 1.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +9 -9
- package/lib/audit-base-command.d.ts +0 -4
- package/lib/audit-base-command.js +8 -19
- package/lib/config/index.d.ts +3 -3
- package/lib/config/index.js +6 -6
- package/lib/types/context.d.ts +0 -5
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
|
|
|
19
19
|
$ csdx COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ csdx (--version|-v)
|
|
22
|
-
@contentstack/cli-audit/1.16.
|
|
22
|
+
@contentstack/cli-audit/1.16.2 linux-x64 node-v22.21.1
|
|
23
23
|
$ csdx --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ csdx COMMAND
|
|
@@ -282,7 +282,7 @@ DESCRIPTION
|
|
|
282
282
|
Display help for csdx.
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.
|
|
285
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
|
|
286
286
|
|
|
287
287
|
## `csdx plugins`
|
|
288
288
|
|
|
@@ -305,7 +305,7 @@ EXAMPLES
|
|
|
305
305
|
$ csdx plugins
|
|
306
306
|
```
|
|
307
307
|
|
|
308
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
308
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/index.ts)_
|
|
309
309
|
|
|
310
310
|
## `csdx plugins:add PLUGIN`
|
|
311
311
|
|
|
@@ -379,7 +379,7 @@ EXAMPLES
|
|
|
379
379
|
$ csdx plugins:inspect myplugin
|
|
380
380
|
```
|
|
381
381
|
|
|
382
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
382
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/inspect.ts)_
|
|
383
383
|
|
|
384
384
|
## `csdx plugins:install PLUGIN`
|
|
385
385
|
|
|
@@ -428,7 +428,7 @@ EXAMPLES
|
|
|
428
428
|
$ csdx plugins:install someuser/someplugin
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
431
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/install.ts)_
|
|
432
432
|
|
|
433
433
|
## `csdx plugins:link PATH`
|
|
434
434
|
|
|
@@ -459,7 +459,7 @@ EXAMPLES
|
|
|
459
459
|
$ csdx plugins:link myplugin
|
|
460
460
|
```
|
|
461
461
|
|
|
462
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
462
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/link.ts)_
|
|
463
463
|
|
|
464
464
|
## `csdx plugins:remove [PLUGIN]`
|
|
465
465
|
|
|
@@ -500,7 +500,7 @@ FLAGS
|
|
|
500
500
|
--reinstall Reinstall all plugins after uninstalling.
|
|
501
501
|
```
|
|
502
502
|
|
|
503
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
503
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/reset.ts)_
|
|
504
504
|
|
|
505
505
|
## `csdx plugins:uninstall [PLUGIN]`
|
|
506
506
|
|
|
@@ -528,7 +528,7 @@ EXAMPLES
|
|
|
528
528
|
$ csdx plugins:uninstall myplugin
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
531
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/uninstall.ts)_
|
|
532
532
|
|
|
533
533
|
## `csdx plugins:unlink [PLUGIN]`
|
|
534
534
|
|
|
@@ -572,5 +572,5 @@ DESCRIPTION
|
|
|
572
572
|
Update installed plugins.
|
|
573
573
|
```
|
|
574
574
|
|
|
575
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
575
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/update.ts)_
|
|
576
576
|
<!-- commandsstop -->
|
|
@@ -12,10 +12,6 @@ export declare abstract class AuditBaseCommand extends BaseCommand<typeof AuditB
|
|
|
12
12
|
get: (row: any) => string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Create audit context object similar to export command
|
|
17
|
-
*/
|
|
18
|
-
private createAuditContext;
|
|
19
15
|
/**
|
|
20
16
|
* The `start` function performs an audit on content types, global fields, entries, and workflows and displays
|
|
21
17
|
* any missing references.
|
|
@@ -33,19 +33,6 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
|
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Create audit context object similar to export command
|
|
38
|
-
*/
|
|
39
|
-
createAuditContext(moduleName) {
|
|
40
|
-
var _a, _b, _c;
|
|
41
|
-
return {
|
|
42
|
-
command: ((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'cm:stacks:audit',
|
|
43
|
-
module: moduleName || 'audit',
|
|
44
|
-
email: cli_utilities_1.configHandler.get('email') || '',
|
|
45
|
-
sessionId: ((_c = this.context) === null || _c === void 0 ? void 0 : _c.sessionId) || '',
|
|
46
|
-
authenticationMethod: cli_utilities_1.configHandler.get('authenticationMethod') || '',
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
36
|
/**
|
|
50
37
|
* The `start` function performs an audit on content types, global fields, entries, and workflows and displays
|
|
51
38
|
* any missing references.
|
|
@@ -53,9 +40,11 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
|
|
|
53
40
|
* being executed.
|
|
54
41
|
*/
|
|
55
42
|
async start(command) {
|
|
43
|
+
var _a, _b;
|
|
56
44
|
this.currentCommand = command;
|
|
57
|
-
// Initialize audit context
|
|
58
|
-
|
|
45
|
+
// Initialize audit context (reused, no need to call again in scanAndFix)
|
|
46
|
+
(0, cli_utilities_1.createLogContext)((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command, '', cli_utilities_1.configHandler.get('authenticationMethod'));
|
|
47
|
+
this.auditContext = { module: 'audit' };
|
|
59
48
|
cli_utilities_1.log.debug(`Starting audit command: ${command}`, this.auditContext);
|
|
60
49
|
cli_utilities_1.log.info(`Starting audit command: ${command}`, this.auditContext);
|
|
61
50
|
await this.promptQueue();
|
|
@@ -154,7 +143,7 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
|
|
|
154
143
|
cli_utilities_1.log.debug(`Data module wise: ${JSON.stringify(dataModuleWise)}`, this.auditContext);
|
|
155
144
|
for (const module of this.sharedConfig.flags.modules || this.sharedConfig.modules) {
|
|
156
145
|
// Update audit context with current module
|
|
157
|
-
this.auditContext =
|
|
146
|
+
this.auditContext = { module: module };
|
|
158
147
|
cli_utilities_1.log.debug(`Starting audit for module: ${module}`, this.auditContext);
|
|
159
148
|
cli_utilities_1.log.info(`Starting audit for module: ${module}`, this.auditContext);
|
|
160
149
|
(0, log_1.print)([
|
|
@@ -197,9 +186,9 @@ class AuditBaseCommand extends base_command_1.BaseCommand {
|
|
|
197
186
|
missingEnvLocalesInEntries = (_e = missingEntry.missingEnvLocale) !== null && _e !== void 0 ? _e : {};
|
|
198
187
|
missingMultipleFields = (_f = missingEntry.missingMultipleFields) !== null && _f !== void 0 ? _f : {};
|
|
199
188
|
await this.prepareReport(module, missingEntryRefs);
|
|
200
|
-
await this.prepareReport(`
|
|
201
|
-
await this.prepareReport('
|
|
202
|
-
await this.prepareReport('
|
|
189
|
+
await this.prepareReport(`Entries_Select_field`, missingSelectFeild);
|
|
190
|
+
await this.prepareReport('Entries_Mandatory_field', missingMandatoryFields);
|
|
191
|
+
await this.prepareReport('Entries_Title_field', missingTitleFields);
|
|
203
192
|
await this.prepareReport('Entry_Missing_Locale_and_Env_in_Publish_Details', missingEnvLocalesInEntries);
|
|
204
193
|
await this.prepareReport('Entry_Multiple_Fields', missingMultipleFields);
|
|
205
194
|
this.getAffectedData('entries', dataModuleWise['entries'], missingEntry);
|
package/lib/config/index.d.ts
CHANGED
|
@@ -57,9 +57,9 @@ declare const config: {
|
|
|
57
57
|
};
|
|
58
58
|
OutputTableKeys: string[];
|
|
59
59
|
ReportTitleForEntries: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
Entries_Select_field: string;
|
|
61
|
+
Entries_Mandatory_field: string;
|
|
62
|
+
Entries_Title_field: string;
|
|
63
63
|
Entry_Missing_Locale_and_Env: string;
|
|
64
64
|
Entry_Missing_Locale_and_Env_in_Publish_Details: string;
|
|
65
65
|
Entry_Multiple_Fields: string;
|
package/lib/config/index.js
CHANGED
|
@@ -118,17 +118,17 @@ const config = {
|
|
|
118
118
|
"Passed",
|
|
119
119
|
],
|
|
120
120
|
ReportTitleForEntries: {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
Entries_Select_field: 'Entries_Select_field',
|
|
122
|
+
Entries_Mandatory_field: 'Entries_Mandatory_field',
|
|
123
|
+
Entries_Title_field: 'Entries_Title_field',
|
|
124
124
|
Entry_Missing_Locale_and_Env: 'Entry_Missing_Locale_and_Env',
|
|
125
125
|
Entry_Missing_Locale_and_Env_in_Publish_Details: 'Entry_Missing_Locale_and_Env_in_Publish_Details',
|
|
126
126
|
Entry_Multiple_Fields: "Entry_Multiple_Fields"
|
|
127
127
|
},
|
|
128
128
|
feild_level_modules: [
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
129
|
+
'Entries_Title_field',
|
|
130
|
+
'Entries_Mandatory_field',
|
|
131
|
+
'Entries_Select_field',
|
|
132
132
|
'Entry_Missing_Locale_and_Env_in_Publish_Details',
|
|
133
133
|
'field-rules',
|
|
134
134
|
'Entry_Multiple_Fields',
|
package/lib/types/context.d.ts
CHANGED
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-audit",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "Contentstack audit plugin",
|
|
5
5
|
"author": "Contentstack CLI",
|
|
6
6
|
"homepage": "https://github.com/contentstack/cli",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"/oclif.manifest.json"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@contentstack/cli-command": "~1.
|
|
22
|
-
"@contentstack/cli-utilities": "~1.
|
|
21
|
+
"@contentstack/cli-command": "~1.7.1",
|
|
22
|
+
"@contentstack/cli-utilities": "~1.16.0",
|
|
23
23
|
"@oclif/core": "^4.3.0",
|
|
24
24
|
"@oclif/plugin-help": "^6.2.28",
|
|
25
|
-
"@oclif/plugin-plugins": "^5.4.
|
|
25
|
+
"@oclif/plugin-plugins": "^5.4.54",
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
27
|
"fast-csv": "^4.3.6",
|
|
28
28
|
"fs-extra": "^11.3.0",
|