Skip to content

Commit f821533

Browse files
authored
Merge pull request #1447 from contentstack/staging
DX | 03-07-2024 | Release
2 parents a430b18 + c3f16b6 commit f821533

File tree

71 files changed

+1464
-1212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1464
-1212
lines changed

package-lock.json

Lines changed: 316 additions & 290 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
1919
$ csdx COMMAND
2020
running command...
2121
$ csdx (--version|-v)
22-
@contentstack/cli-audit/1.6.2 darwin-arm64 node-v21.6.2
22+
@contentstack/cli-audit/1.6.3 darwin-arm64 node-v22.2.0
2323
$ csdx --help [COMMAND]
2424
USAGE
2525
$ csdx COMMAND
@@ -267,7 +267,7 @@ EXAMPLES
267267
$ csdx plugins
268268
```
269269

270-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/index.ts)_
270+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/index.ts)_
271271

272272
## `csdx plugins:add PLUGIN`
273273

@@ -292,7 +292,7 @@ GLOBAL FLAGS
292292
DESCRIPTION
293293
Installs a plugin into csdx.
294294
295-
Uses bundled npm executable to install plugins into /Users/raj.pandey/.local/share/@contentstack/cli-audit
295+
Uses npm to install plugins.
296296
297297
Installation of a user-installed plugin will override a core plugin.
298298
@@ -341,7 +341,7 @@ EXAMPLES
341341
$ csdx plugins:inspect myplugin
342342
```
343343

344-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/inspect.ts)_
344+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/inspect.ts)_
345345

346346
## `csdx plugins:install PLUGIN`
347347

@@ -366,7 +366,7 @@ GLOBAL FLAGS
366366
DESCRIPTION
367367
Installs a plugin into csdx.
368368
369-
Uses bundled npm executable to install plugins into /Users/raj.pandey/.local/share/@contentstack/cli-audit
369+
Uses npm to install plugins.
370370
371371
Installation of a user-installed plugin will override a core plugin.
372372
@@ -390,7 +390,7 @@ EXAMPLES
390390
$ csdx plugins:install someuser/someplugin
391391
```
392392

393-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/install.ts)_
393+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/install.ts)_
394394

395395
## `csdx plugins:link PATH`
396396

@@ -420,7 +420,7 @@ EXAMPLES
420420
$ csdx plugins:link myplugin
421421
```
422422

423-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/link.ts)_
423+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/link.ts)_
424424

425425
## `csdx plugins:remove [PLUGIN]`
426426

@@ -461,7 +461,7 @@ FLAGS
461461
--reinstall Reinstall all plugins after uninstalling.
462462
```
463463

464-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/reset.ts)_
464+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/reset.ts)_
465465

466466
## `csdx plugins:uninstall [PLUGIN]`
467467

@@ -489,7 +489,7 @@ EXAMPLES
489489
$ csdx plugins:uninstall myplugin
490490
```
491491

492-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/uninstall.ts)_
492+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/uninstall.ts)_
493493

494494
## `csdx plugins:unlink [PLUGIN]`
495495

@@ -533,5 +533,5 @@ DESCRIPTION
533533
Update installed plugins.
534534
```
535535

536-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.0.21/src/commands/plugins/update.ts)_
536+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.3/src/commands/plugins/update.ts)_
537537
<!-- commandsstop -->

packages/contentstack-audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-audit",
3-
"version": "1.6.2",
3+
"version": "1.6.3",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",
@@ -19,7 +19,7 @@
1919
],
2020
"dependencies": {
2121
"@contentstack/cli-command": "~1.2.18",
22-
"@contentstack/cli-utilities": "~1.6.2",
22+
"@contentstack/cli-utilities": "~1.6.3",
2323
"@oclif/plugin-help": "^5",
2424
"@oclif/plugin-plugins": "^5.0.0",
2525
"chalk": "^4.1.2",

packages/contentstack-audit/src/messages/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const auditFixMsg = {
4646
EMPTY_FIX_MSG: 'Successfully removed the empty field/block found at {path} from the schema.',
4747
AUDIT_FIX_CMD_DESCRIPTION: 'Perform audits and fix possible errors in the exported Contentstack data.',
4848
WF_FIX_MSG: 'Successfully removed the workflow {uid} named {name}.',
49-
ENTRY_MANDATORY_FIELD_FIX: `Removing the publish details from entry uid '{uid}' from locale '{locale}'`,
50-
ENTRY_SELECT_FIELD_FIX: `Adding the value '{value}' in select field of uid '{uid}'`
49+
ENTRY_MANDATORY_FIELD_FIX: `Removing the publish details from the entry with UID '{uid}' in Locale '{locale}'...`,
50+
ENTRY_SELECT_FIELD_FIX: `Adding the value '{value}' in the select field of entry UID '{uid}'...`
5151
};
5252

5353
const messages: typeof errors &

packages/contentstack-audit/src/modules/entries.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default class Entries {
5959
protected missingMandatoryFields: Record<string, any> = {};
6060
public entryMetaData: Record<string, any>[] = [];
6161
public moduleName: keyof typeof auditConfig.moduleConfig = 'entries';
62-
public isEntryWithoutTitleField: boolean = false;
6362

6463
constructor({ log, fix, config, moduleName, ctSchema, gfSchema }: ModuleConstructorParam & CtConstructorParam) {
6564
this.log = log;
@@ -128,7 +127,7 @@ export default class Entries {
128127
this.lookForReference([{ locale: code, uid, name: title }], ctSchema, this.entries[entryUid]);
129128

130129
const fields = this.missingMandatoryFields[uid];
131-
const isPublished = entry.publish_details.length > 0;
130+
const isPublished = entry.publish_details?.length > 0;
132131
if ((this.fix && fields.length && isPublished) || (!this.fix && fields)) {
133132
const fixStatus = this.fix ? 'Fixed' : '';
134133
fields?.forEach((field: { isPublished: boolean; fixStatus?: string }) => {
@@ -1262,15 +1261,13 @@ export default class Entries {
12621261
let { title } = entries[entryUid];
12631262

12641263
if (entries[entryUid].hasOwnProperty('title') && !title) {
1265-
this.isEntryWithoutTitleField = true;
12661264
this.log(
12671265
`The 'title' field in Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' is empty.`,
12681266
`error`,
12691267
);
12701268
} else if (!title) {
1271-
this.isEntryWithoutTitleField = true;
12721269
this.log(
1273-
`Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' does not have a 'title' field.`,
1270+
`The 'title' field in Entry with UID '${entryUid}' of Content Type '${uid}' in Locale '${code}' is empty.`,
12741271
`error`,
12751272
);
12761273
}
@@ -1279,8 +1276,5 @@ export default class Entries {
12791276
}
12801277
}
12811278
}
1282-
if (this.isEntryWithoutTitleField) {
1283-
// throw Error(`Entries found with missing 'title' field! Please make the data corrections and re-run the audit.`);
1284-
}
12851279
}
12861280
}

packages/contentstack-audit/src/modules/extensions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export default class Extensions {
6868

6969
if (ctNotPresent?.length && ext.scope) {
7070
ext.content_types = ctNotPresent;
71-
ctNotPresent.forEach((ct) => this.missingCts.add(ct));
72-
this.missingCtInExtensions.push(cloneDeep(ext));
71+
ctNotPresent.forEach((ct) => this.missingCts?.add(ct));
72+
this.missingCtInExtensions?.push(cloneDeep(ext));
7373
}
7474

7575
this.log(

packages/contentstack-auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
1818
$ csdx COMMAND
1919
running command...
2020
$ csdx (--version)
21-
@contentstack/cli-auth/1.3.18 darwin-arm64 node-v21.6.2
21+
@contentstack/cli-auth/1.3.19 darwin-arm64 node-v22.2.0
2222
$ csdx --help [COMMAND]
2323
USAGE
2424
$ csdx COMMAND

packages/contentstack-auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-auth",
33
"description": "Contentstack CLI plugin for authentication activities",
4-
"version": "1.3.18",
4+
"version": "1.3.19",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@contentstack/cli-command": "~1.2.18",
26-
"@contentstack/cli-utilities": "~1.6.2",
26+
"@contentstack/cli-utilities": "~1.6.3",
2727
"chalk": "^4.0.0",
2828
"debug": "^4.1.1",
2929
"inquirer": "8.2.4",
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"IS_TS": true,
33
"UNIT_EXECUTION_ORDER": [],
4-
"INTEGRATION_EXECUTION_ORDER": []
4+
"INTEGRATION_EXECUTION_ORDER": [],
5+
"password": "testpassword",
6+
"invalidPassowrd": "invalidpassword",
7+
"validAPIKey": "adasdfagsf"
58
}

packages/contentstack-auth/test/integration/auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { expect, test } from '@oclif/test';
33
// @ts-ignore
44
import { Helper } from './helper';
55
// @ts-ignore
6-
import { PRINT_LOGS } from './config.json';
6+
import { PRINT_LOGS, encryptionKey } from './config.json';
77
import { cliux as CliUx, messageHandler, NodeCrypto } from '@contentstack/cli-utilities';
88

99
const messageFilePath = path.join(__dirname, '..', '..', '..', 'contentstack-utilities', 'messages/auth.json');
1010
const crypto = new NodeCrypto({
1111
typeIdentifier: '◈',
1212
algorithm: 'aes-192-cbc',
13-
encryptionKey: process.env.ENCRYPTION_KEY || '***REMOVED***'
13+
encryptionKey: process.env.ENCRYPTION_KEY || encryptionKey
1414
});
1515
const username = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.USERNAME) : process.env.USERNAME
1616
const password = process.env.ENCRYPTION_KEY ? crypto.decrypt(process.env.PASSWORD) : process.env.PASSWORD

0 commit comments

Comments
 (0)