Skip to content
Draft
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
8 changes: 7 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ fileignoreconfig:
checksum: 1837e7d9de21b99975ab38b2de493dbd69347aa2e2ba06bc5e8a5a555a0834f1
- filename: pnpm-lock.yaml
checksum: 902643ce426736c17c037e3ca90f88fada78b43c37a890d35411f5e5bca07d95
- filename: packages/contentstack-export/src/export/modules/environments.ts
checksum: 5077c6d8418163d538b28252b62ce7679247c795af2387fd0d9535af974106e8
- filename: packages/contentstack-import/src/import/modules/environments.ts
checksum: d1d83112db63ed7e45de89f68b2e6873ef08c9035d9f7313c950fb8036f93761
- filename: packages/contentstack-migration/README.md
checksum: f121657165a68e289ac8a8b58f3eea3a6bb6f25a8e6ae01eb8cbb1ebaa4c15c6
- filename: packages/contentstack/README.md
checksum: 3e95bfa46ef9262c558b8ac12afc3be9637c9fabde9214cfc9ff26d8aea88fcc
checksum: 0c9a7c376d29d58272538654c34996d4ab6c2891b4ce9fef4bd050149b32c405
version: ""
24 changes: 13 additions & 11 deletions 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.1 darwin-arm64 node-v24.12.0
@contentstack/cli-audit/2.0.0-beta.2 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -41,13 +41,14 @@ Perform audits and find possible errors in the exported Contentstack data
```
USAGE
$ csdx cm:stacks:audit [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--columns <value>]
[--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
[--columns <value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output
csv|json|yaml]

FLAGS
--modules=<option>... Provide the list of modules to be audited
<options:
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
<options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-ru
les|composable-studio>
--report-path=<value> Path to store the audit reports

COMMON FLAGS
Expand Down Expand Up @@ -89,18 +90,19 @@ Perform audits and fix possible errors in the exported Contentstack data.
```
USAGE
$ csdx cm:stacks:audit:fix [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules...] [--copy-path <value>
--copy-dir] [--fix-only reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns
<value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
[--copy-path <value> --copy-dir] [--fix-only
reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns <value>] [--sort <value>]
[--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]

FLAGS
--copy-dir Create backup from the original data.
--copy-path=<value> Provide the path to backup the copied data
--fix-only=<option>... Provide the list of fix options
<options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
--modules=<option>... Provide the list of modules to be audited
<options:
content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules>
<options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-r
ules|composable-studio>
--report-path=<value> Path to store the audit reports

COMMON FLAGS
Expand Down Expand Up @@ -155,5 +157,5 @@ DESCRIPTION
Display help for csdx.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_
<!-- commandsstop -->
7 changes: 3 additions & 4 deletions packages/contentstack-audit/src/audit-base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { v4 as uuid } from 'uuid';
import isEmpty from 'lodash/isEmpty';
import { join, resolve } from 'path';
import cloneDeep from 'lodash/cloneDeep';
import { cliux, sanitizePath, TableFlags, TableHeader, log, configHandler, CLIProgressManager, clearProgressModuleSetting } from '@contentstack/cli-utilities';
import { cliux, sanitizePath, TableFlags, TableHeader, log, configHandler, CLIProgressManager, clearProgressModuleSetting, readContentTypeSchemas } from '@contentstack/cli-utilities';
import { createWriteStream, existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'fs';
import config from './config';
import { print } from './util/log';
Expand Down Expand Up @@ -480,10 +480,9 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
* `gfSchema`. The values of these properties are the parsed JSON data from two different files.
*/
getCtAndGfSchema() {
const ctPath = join(
const ctDirPath = join(
this.sharedConfig.basePath,
this.sharedConfig.moduleConfig['content-types'].dirName,
this.sharedConfig.moduleConfig['content-types'].fileName,
);
const gfPath = join(
this.sharedConfig.basePath,
Expand All @@ -492,7 +491,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
);

const gfSchema = existsSync(gfPath) ? (JSON.parse(readFileSync(gfPath, 'utf8')) as ContentTypeStruct[]) : [];
const ctSchema = existsSync(ctPath) ? (JSON.parse(readFileSync(ctPath, 'utf8')) as ContentTypeStruct[]) : [];
const ctSchema = readContentTypeSchemas(ctDirPath) as ContentTypeStruct[];

return { ctSchema, gfSchema };
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-audit/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = {
moduleConfig: {
'content-types': {
name: 'content type',
fileName: 'schema.json',
fileName: 'schema.json', // Not used - reads from individual files
dirName: 'content_types',
},
'global-fields': {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/2.0.0-beta.3 darwin-arm64 node-v24.12.0
@contentstack/cli-auth/2.0.0-beta.4 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/2.0.0-beta.6 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-bootstrap/2.0.0-beta.6 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.6.1 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-branches/1.6.3 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.10.3 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-bulk-publish/1.10.6 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/2.0.0-beta.6 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-clone/2.0.0-beta.8 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
67 changes: 66 additions & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.16.1 darwin-arm64 node-v24.12.0
@contentstack/cli-config/1.18.0 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -33,16 +33,19 @@ USAGE
* [`csdx config:get:ea-header`](#csdx-configgetea-header)
* [`csdx config:get:early-access-header`](#csdx-configgetearly-access-header)
* [`csdx config:get:log`](#csdx-configgetlog)
* [`csdx config:get:proxy`](#csdx-configgetproxy)
* [`csdx config:get:rate-limit`](#csdx-configgetrate-limit)
* [`csdx config:get:region`](#csdx-configgetregion)
* [`csdx config:remove:base-branch`](#csdx-configremovebase-branch)
* [`csdx config:remove:ea-header`](#csdx-configremoveea-header)
* [`csdx config:remove:early-access-header`](#csdx-configremoveearly-access-header)
* [`csdx config:remove:proxy`](#csdx-configremoveproxy)
* [`csdx config:remove:rate-limit`](#csdx-configremoverate-limit)
* [`csdx config:set:base-branch`](#csdx-configsetbase-branch)
* [`csdx config:set:ea-header`](#csdx-configsetea-header)
* [`csdx config:set:early-access-header`](#csdx-configsetearly-access-header)
* [`csdx config:set:log`](#csdx-configsetlog)
* [`csdx config:set:proxy`](#csdx-configsetproxy)
* [`csdx config:set:rate-limit`](#csdx-configsetrate-limit)
* [`csdx config:set:region [REGION]`](#csdx-configsetregion-region)

Expand Down Expand Up @@ -118,6 +121,23 @@ EXAMPLES

_See code: [src/commands/config/get/log.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/log.ts)_

## `csdx config:get:proxy`

Get proxy configuration for CLI

```
USAGE
$ csdx config:get:proxy

DESCRIPTION
Get proxy configuration for CLI

EXAMPLES
$ csdx config:get:proxy
```

_See code: [src/commands/config/get/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/proxy.ts)_

## `csdx config:get:rate-limit`

Get rate-limit of organizations
Expand Down Expand Up @@ -227,6 +247,23 @@ EXAMPLES

_See code: [src/commands/config/remove/early-access-header.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/early-access-header.ts)_

## `csdx config:remove:proxy`

Remove proxy configuration from global config

```
USAGE
$ csdx config:remove:proxy

DESCRIPTION
Remove proxy configuration from global config

EXAMPLES
$ csdx config:remove:proxy
```

_See code: [src/commands/config/remove/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/proxy.ts)_

## `csdx config:remove:rate-limit`

Remove rate-limit of the organization
Expand Down Expand Up @@ -358,6 +395,34 @@ EXAMPLES

_See code: [src/commands/config/set/log.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/log.ts)_

## `csdx config:set:proxy`

Set proxy configuration for CLI

```
USAGE
$ csdx config:set:proxy --host <value> --port <value> --protocol http|https [--username <value>]

FLAGS
--host=<value> (required) Proxy host address
--port=<value> (required) Proxy port number
--protocol=<option> (required) [default: http] Proxy protocol (http or https)
<options: http|https>
--username=<value> Proxy username (optional)

DESCRIPTION
Set proxy configuration for CLI

EXAMPLES
$ csdx config:set:proxy --host 127.0.0.1 --port 3128

$ csdx config:set:proxy --host proxy.example.com --port 8080 --protocol https

$ csdx config:set:proxy --host proxy.example.com --port 8080 --username user
```

_See code: [src/commands/config/set/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/proxy.ts)_

## `csdx config:set:rate-limit`

Set rate-limit for CLI
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/2.0.0-beta.7 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-export/2.0.0-beta.7 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,5 @@ export default class ContentTypesExport extends BaseClass {
await executeTask(contentTypes, writeWithProgress.bind(this), {
concurrency: this.exportConfig.writeConcurrency,
});

const schemaFilePath = path.join(this.contentTypesDirPath, 'schema.json');
log.debug(`Writing aggregate schema to: ${schemaFilePath}`, this.exportConfig.context);

return fsUtil.writeFile(schemaFilePath, contentTypes);
}
}
11 changes: 5 additions & 6 deletions packages/contentstack-export/src/export/modules/entries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import { ContentstackClient, FsUtility, handleAndLogError, messageHandler, log } from '@contentstack/cli-utilities';
import { ContentstackClient, FsUtility, handleAndLogError, messageHandler, log, readContentTypeSchemas } from '@contentstack/cli-utilities';
import { Export, ExportProjects } from '@contentstack/cli-variants';
import { sanitizePath } from '@contentstack/cli-utilities';

Expand Down Expand Up @@ -30,7 +30,7 @@ export default class EntriesExport extends BaseClass {
private variantEntries!: any;
private entriesDirPath: string;
private localesFilePath: string;
private schemaFilePath: string;
private contentTypesDirPath: string;
private entriesFileHelper: FsUtility;
private projectInstance: ExportProjects;
public exportVariantEntry: boolean = false;
Expand All @@ -51,11 +51,10 @@ export default class EntriesExport extends BaseClass {
sanitizePath(exportConfig.modules.locales.dirName),
sanitizePath(exportConfig.modules.locales.fileName),
);
this.schemaFilePath = path.resolve(
this.contentTypesDirPath = path.resolve(
sanitizePath(exportConfig.exportDir),
sanitizePath(exportConfig.branchName || ''),
sanitizePath(exportConfig.modules.content_types.dirName),
'schema.json',
);
this.projectInstance = new ExportProjects(this.exportConfig);
this.exportConfig.context.module = MODULE_CONTEXTS.ENTRIES;
Expand All @@ -70,7 +69,7 @@ export default class EntriesExport extends BaseClass {
const [locales, contentTypes, entryRequestOptions, totalEntriesCount, variantInfo] =
await this.withLoadingSpinner('ENTRIES: Analyzing content structure and entries...', async () => {
const locales = fsUtil.readFile(this.localesFilePath) as Array<Record<string, unknown>>;
const contentTypes = fsUtil.readFile(this.schemaFilePath) as Array<Record<string, unknown>>;
const contentTypes = readContentTypeSchemas(this.contentTypesDirPath);

if (!Array.isArray(locales) || locales?.length === 0) {
log.debug(`No locales found in ${this.localesFilePath}`, this.exportConfig.context);
Expand All @@ -83,7 +82,7 @@ export default class EntriesExport extends BaseClass {
return [locales, contentTypes, [], 0, null];
}
log.debug(
`Loaded ${contentTypes?.length} content types from ${this.schemaFilePath}`,
`Loaded ${contentTypes?.length} content types from individual files in ${this.contentTypesDirPath}`,
this.exportConfig.context,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import-setup
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import-setup/2.0.0-beta.3 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-import-setup/2.0.0-beta.3 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/2.0.0-beta.6 darwin-arm64 node-v24.12.0
@contentstack/cli-cm-import/2.0.0-beta.6 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import * as path from 'path';
import { find, cloneDeep, map } from 'lodash';
import { sanitizePath, log, handleAndLogError } from '@contentstack/cli-utilities';
import { sanitizePath, log, handleAndLogError, readContentTypeSchemas } from '@contentstack/cli-utilities';
import { ImportConfig, ModuleClassParams } from '../../types';
import BaseClass, { ApiOptions } from './base-class';
import { updateFieldRules } from '../../utils/content-type-helper';
Expand Down Expand Up @@ -474,7 +474,7 @@ export default class ContentTypesImport extends BaseClass {
const [cts, gfs, pendingGfs, pendingExt] = await this.withLoadingSpinner(
'CONTENT TYPES: Analyzing import data...',
async () => {
const cts = fsUtil.readFile(path.join(this.cTsFolderPath, 'schema.json'));
const cts = readContentTypeSchemas(this.cTsFolderPath);
const gfs = fsUtil.readFile(path.resolve(this.gFsFolderPath, this.gFsConfig.fileName));
const pendingGfs = fsUtil.readFile(this.gFsPendingPath);
const pendingExt = fsUtil.readFile(this.extPendingPath);
Expand Down
Loading
Loading