Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: 069d87fc69d059bd53fa46d98916e831641ea4889cebcc9b9b30884ac67dab30
checksum: 11bf156488b12f529ab393fffa8e9d8741388ef2929263e89650eada87bfcf8a
- filename: packages/contentstack-branches/README.md
checksum: ad32bd365db7f085cc2ea133d69748954606131ec6157a272a3471aea60011c2
- filename: packages/contentstack-branches/src/branch/diff-handler.ts
Expand All @@ -11,4 +11,24 @@ fileignoreconfig:
checksum: d0613295ee26f7a77d026e40db0a4ab726fabd0a74965f729f1a66d1ef14768f
- filename: packages/contentstack-branches/src/branch/merge-handler.ts
checksum: 4fd8dba9b723733530b9ba12e81e1d3e5d60b73ac4c082defb10593f257bb133
- filename: packages/contentstack-export/src/export/modules/environments.ts
checksum: a92c5de7ed8e80f08f911727973a66e0416b4a52265c275d1d25c3095f912811
- filename: packages/contentstack-import/src/utils/backup-handler.ts
checksum: 9a892b5c4b5aac230fb5969e7f34afdac0b6f96208e64bf9d1195468c935c66c
- filename: packages/contentstack-import/test/unit/utils/backup-handler.test.ts
checksum: 69860727e9b3099d8e1e95db2af17fc8b161684f675477981d27877cd8e1b3bb
- filename: pnpm-lock.yaml
checksum: 11bf156488b12f529ab393fffa8e9d8741388ef2929263e89650eada87bfcf8a
- filename: packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts
checksum: 299b8f60cce1f64be7c20786d6a7c9c370474b97b06d1846114a76a70ec20cf7
- filename: packages/contentstack-export/test/unit/export/module-exporter.test.ts
checksum: 67b70c93ed679ccb2c61d0c277380676e33c91da8a423f948e81937e5d1d9479
- filename: packages/contentstack-asset-management/src/import/assets.ts
checksum: ed6af5d798282808c09643e1dcd1eaede89ce2b09bd0425998af64849b4f3f61
- filename: skills/code-review/SKILL.md
checksum: 29673e16f6b41fcec7fa236912e7f72b920ed4a3d9a66a89308b4a058b247f3e
- filename: skills/contentstack-cli/SKILL.md
checksum: 36762d43bbacedd0b344f9d4f1179a88e3dbc7e2467341ba42198dcd1bf9e40c
- filename: skills/testing/SKILL.md
checksum: ee1c82f1bb51860cb26fb9f112a53df0127e316fcb22a094034024741251fa3c
version: '1.0'
2 changes: 1 addition & 1 deletion packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/2.0.0-beta.6 darwin-arm64 node-v24.13.0
@contentstack/cli-audit/2.0.0-beta.9 darwin-arm64 node-v22.13.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-audit/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const config = {
'publish_locale',
'publish_environment',
'asset_uid',
'space_id',
'selectedValue',
'ct_uid',
'action',
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-audit/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const auditMsg = {
ENTRY_PUBLISH_DETAILS: `Removing the publish details for entry '{uid}' of ct '{ctuid}' in locale '{locale}' as locale '{publocale}' or environment '{environment}' does not exist`,
CT_REFERENCE_FIELD: `The mentioned Reference field is not Array field reference is '{reference_to}' having display name '{display_name}''`,
ASSET_NOT_EXIST: `The publish_details either does not exist or is not an array for asset uid '{uid}'`,
AUDITING_SPACE: `Auditing assets for space: '{spaceId}'`,
ENTRY_PUBLISH_DETAILS_NOT_EXIST: `The publish_details either does not exist or is not an array for entry uid '{uid}'`,
FIELD_RULE_CONDITION_ABSENT: `The operand field '{condition_field}' is not present in the schema of the content-type {ctUid}`,
FIELD_RULE_TARGET_ABSENT: `The target field '{target_field}' is not present in the schema of the content-type {ctUid}`,
Expand Down
275 changes: 180 additions & 95 deletions packages/contentstack-audit/src/modules/assets.ts

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions packages/contentstack-audit/src/modules/modulesData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join, resolve } from 'path';
import { existsSync, readFileSync } from 'fs';
import { existsSync, readFileSync, readdirSync } from 'fs';
import { FsUtility, sanitizePath, log } from '@contentstack/cli-utilities';
import { ConfigType, ContentTypeStruct, CtConstructorParam, ModuleConstructorParam } from '../types';
import { keys, values } from 'lodash';
Expand Down Expand Up @@ -46,10 +46,25 @@ export default class ModuleDataReader {
break;
case 'assets': {
log.debug(`Counting assets`, this.config.auditContext);
const assetsPath = join(this.folderPath, 'assets');
log.debug(`Assets path: ${assetsPath}`, this.config.auditContext);
count = (await this.readEntryAssetsModule(assetsPath, 'assets')) || 0;
log.debug(`Assets count: ${count}`, this.config.auditContext);
const spacesDir = join(this.folderPath, 'spaces');
if (existsSync(spacesDir)) {
log.debug(`Multi-space structure detected at: ${spacesDir}`, this.config.auditContext);
const spaceDirs = readdirSync(spacesDir, { withFileTypes: true }).filter(
(entry) => entry.isDirectory() && existsSync(join(spacesDir, entry.name, 'assets')),
);
for (const spaceDir of spaceDirs) {
const spaceAssetsPath = join(spacesDir, spaceDir.name, 'assets');
log.debug(`Counting assets in space: ${spaceDir.name} at ${spaceAssetsPath}`, this.config.auditContext);
const spaceCount = (await this.readEntryAssetsModule(spaceAssetsPath, 'assets')) || 0;
log.debug(`Space ${spaceDir.name} asset count: ${spaceCount}`, this.config.auditContext);
count += spaceCount;
}
} else {
const assetsPath = join(this.folderPath, 'assets');
log.debug(`Flat structure detected, assets path: ${assetsPath}`, this.config.auditContext);
count = (await this.readEntryAssetsModule(assetsPath, 'assets')) || 0;
}
log.debug(`Total assets count: ${count}`, this.config.auditContext);
break;
}
case 'entries':
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-audit/src/types/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ enum OutputColumn {
'publish_locale' = 'publish_locale',
'publish_environment' = 'publish_environment',
'asset_uid' = 'asset_uid',
'space_id' = 'space_id',
'selectedValue' = 'selectedValue',
'fixStatus' = 'fixStatus',
'Content_type_uid' = 'ct_uid',
Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading