diff --git a/.talismanrc b/.talismanrc index 66609fae58..646baeb7ca 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,12 +1,7 @@ + fileignoreconfig: - - filename: package-lock.json - checksum: 8f542a625fb86173eecc0cb3ae7fe36354ccddd6031ba054077151d92135462c - - filename: pnpm-lock.yaml - checksum: a0d51f8126adbbea646a7c803f67d9b4e8c791b14e81caf76cd673083181ced0 - - filename: packages/contentstack-import/src/import/modules/environments.ts - checksum: f61c635eaec8026e0cfa80a5ab8272f7946531f6d89505dc0d247b4c7ab0eab7 - - filename: packages/contentstack-import/src/import/modules/taxonomies.ts - checksum: f4f44b6031d2936ec2da98b39bb5f5c1bd0f3be34dbe498c75e64a35b7d25a33 - - filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts - checksum: 5ab20e057fa9c4c300f7a882d30e1c68bbc91ed19de520488107e8c37239682a +- filename: package-lock.json + checksum: ca243e72c60bd55daf7cea89c8a9dbf2ba984d5cf8b15a80233eb115fee8daa0 +- filename: pnpm-lock.yaml + checksum: a0bc2e8eb75b43a9b37b94bade8ce482f43aa7aeaf4fb85c3a7185d95f92ba40 version: '1.0' diff --git a/packages/contentstack-audit/README.md b/packages/contentstack-audit/README.md index a5f3d87eee..e58c919321 100644 --- a/packages/contentstack-audit/README.md +++ b/packages/contentstack-audit/README.md @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli-audit/2.0.0-beta.3 darwin-arm64 node-v22.13.1 +@contentstack/cli-audit/2.0.0-beta.3 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-audit/src/audit-base-command.ts b/packages/contentstack-audit/src/audit-base-command.ts index 4816c8c7ed..2d33fbfd07 100644 --- a/packages/contentstack-audit/src/audit-base-command.ts +++ b/packages/contentstack-audit/src/audit-base-command.ts @@ -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, readContentTypeSchemas } from '@contentstack/cli-utilities'; +import { cliux, sanitizePath, TableFlags, TableHeader, log, configHandler, CLIProgressManager, clearProgressModuleSetting } from '@contentstack/cli-utilities'; import { createWriteStream, existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'fs'; import config from './config'; import { print } from './util/log'; @@ -480,9 +480,10 @@ export abstract class AuditBaseCommand extends BaseCommand -* [@contentstack/cli-cm-bulk-publish](#contentstackcli-cm-bulk-publish) -* [Usage](#usage) -* [Commands](#commands) - - -# Usage - - -```sh-session -$ npm install -g @contentstack/cli-cm-bulk-publish -$ csdx COMMAND -running command... -$ csdx (--version) -@contentstack/cli-cm-bulk-publish/1.10.6 darwin-arm64 node-v23.11.0 -$ csdx --help [COMMAND] -USAGE - $ csdx COMMAND -... -``` - - -# Commands - - -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) -* [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:bulk-publish:clear`](#csdx-cmbulk-publishclear) -* [`csdx cm:bulk-publish:configure`](#csdx-cmbulk-publishconfigure) -* [`csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries] [--include-variants]`](#csdx-cmbulk-publishcross-publish--a-value---retry-failed-value---bulk-publish-value---content-type-value---locales-value---source-env-value---environments-value---delivery-token-value--c-value--y---branch-value---onlyassets---onlyentries---include-variants) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value---entry-uid-value---include-variants) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) -* [`csdx cm:bulk-publish:revert`](#csdx-cmbulk-publishrevert) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value---entry-uid-value---include-variants) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:unpublish`](#csdx-cmentriesunpublish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) -* [`csdx cm:stacks:publish`](#csdx-cmstackspublish) -* [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) -* [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) -* [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) - -## `csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]` - -Publish assets to the specified environments - -``` -USAGE - $ csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish - ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the assets from the - main branch will be published. - -a, --alias= Alias (name) for the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which assets will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --delivery-token= The delivery token of the source environment. - --folder-uid= (optional) The UID of the Assets’ folder from which the assets need to be published. - The default value is cs_root. - --retry-failed= Use this option to retry publishing the failed assets from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish assets to the specified environments - The assets command is used to publish assets from the specified stack, to the specified environments - - Note: Environment(s) and Locale(s) are required to execute the command successfully - But, if retryFailed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:assets - -EXAMPLES - General Usage - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:assets:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:assets:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:assets:publish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --stack-api-key [STACK API KEY] -``` - -_See code: [src/commands/cm/assets/publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/assets/publish.js)_ - -## `csdx cm:assets:unpublish` - -Unpublish assets from given environment - -``` -USAGE - $ csdx cm:assets:unpublish [-a ] [-k ] [-e ] [-c ] [-y] [--locale ] [--branch - ] [--retry-failed ] [--bulk-unpublish ] [--api-version ] [--delivery-token ] - -FLAGS - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) Path of an optional configuration JSON file containing all the options for a - single run. Refer to the configure command to create a configuration file. - -e, --environment= The name of the environment from where entries/assets need to be unpublished. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --branch= [default: main] The name of the branch where you want to perform the bulk unpublish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be unpublished. - --bulk-unpublish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --delivery-token= The delivery token of the source environment. - --locale= Locale from which entries/assets will be unpublished, e.g., en-us. - --retry-failed= (optional) Use this option to retry unpublishing the failed entries from the logfile. - Specify the name of the logfile that lists failed unpublish calls. If this option is - used, it will override all other flags. - -DESCRIPTION - Unpublish assets from given environment - The unpublish command is used for unpublishing assets from the given environment - - Note: Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - -EXAMPLES - General Usage - - $ csdx cm:assets:unpublish --bulk-unpublish --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:assets:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:assets:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:assets:unpublish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:assets:unpublish --bulk-unpublish --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:assets:unpublish --bulk-unpublish --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] -``` - -_See code: [src/commands/cm/assets/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/assets/unpublish.js)_ - -## `csdx cm:bulk-publish` - -Bulk Publish script for managing entries and assets - -``` -USAGE - $ csdx cm:bulk-publish - -DESCRIPTION - Bulk Publish script for managing entries and assets -``` - -_See code: [src/commands/cm/bulk-publish/index.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/index.js)_ - -## `csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]` - -Add fields from updated content types to their respective entries - -``` -USAGE - $ csdx cm:bulk-publish:add-fields cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] - [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -t, --contentTypes=... The Contenttypes from which entries will be published. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type ID whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --force Update and publish all entries even if no fields have been added. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Add fields from updated content types to their respective entries - The update-and-publish command is used to update existing entries with the updated schema of the respective content - type - - Note: Content types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:add-fields - -EXAMPLES - General Usage - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:update-and-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:update-and-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:update-and-publish --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] -``` - -## `csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]` - -Publish assets to the specified environments - -``` -USAGE - $ csdx cm:bulk-publish:assets cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] - [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] - [--source-env ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the assets from the - main branch will be published. - -a, --alias= Alias (name) for the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which assets will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --delivery-token= The delivery token of the source environment. - --folder-uid= (optional) The UID of the Assets’ folder from which the assets need to be published. - The default value is cs_root. - --retry-failed= Use this option to retry publishing the failed assets from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish assets to the specified environments - The assets command is used to publish assets from the specified stack, to the specified environments - - Note: Environment(s) and Locale(s) are required to execute the command successfully - But, if retryFailed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:assets - -EXAMPLES - General Usage - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:assets:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:assets:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:assets:publish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --stack-api-key [STACK API KEY] -``` - -## `csdx cm:bulk-publish:clear` - -Clear the log folder - -``` -USAGE - $ csdx cm:bulk-publish:clear [--log-files-count] [-y] - -FLAGS - -y, --yes Delete all files without asking for confirmation - --log-files-count List number of log files - -DESCRIPTION - Clear the log folder - -ALIASES - $ csdx cm:bulk-publish:clear - -EXAMPLES - $ csdx cm:stacks:publish-clear-logs - - $ csdx cm:stacks:publish-clear-logs --log-files-count - - $ csdx cm:stacks:publish-clear-logs --yes - - $ csdx cm:stacks:publish-clear-logs -y -``` - -## `csdx cm:bulk-publish:configure` - -The configure command is used to generate a configuration file for publish scripts. - -``` -USAGE - $ csdx cm:bulk-publish:configure [-a ] [-k ] - -FLAGS - -a, --alias= Name (alias) of the management token you want to use. You must use either the --alias - flag or the --stack-api-key flag. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -DESCRIPTION - The configure command is used to generate a configuration file for publish scripts. - -ALIASES - $ csdx cm:bulk-publish:configure - -EXAMPLES - $ csdx cm:stacks:publish-configure - - $ csdx cm:stacks:publish-configure -a - - $ csdx cm:stacks:publish-configure --alias - - $ csdx cm:stacks:publish-configure --stack-api-key -``` - -## `csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries] [--include-variants]` - -Publish entries and assets from one environment to other environments - -``` -USAGE - $ csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] - [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] - [--branch ] [--onlyAssets] [--onlyEntries] [--include-variants] - -FLAGS - -B, --branch= [default: main] Specify the branch to fetch the content (by default the main branch is - selected) - -a, --alias= Alias(name) for the management token - -c, --config= Path to the config file - -k, --stack-api-key= Stack API key to be used - -y, --yes Agree to process the command with the current configuration - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-type=... The Contenttypes from which entries will be published - --delivery-token= The delivery token of the source environment. - --environments=... Destination Environments - --include-variants Include Variants flag will publish all associated variant entries. - --locales= Source locale - --onlyAssets Unpublish only assets - --onlyEntries Unpublish only entries - --retry-failed= (optional) Retry publishing failed entries from the logfile (this flag overrides all - other flags) - --source-env= Source Env - -DESCRIPTION - Publish entries and assets from one environment to other environments - The cross-publish command is used to publish entries and assets from one environment to other environments - - Note: Content Type, Environment, Destination Environment(s) and Locale are required to execute the command - successfully - But, if retryFailed flag is set, then only a logfile is required - - -EXAMPLES - General Usage - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] -a [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:bulk-publish:cross-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:bulk-publish:cross-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:bulk-publish:cross-publish --retry-failed [LOG FILE NAME] - - $ csdx cm:bulk-publish:cross-publish -r [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] -a [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] [--include-variants] -``` - -_See code: [src/commands/cm/bulk-publish/cross-publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/cross-publish.js)_ - -## `csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]` - -Publish entries from multiple contenttypes to multiple environments and locales - -``` -USAGE - $ csdx cm:bulk-publish:entries cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] - [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch - ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. This flag is - set to true, by default. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify the IDs separated by spaces. - --delivery-token= The delivery token of the source environment. - --entry-uid= Entry Uid for publish all associated variant entries. - --include-variants Include Variants flag will publish all associated variant entries with base entry. - --publish-all-content-types (optional) Set it to true to bulk publish entries from all content types. If the - --content-types option is already used, then you cannot use this option. - --retry-failed= (optional) Use this option to retry publishing the failed entries/ assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish entries from multiple contenttypes to multiple environments and locales - The publish command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content Types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key - - $ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] [--include-variants] - - - - Using --entry-uid and --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] --entry-uid [ENTRY UID] [--include-variants] -``` - -## `csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish edited entries from a specified content type to the given locales and environments - -``` -USAGE - $ csdx cm:bulk-publish:entry-edits cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] - [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch - ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment(s) on which the entries will be published. In case of - multiple environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type(s) whose edited entries you want to publish in bulk. In - case of multiple content types, specify the IDs separated by spaces. - --retry-failed= (optional) Use this option to retry publishing the failed entries/assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish edited entries from a specified content type to the given locales and environments - The publish-modified command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Locale(s) are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entry-edits - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish-modified --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-modified -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-modified --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish-modified -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY] -``` - -## `csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]` - -Publish non-localized fields for the given content types, from a particular source environment to the specified environments - -``` -USAGE - $ csdx cm:bulk-publish:nonlocalized-field-changes cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] - [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch - ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= The name of the source environment. - -DESCRIPTION - Publish non-localized fields for the given content types, from a particular source environment to the specified - environments - The non-localized field changes command is used to publish non-localized field changes from the given content types to - the specified environments - - Note: Content types, Environments and Source Environment are required to execute this command successfully. - But, if retryFailed flag is set, then only a logfile is required - -ALIASES - $ csdx cm:bulk-publish:nonlocalized-field-changes - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-non-localized-fields --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-non-localized-fields -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:entries:publish-non-localized-fields --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV] -``` - -## `csdx cm:bulk-publish:revert` - -Revert publish operations by using a log file - -``` -USAGE - $ csdx cm:bulk-publish:revert [--retry-failed ] [--log-file ] - -FLAGS - --log-file= Path of the success logfile of a particular publish action. - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. Specify - the name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Revert publish operations by using a log file - The revert command is used to revert all publish operations performed using bulk-publish script. - A log file name is required to execute revert command - - -ALIASES - $ csdx cm:bulk-publish:revert - -EXAMPLES - Using --log-file - - cm:bulk-publish:revert --log-file [LOG FILE NAME] - - - - Using --retry-failed - - cm:bulk-publish:revert --retry-failed [LOG FILE NAME] -``` - -## `csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]` - -Unpublish entries or assets of given content types from the specified environment - -``` -USAGE - $ csdx cm:bulk-publish:unpublish csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] - [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token - ] [--only-assets] [--only-entries] - -FLAGS - -B, --branch= [default: main] Specify the branch to fetch the content from (default is main branch) - -a, --alias= Alias(name) for the management token - -c, --config= Path to the config file - -e, --environment= Source Environment - -k, --stack-api-key= Stack API key to be used - -l, --locale= Locale filter - -y, --yes Agree to process the command with the current configuration - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-unpublish= [default: true] This flag is set to true by default. It indicates that contentstack's - bulkpublish API will be used to unpublish the entries and assets - --content-type= Content type filter - --delivery-token= The delivery token of the source environment. - --retry-failed= Retry publishing failed entries from the logfile (optional, overrides all other flags) - -DESCRIPTION - Unpublish entries or assets of given content types from the specified environment - The unpublish command is used to unpublish entries or assets from given environment - - Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - A content type can be specified for unpublishing entries, but if no content-type(s) is/are specified and --only-assets - is not used, - then all entries from all content types will be unpublished from the source environment - - Note: --only-assets can be used to unpublish only assets and --only-entries can be used to unpublish only entries. - (--only-assets and --only-entries cannot be used together at the same time) - - -ALIASES - $ csdx cm:bulk-publish:unpublish - -EXAMPLES - General Usage - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] ----delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:stacks:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:unpublish --retry-failed [LOG FILE NAME] - - - - No content type - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] (Will unpublish all entries from all content types and assets from the source environment) - - - - Using --only-assets - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-assets (Will unpublish only assets from the source environment) - - - - Using --only-entries - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, all entries, from the source environment) - - $ csdx cm:stacks:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, (from CONTENT TYPE) from the source environment) - - - - Using --branch flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] -``` - -## `csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish unpublished entries from the source environment, to other environments and locales - -``` -USAGE - $ csdx cm:bulk-publish:unpublished-entries cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish - ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] - [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -b, --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --locales= Locale in which entries will be published, e.g., en-us - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. It - is optional. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish unpublished entries from the source environment, to other environments and locales - The publish-only-unpublished command is used to publish unpublished entries from the source environment, to other - environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Source Locale are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:unpublished-entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] -source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-only-unpublished --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-only-unpublished -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-only-unpublished --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV] -``` - -## `csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]` - -Publish entries from multiple contenttypes to multiple environments and locales - -``` -USAGE - $ csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token - ] [--source-env ] [--entry-uid ] [--include-variants] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. This flag is - set to true, by default. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify the IDs separated by spaces. - --delivery-token= The delivery token of the source environment. - --entry-uid= Entry Uid for publish all associated variant entries. - --include-variants Include Variants flag will publish all associated variant entries with base entry. - --publish-all-content-types (optional) Set it to true to bulk publish entries from all content types. If the - --content-types option is already used, then you cannot use this option. - --retry-failed= (optional) Use this option to retry publishing the failed entries/ assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish entries from multiple contenttypes to multiple environments and locales - The publish command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content Types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key - - $ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] [--include-variants] - - - - Using --entry-uid and --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] --entry-uid [ENTRY UID] [--include-variants] -``` - -_See code: [src/commands/cm/entries/publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish.js)_ - -## `csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish edited entries from a specified content type to the given locales and environments - -``` -USAGE - $ csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment(s) on which the entries will be published. In case of - multiple environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type(s) whose edited entries you want to publish in bulk. In - case of multiple content types, specify the IDs separated by spaces. - --retry-failed= (optional) Use this option to retry publishing the failed entries/assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish edited entries from a specified content type to the given locales and environments - The publish-modified command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Locale(s) are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entry-edits - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish-modified --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-modified -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-modified --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish-modified -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY] -``` - -_See code: [src/commands/cm/entries/publish-modified.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-modified.js)_ - -## `csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]` - -Publish non-localized fields for the given content types, from a particular source environment to the specified environments - -``` -USAGE - $ csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= The name of the source environment. - -DESCRIPTION - Publish non-localized fields for the given content types, from a particular source environment to the specified - environments - The non-localized field changes command is used to publish non-localized field changes from the given content types to - the specified environments - - Note: Content types, Environments and Source Environment are required to execute this command successfully. - But, if retryFailed flag is set, then only a logfile is required - -ALIASES - $ csdx cm:bulk-publish:nonlocalized-field-changes - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-non-localized-fields --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-non-localized-fields -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:entries:publish-non-localized-fields --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV] -``` - -_See code: [src/commands/cm/entries/publish-non-localized-fields.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-non-localized-fields.js)_ - -## `csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish unpublished entries from the source environment, to other environments and locales - -``` -USAGE - $ csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -b, --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --locales= Locale in which entries will be published, e.g., en-us - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. It - is optional. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish unpublished entries from the source environment, to other environments and locales - The publish-only-unpublished command is used to publish unpublished entries from the source environment, to other - environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Source Locale are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:unpublished-entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] -source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-only-unpublished --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-only-unpublished -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-only-unpublished --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV] -``` - -_See code: [src/commands/cm/entries/publish-only-unpublished.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-only-unpublished.js)_ - -## `csdx cm:entries:unpublish` - -Unpublish entries from the given environment - -``` -USAGE - $ csdx cm:entries:unpublish [-a ] [-k ] [-e ] [-c ] [-y] [--locale ] [--branch - ] [--retry-failed ] [--bulk-unpublish ] [--api-version ] [--content-type ] - [--delivery-token ] [--include-variants] - -FLAGS - -a, --alias= Alias (name) for the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) Path to the configuration JSON file containing all options for a single run. - Refer to the configure command to create a configuration file. - -e, --environment= The name of the environment from where entries/assets need to be unpublished. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -y, --yes Set to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --branch= [default: main] Specify the branch to fetch the content. If not mentioned, the main - branch will be used by default. - --bulk-unpublish= [default: true] This flag is set to true by default. It indicates that Contentstack's - Bulk Publish APIs will be used to unpublish the entries. - --content-type= The UID of the content type whose entries you want to unpublish in bulk. - --delivery-token= The delivery token of the source environment. - --include-variants Include Variants flag will unpublish all associated variant entries. - --locale= Locale from which entries/assets will be unpublished, e.g., en-us. - --retry-failed= (optional) Use this option to retry unpublishing the failed entries from the logfile. - Specify the name of the logfile that lists failed unpublish calls. If used, this option - will override all other flags. - -DESCRIPTION - Unpublish entries from the given environment - The unpublish command is used to unpublish entries from the given environment - - Note: Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - -EXAMPLES - General Usage - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:stacks:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:unpublish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] --include-variants -``` - -_See code: [src/commands/cm/entries/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/unpublish.js)_ - -## `csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]` - -Add fields from updated content types to their respective entries - -``` -USAGE - $ csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t - ] [-e ] [-c ] [-y] [--locales ] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -t, --contentTypes=... The Contenttypes from which entries will be published. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type ID whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --force Update and publish all entries even if no fields have been added. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Add fields from updated content types to their respective entries - The update-and-publish command is used to update existing entries with the updated schema of the respective content - type - - Note: Content types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:add-fields - -EXAMPLES - General Usage - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:update-and-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:update-and-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:update-and-publish --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] -``` - -_See code: [src/commands/cm/entries/update-and-publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/update-and-publish.js)_ - -## `csdx cm:stacks:publish` - -Publish entries and assets to multiple environments and locales - -``` -USAGE - $ csdx cm:stacks:publish - -DESCRIPTION - Publish entries and assets to multiple environments and locales - The publish command is used to publish entries and assets, to the specified environments and locales. - - Note: Content types, Environments and Locales are required to execute the publish entries command successfully. - Note: Environments and Locales are required to execute the publish assets command successfully. - But, if retry-failed flag is set, then only a logfile is required - -EXAMPLES - General Usage - - $ csdx cm:stacks:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file in the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:stacks:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:publish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:stacks:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --api-version flag - - $ csdx cm:stacks:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --api-version [API VERSION] -``` - -_See code: [src/commands/cm/stacks/publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/publish.js)_ - -## `csdx cm:stacks:publish-clear-logs` - -Clear the log folder - -``` -USAGE - $ csdx cm:stacks:publish-clear-logs [--log-files-count] [-y] - -FLAGS - -y, --yes Delete all files without asking for confirmation - --log-files-count List number of log files - -DESCRIPTION - Clear the log folder - -ALIASES - $ csdx cm:bulk-publish:clear - -EXAMPLES - $ csdx cm:stacks:publish-clear-logs - - $ csdx cm:stacks:publish-clear-logs --log-files-count - - $ csdx cm:stacks:publish-clear-logs --yes - - $ csdx cm:stacks:publish-clear-logs -y -``` - -_See code: [src/commands/cm/stacks/publish-clear-logs.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/publish-clear-logs.js)_ - -## `csdx cm:stacks:publish-configure` - -The configure command is used to generate a configuration file for publish scripts. - -``` -USAGE - $ csdx cm:stacks:publish-configure [-a ] [-k ] - -FLAGS - -a, --alias= Name (alias) of the management token you want to use. You must use either the --alias - flag or the --stack-api-key flag. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -DESCRIPTION - The configure command is used to generate a configuration file for publish scripts. - -ALIASES - $ csdx cm:bulk-publish:configure - -EXAMPLES - $ csdx cm:stacks:publish-configure - - $ csdx cm:stacks:publish-configure -a - - $ csdx cm:stacks:publish-configure --alias - - $ csdx cm:stacks:publish-configure --stack-api-key -``` - -_See code: [src/commands/cm/stacks/publish-configure.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/publish-configure.js)_ - -## `csdx cm:stacks:publish-revert` - -Revert publish operations by using a log file - -``` -USAGE - $ csdx cm:stacks:publish-revert [--retry-failed ] [--log-file ] - -FLAGS - --log-file= Path of the success logfile of a particular publish action. - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. Specify - the name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Revert publish operations by using a log file - The revert command is used to revert all publish operations performed using bulk-publish script. - A log file name is required to execute revert command - - -ALIASES - $ csdx cm:bulk-publish:revert - -EXAMPLES - Using --log-file - - cm:bulk-publish:revert --log-file [LOG FILE NAME] - - - - Using --retry-failed - - cm:bulk-publish:revert --retry-failed [LOG FILE NAME] -``` - -_See code: [src/commands/cm/stacks/publish-revert.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/publish-revert.js)_ - -## `csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]` - -Unpublish entries or assets of given content types from the specified environment - -``` -USAGE - $ csdx cm:stacks:unpublish csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] - [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token - ] [--only-assets] [--only-entries] - -FLAGS - -B, --branch= [default: main] Specify the branch to fetch the content from (default is main branch) - -a, --alias= Alias(name) for the management token - -c, --config= Path to the config file - -e, --environment= Source Environment - -k, --stack-api-key= Stack API key to be used - -l, --locale= Locale filter - -y, --yes Agree to process the command with the current configuration - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-unpublish= [default: true] This flag is set to true by default. It indicates that contentstack's - bulkpublish API will be used to unpublish the entries and assets - --content-type= Content type filter - --delivery-token= The delivery token of the source environment. - --retry-failed= Retry publishing failed entries from the logfile (optional, overrides all other flags) - -DESCRIPTION - Unpublish entries or assets of given content types from the specified environment - The unpublish command is used to unpublish entries or assets from given environment - - Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - A content type can be specified for unpublishing entries, but if no content-type(s) is/are specified and --only-assets - is not used, - then all entries from all content types will be unpublished from the source environment - - Note: --only-assets can be used to unpublish only assets and --only-entries can be used to unpublish only entries. - (--only-assets and --only-entries cannot be used together at the same time) - - -ALIASES - $ csdx cm:bulk-publish:unpublish - -EXAMPLES - General Usage - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] ----delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:stacks:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:unpublish --retry-failed [LOG FILE NAME] - - - - No content type - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] (Will unpublish all entries from all content types and assets from the source environment) - - - - Using --only-assets - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-assets (Will unpublish only assets from the source environment) - - - - Using --only-entries - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, all entries, from the source environment) - - $ csdx cm:stacks:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, (from CONTENT TYPE) from the source environment) - - - - Using --branch flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] -``` - -_See code: [src/commands/cm/stacks/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/unpublish.js)_ - diff --git a/packages/contentstack-clone/README.md b/packages/contentstack-clone/README.md index 90c4a9b68b..f8c4b4db54 100644 --- a/packages/contentstack-clone/README.md +++ b/packages/contentstack-clone/README.md @@ -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.8 darwin-arm64 node-v22.13.1 +@contentstack/cli-cm-clone/2.0.0-beta.8 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-config/README.md b/packages/contentstack-config/README.md index 860ba3e579..ecd24790c4 100644 --- a/packages/contentstack-config/README.md +++ b/packages/contentstack-config/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-config/2.0.0-beta darwin-arm64 node-v22.13.1 +@contentstack/cli-config/2.0.0-beta darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-export/README.md b/packages/contentstack-export/README.md index a74b1200f4..a747a4fd9b 100755 --- a/packages/contentstack-export/README.md +++ b/packages/contentstack-export/README.md @@ -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.8 darwin-arm64 node-v22.13.1 +@contentstack/cli-cm-export/2.0.0-beta.8 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-export/src/export/modules/content-types.ts b/packages/contentstack-export/src/export/modules/content-types.ts index d2c79781bd..6c7f520cbe 100644 --- a/packages/contentstack-export/src/export/modules/content-types.ts +++ b/packages/contentstack-export/src/export/modules/content-types.ts @@ -1,5 +1,11 @@ import * as path from 'path'; -import { ContentstackClient, handleAndLogError, messageHandler, log, sanitizePath } from '@contentstack/cli-utilities'; +import { + ContentstackClient, + handleAndLogError, + messageHandler, + log, + sanitizePath, +} from '@contentstack/cli-utilities'; import { PATH_CONSTANTS } from '../../constants'; import BaseClass from './base-class'; @@ -88,6 +94,7 @@ export default class ContentTypesExport extends BaseClass { await this.writeContentTypes(this.contentTypes); this.completeProgressWithMessage(); + } catch (error) { handleAndLogError(error, { ...this.exportConfig.context }); this.completeProgress(false, error?.message || 'Content types export failed'); @@ -155,5 +162,10 @@ export default class ContentTypesExport extends BaseClass { await executeTask(contentTypes, writeWithProgress.bind(this), { concurrency: this.exportConfig.writeConcurrency, }); + + const schemaFilePath = path.join(this.contentTypesDirPath, PATH_CONSTANTS.FILES.SCHEMA); + log.debug(`Writing aggregate schema to: ${schemaFilePath}`, this.exportConfig.context); + + return fsUtil.writeFile(schemaFilePath, contentTypes); } } diff --git a/packages/contentstack-export/src/export/modules/entries.ts b/packages/contentstack-export/src/export/modules/entries.ts index f3e439b928..e2928b219e 100644 --- a/packages/contentstack-export/src/export/modules/entries.ts +++ b/packages/contentstack-export/src/export/modules/entries.ts @@ -5,12 +5,18 @@ import { handleAndLogError, messageHandler, log, - readContentTypeSchemas, sanitizePath, } from '@contentstack/cli-utilities'; import { PATH_CONSTANTS } from '../../constants'; import { Export, ExportProjects } from '@contentstack/cli-variants'; -import { fsUtil, PROCESS_NAMES, MODULE_CONTEXTS, PROCESS_STATUS, MODULE_NAMES } from '../../utils'; + +import { + fsUtil, + PROCESS_NAMES, + MODULE_CONTEXTS, + PROCESS_STATUS, + MODULE_NAMES, +} from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ExportConfig, ModuleClassParams } from '../../types'; @@ -31,7 +37,7 @@ export default class EntriesExport extends BaseClass { private variantEntries!: any; private entriesDirPath: string; private localesFilePath: string; - private contentTypesDirPath: string; + private schemaFilePath: string; private entriesFileHelper: FsUtility; private projectInstance: ExportProjects; public exportVariantEntry: boolean = false; @@ -52,10 +58,11 @@ export default class EntriesExport extends BaseClass { sanitizePath(exportConfig.modules.locales.dirName), sanitizePath(exportConfig.modules.locales.fileName), ); - this.contentTypesDirPath = path.resolve( + this.schemaFilePath = path.resolve( sanitizePath(exportConfig.exportDir), sanitizePath(exportConfig.branchName || ''), sanitizePath(exportConfig.modules.content_types.dirName), + PATH_CONSTANTS.FILES.SCHEMA, ); this.projectInstance = new ExportProjects(this.exportConfig); this.exportConfig.context.module = MODULE_CONTEXTS.ENTRIES; @@ -70,7 +77,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>; - const contentTypes = readContentTypeSchemas(this.contentTypesDirPath); + const contentTypes = fsUtil.readFile(this.schemaFilePath) as Array>; if (!Array.isArray(locales) || locales?.length === 0) { log.debug(`No locales found in ${this.localesFilePath}`, this.exportConfig.context); @@ -83,7 +90,7 @@ export default class EntriesExport extends BaseClass { return [locales, contentTypes, [], 0, null]; } log.debug( - `Loaded ${contentTypes?.length} content types from individual files in ${this.contentTypesDirPath}`, + `Loaded ${contentTypes?.length} content types from ${this.schemaFilePath}`, this.exportConfig.context, ); @@ -114,6 +121,7 @@ export default class EntriesExport extends BaseClass { if (this.entriesConfig.exportVersions) { progress.addProcess(PROCESS_NAMES.ENTRY_VERSIONS, totalEntriesCount); } + } // Process entry collections @@ -162,6 +170,7 @@ export default class EntriesExport extends BaseClass { } this.completeProgressWithMessage(); + } catch (error) { handleAndLogError(error, { ...this.exportConfig.context }); this.completeProgress(false, error?.message || 'Entries export failed'); diff --git a/packages/contentstack-export/test/unit/export/modules/content-types.test.ts b/packages/contentstack-export/test/unit/export/modules/content-types.test.ts index 749e17ca73..e37aacc2db 100644 --- a/packages/contentstack-export/test/unit/export/modules/content-types.test.ts +++ b/packages/contentstack-export/test/unit/export/modules/content-types.test.ts @@ -84,9 +84,6 @@ describe('ExportContentTypes', () => { // Stub FsUtility methods sinon.stub(FsUtility.prototype, 'writeFile').resolves(); sinon.stub(FsUtility.prototype, 'makeDirectory').resolves(); - // Stub FsUtility.prototype.readdir and readFile for readContentTypeSchemas support - sinon.stub(FsUtility.prototype, 'readdir').returns([]); - sinon.stub(FsUtility.prototype, 'readFile').returns(undefined); }); afterEach(() => { @@ -317,7 +314,6 @@ describe('ExportContentTypes', () => { it('should handle empty content types', async () => { const writeFileStub = FsUtility.prototype.writeFile as sinon.SinonStub; - const completeProgressStub = sinon.stub(exportContentTypes as any, 'completeProgress'); mockStackClient.contentType.returns({ query: sinon.stub().returns({ @@ -331,10 +327,8 @@ describe('ExportContentTypes', () => { exportContentTypes.contentTypes = []; await exportContentTypes.start(); - // With empty content types, writeFile is not called (no files to write) - // But completeProgress should be called to mark the process as complete - expect(completeProgressStub.called).to.be.true; - expect(completeProgressStub.calledWith(true)).to.be.true; + // Verify writeFile was called even with empty array + expect(writeFileStub.called).to.be.true; }); it('should handle errors during export without throwing', async () => { diff --git a/packages/contentstack-export/test/unit/export/modules/entries.test.ts b/packages/contentstack-export/test/unit/export/modules/entries.test.ts index 3511f08177..68deddc568 100644 --- a/packages/contentstack-export/test/unit/export/modules/entries.test.ts +++ b/packages/contentstack-export/test/unit/export/modules/entries.test.ts @@ -140,11 +140,6 @@ describe('EntriesExport', () => { createFolderStub.callsFake(() => { // Do nothing - prevent actual directory creation }); - - // Stub FsUtility.prototype.readdir and readFile for readContentTypeSchemas support - // readContentTypeSchemas creates its own FsUtility instance, so we need to stub the prototype - sandbox.stub(FsUtility.prototype, 'readdir').returns([]); - sandbox.stub(FsUtility.prototype, 'readFile').returns(undefined); entriesExport = new EntriesExport({ exportConfig: mockExportConfig, @@ -178,15 +173,16 @@ describe('EntriesExport', () => { mockExportConfig.modules.locales.dirName, mockExportConfig.modules.locales.fileName, ); - const expectedContentTypesDirPath = path.resolve( + const expectedSchemaPath = path.resolve( mockExportConfig.exportDir, mockExportConfig.branchName || '', mockExportConfig.modules.content_types.dirName, + 'schema.json', ); expect(entriesExport.entriesDirPath).to.equal(expectedEntriesPath); expect(entriesExport.localesFilePath).to.equal(expectedLocalesPath); - expect(entriesExport.contentTypesDirPath).to.equal(expectedContentTypesDirPath); + expect(entriesExport.schemaFilePath).to.equal(expectedSchemaPath); }); it('should initialize ExportProjects instance', () => { @@ -201,29 +197,27 @@ describe('EntriesExport', () => { describe('start() method - Early Returns', () => { it('should return early when no content types are found', async () => { - // Stub mockFsUtil.readFile for locales - mockFsUtil.readFile.returns([{ code: 'en-us' }]); - - // Stub FsUtility.prototype for readContentTypeSchemas to return empty - (FsUtility.prototype.readdir as sinon.SinonStub).returns([]); // No content type files + mockFsUtil.readFile + .onFirstCall() + .returns([{ code: 'en-us' }]) // locales + .onSecondCall() + .returns([]); // content types await entriesExport.start(); // Should not attempt to fetch entries expect(mockStackAPIClient.contentType.called).to.be.false; - // Should read locales file - expect(mockFsUtil.readFile.called).to.be.true; + // Should read both locales and content types files + expect(mockFsUtil.readFile.calledTwice).to.be.true; }); it('should handle empty locales array gracefully', async () => { - const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1', schema: [] as any }]; - - // Stub mockFsUtil.readFile for locales - mockFsUtil.readFile.returns([]); // empty locales - - // Stub FsUtility.prototype for readContentTypeSchemas to return content types - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['ct-1.json']); - (FsUtility.prototype.readFile as sinon.SinonStub).returns(contentTypes[0]); + const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1' }]; + mockFsUtil.readFile + .onFirstCall() + .returns([]) // empty locales + .onSecondCall() + .returns(contentTypes); await entriesExport.start(); @@ -232,14 +226,14 @@ describe('EntriesExport', () => { }); it('should handle non-array locales gracefully', async () => { - const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1', schema: [] as any }]; - - // Stub mockFsUtil.readFile for locales - mockFsUtil.readFile.returns([]); // empty locales array - - // Stub FsUtility.prototype for readContentTypeSchemas to return content types - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['ct-1.json']); - (FsUtility.prototype.readFile as sinon.SinonStub).returns(contentTypes[0]); + const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1' }]; + // Use empty array instead of null to avoid Object.keys error + // The code checks !Array.isArray first, so empty array will work + mockFsUtil.readFile + .onFirstCall() + .returns([]) // empty locales array + .onSecondCall() + .returns(contentTypes); // Mock entry query for when entries are processed const mockEntryQuery = { @@ -1061,19 +1055,11 @@ describe('EntriesExport', () => { it('should process all request objects and complete file writing', async () => { const locales = [{ code: 'en-us' }]; const contentTypes = [ - { uid: 'ct-1', title: 'Content Type 1', schema: [] as any }, - { uid: 'ct-2', title: 'Content Type 2', schema: [] as any }, + { uid: 'ct-1', title: 'Content Type 1' }, + { uid: 'ct-2', title: 'Content Type 2' }, ]; - mockFsUtil.readFile.returns(locales); // For locales file - - // Stub FsUtility.prototype for readContentTypeSchemas - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['ct-1.json', 'ct-2.json']); - (FsUtility.prototype.readFile as sinon.SinonStub).callsFake((filePath: string) => { - if (filePath.includes('ct-1.json')) return contentTypes[0]; - if (filePath.includes('ct-2.json')) return contentTypes[1]; - return undefined; - }); + mockFsUtil.readFile.onFirstCall().returns(locales).onSecondCall().returns(contentTypes); const mockEntryQuery = { query: sandbox.stub().returns({ @@ -1112,13 +1098,9 @@ describe('EntriesExport', () => { it('should handle errors during entry processing gracefully', async () => { const locales = [{ code: 'en-us' }]; - const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1', schema: [] as any }]; + const contentTypes = [{ uid: 'ct-1', title: 'Content Type 1' }]; - mockFsUtil.readFile.returns(locales); // For locales file - - // Stub FsUtility.prototype for readContentTypeSchemas - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['ct-1.json']); - (FsUtility.prototype.readFile as sinon.SinonStub).returns(contentTypes[0]); + mockFsUtil.readFile.onFirstCall().returns(locales).onSecondCall().returns(contentTypes); const processingError = new Error('Entry processing failed'); const getEntriesStub = sandbox.stub(entriesExport, 'getEntries').rejects(processingError); diff --git a/packages/contentstack-import-setup/README.md b/packages/contentstack-import-setup/README.md index 15104d0f35..ce7bf7c58f 100644 --- a/packages/contentstack-import-setup/README.md +++ b/packages/contentstack-import-setup/README.md @@ -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-v22.13.1 +@contentstack/cli-cm-import-setup/2.0.0-beta.3 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-import/README.md b/packages/contentstack-import/README.md index a91a11287a..0bf26e350c 100644 --- a/packages/contentstack-import/README.md +++ b/packages/contentstack-import/README.md @@ -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.7 darwin-arm64 node-v22.13.1 +@contentstack/cli-cm-import/2.0.0-beta.7 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-import/src/import/modules/content-types.ts b/packages/contentstack-import/src/import/modules/content-types.ts index 7872d49b67..4c2fc7b30d 100644 --- a/packages/contentstack-import/src/import/modules/content-types.ts +++ b/packages/contentstack-import/src/import/modules/content-types.ts @@ -6,7 +6,7 @@ */ import * as path from 'path'; import { find, cloneDeep, map } from 'lodash'; -import { sanitizePath, log, handleAndLogError, readContentTypeSchemas } from '@contentstack/cli-utilities'; +import { sanitizePath, log, handleAndLogError } from '@contentstack/cli-utilities'; import { PATH_CONSTANTS } from '../../constants'; import { ImportConfig, ModuleClassParams } from '../../types'; import BaseClass, { ApiOptions } from './base-class'; @@ -498,7 +498,7 @@ export default class ContentTypesImport extends BaseClass { const [cts, gfs, pendingGfs, pendingExt] = await this.withLoadingSpinner( 'CONTENT TYPES: Analyzing import data...', async () => { - const cts = readContentTypeSchemas(this.cTsFolderPath); + const cts = fsUtil.readFile(path.join(this.cTsFolderPath, PATH_CONSTANTS.FILES.SCHEMA)); const gfs = fsUtil.readFile(path.resolve(this.gFsFolderPath, this.gFsConfig.fileName)); const pendingGfs = fsUtil.readFile(this.gFsPendingPath); const pendingExt = fsUtil.readFile(this.extPendingPath); diff --git a/packages/contentstack-import/src/import/modules/entries.ts b/packages/contentstack-import/src/import/modules/entries.ts index 5666e11ee2..fc823dd977 100644 --- a/packages/contentstack-import/src/import/modules/entries.ts +++ b/packages/contentstack-import/src/import/modules/entries.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import { writeFileSync } from 'fs'; import { isEmpty, values, cloneDeep, find, indexOf, forEach, remove } from 'lodash'; -import { FsUtility, sanitizePath, log, handleAndLogError, readContentTypeSchemas } from '@contentstack/cli-utilities'; +import { FsUtility, sanitizePath, log, handleAndLogError } from '@contentstack/cli-utilities'; import { PATH_CONSTANTS } from '../../constants'; import { fsUtil, @@ -120,7 +120,7 @@ export default class EntriesImport extends BaseClass { ); // Initialize composable studio paths if config exists - if (this.importConfig.modules['composable-studio']) { + if (this.importConfig.modules['composable-studio']) { this.composableStudioSuccessPath = path.join( sanitizePath(importConfig.backupDir), PATH_CONSTANTS.MAPPER, @@ -245,7 +245,10 @@ export default class EntriesImport extends BaseClass { private async analyzeEntryData(): Promise<[number, number, number, number, number]> { return this.withLoadingSpinner('ENTRIES: Analyzing import data...', async () => { log.debug('Loading content types for entry analysis', this.importConfig.context); - this.cTs = readContentTypeSchemas(this.cTsPath); + + this.cTs = fsUtil.readFile( + path.join(this.cTsPath, PATH_CONSTANTS.FILES.SCHEMA), + ) as Record[]; if (!this.cTs || isEmpty(this.cTs)) { return [0, 0, 0, 0, 0]; } @@ -1131,11 +1134,7 @@ export default class EntriesImport extends BaseClass { error?.message || `Failed to update references of content type ${uid}`, PROCESS_NAMES.CT_RESTORATION, ); - handleAndLogError( - error, - { ...this.importConfig.context, uid }, - `Failed to update references of content type ${uid}`, - ); + handleAndLogError(error, { ...this.importConfig.context, uid }, `Failed to update references of content type ${uid}`); }; return await this.makeConcurrentCall({ @@ -1223,16 +1222,16 @@ export default class EntriesImport extends BaseClass { log.debug(`Found ${cTsWithFieldRules.length} content types with field rules to update`, this.importConfig.context); try { - // Read content types from individual files - const cTs = readContentTypeSchemas(this.cTsPath) || []; for (let cTUid of cTsWithFieldRules) { log.debug(`Processing field rules for content type: ${cTUid}`, this.importConfig.context); - const contentType: any = find(cTs, { uid: cTUid }); - if (!contentType) { - log.debug(`Content type ${cTUid} not found in schemas`, this.importConfig.context); - continue; - } + const cTs: Record[] = fsUtil.readFile( + path.join(this.cTsPath, PATH_CONSTANTS.FILES.SCHEMA), + ) as Record< + string, + unknown + >[]; + const contentType: any = find(cTs, { uid: cTUid }); if (contentType.field_rules) { log.debug( diff --git a/packages/contentstack-import/test/unit/import/modules/content-types.test.ts b/packages/contentstack-import/test/unit/import/modules/content-types.test.ts index 313dceed77..2a0ce8af27 100644 --- a/packages/contentstack-import/test/unit/import/modules/content-types.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/content-types.test.ts @@ -6,7 +6,6 @@ import { fsUtil } from '../../../../src/utils'; import * as contentTypeHelper from '../../../../src/utils/content-type-helper'; import * as extensionHelper from '../../../../src/utils/extension-helper'; import * as taxonomiesHelper from '../../../../src/utils/taxonomies-helper'; -import { FsUtility } from '@contentstack/cli-utilities'; describe('ImportContentTypes', () => { let importContentTypes: ImportContentTypes; @@ -17,8 +16,6 @@ describe('ImportContentTypes', () => { let lookupExtensionStub: sinon.SinonStub; let lookUpTaxonomyStub: sinon.SinonStub; let makeConcurrentCallStub: sinon.SinonStub; - let fsUtilityReaddirStub: sinon.SinonStub; - let fsUtilityReadFileStub: sinon.SinonStub; beforeEach(() => { fsUtilStub = { @@ -30,46 +27,6 @@ describe('ImportContentTypes', () => { sinon.stub(fsUtil, 'writeFile').callsFake(fsUtilStub.writeFile); sinon.stub(fsUtil, 'makeDirectory').callsFake(fsUtilStub.makeDirectory); - // Stub FsUtility prototype to make readContentTypeSchemas work - // readContentTypeSchemas reads individual JSON files (ignoring schema.json) - // We'll check what fsUtilStub.readFile returns for schema.json and use that to populate individual files - fsUtilityReaddirStub = sinon.stub(FsUtility.prototype, 'readdir').callsFake((dirPath: string) => { - // Try to get mock CTs from the test's fsUtilStub setup for schema.json - // This allows tests to continue using schema.json pattern - try { - const mockCTs = fsUtilStub.readFile(dirPath + '/schema.json'); - if (Array.isArray(mockCTs) && mockCTs.length > 0) { - return mockCTs.map((ct: any) => `${ct.uid}.json`); - } - } catch (e) { - // If schema.json isn't stubbed, return empty - } - return []; - }); - - fsUtilityReadFileStub = sinon.stub(FsUtility.prototype, 'readFile').callsFake((filePath: string) => { - // Extract the UID from the file path and return matching content type - const match = filePath.match(/([^\/]+)\.json$/); - if (match) { - const uid = match[1]; - const dirPath = filePath.substring(0, filePath.lastIndexOf('/')); - try { - // Check if test has stubbed schema.json with mock content types - const mockCTs = fsUtilStub.readFile(dirPath + '/schema.json'); - if (Array.isArray(mockCTs)) { - const ct = mockCTs.find((ct: any) => ct.uid === uid); - if (ct) { - // FsUtility.readFile returns parsed JSON (object), not string - return ct; - } - } - } catch (e) { - // If schema.json isn't stubbed, return undefined (file doesn't exist) - } - } - return undefined; - }); - updateFieldRulesStub = sinon.stub(contentTypeHelper, 'updateFieldRules'); lookupExtensionStub = sinon.stub(extensionHelper, 'lookupExtension'); lookUpTaxonomyStub = sinon.stub(taxonomiesHelper, 'lookUpTaxonomy'); @@ -1207,36 +1164,4 @@ describe('ImportContentTypes', () => { expect(makeConcurrentCallStub.called).to.be.true; }); }); - - describe('analyzeImportData() with individual content type files', () => { - it('should read content types from individual files', async () => { - const mockContentTypes = [ - { uid: 'ct-1', title: 'CT 1', schema: [] as any }, - { uid: 'ct-2', title: 'CT 2', schema: [] as any }, - ]; - - // Configure FsUtility stubs to make readContentTypeSchemas return mock content types - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['ct-1.json', 'ct-2.json']); - (FsUtility.prototype.readFile as sinon.SinonStub).callsFake((filePath: string) => { - if (filePath.includes('ct-1.json')) return mockContentTypes[0]; - if (filePath.includes('ct-2.json')) return mockContentTypes[1]; - return {}; - }); - - fsUtilStub.readFile.returns([]); - - await (importContentTypes as any).analyzeImportData(); - - expect((importContentTypes as any).cTs).to.deep.equal(mockContentTypes); - }); - - it('should return empty array when no individual files are found', async () => { - // readdir returns [] by default, so readContentTypeSchemas will return [] - fsUtilStub.readFile.returns([]); - - await (importContentTypes as any).analyzeImportData(); - - expect((importContentTypes as any).cTs).to.deep.equal([]); - }); - }); }); diff --git a/packages/contentstack-import/test/unit/import/modules/entries.test.ts b/packages/contentstack-import/test/unit/import/modules/entries.test.ts index ecb96afcab..a8fa0daa7e 100644 --- a/packages/contentstack-import/test/unit/import/modules/entries.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/entries.test.ts @@ -27,15 +27,7 @@ describe('EntriesImport', () => { sinon.stub(FsUtility.prototype, 'createFolderIfNotExist').callsFake(() => { return Promise.resolve(); }); - - // Stub FsUtility prototype to support readContentTypeSchemas - // readContentTypeSchemas creates its own FsUtility instance, so we need to stub the prototype - sinon.stub(FsUtility.prototype, 'readdir').returns([]); - - // Stub FsUtility.prototype.readFile for readContentTypeSchemas (returns parsed objects) - // This also stubs fsUtil.readFile since fsUtil is an instance of FsUtility - // Don't set a default return value - let individual tests configure it - fsUtilityReadFileStub = sinon.stub(FsUtility.prototype, 'readFile'); + fsUtilityReadFileStub = sinon.stub(fsUtil, 'readFile'); fsUtilityWriteFileStub = sinon.stub(fsUtil, 'writeFile').callsFake(() => { return Promise.resolve(); }); @@ -511,14 +503,8 @@ describe('EntriesImport', () => { if (path.includes('schema.json')) { return [mockData.contentTypeWithFieldRules]; } - if (path.includes('field_rules_ct.json')) { - return mockData.contentTypeWithFieldRules; - } - return undefined; + return {}; }); - - // Override FsUtility.prototype.readdir for readContentTypeSchemas - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['field_rules_ct.json']); }); it('should update field rules with new UIDs', async () => { @@ -553,9 +539,6 @@ describe('EntriesImport', () => { }); it('should handle content type not found', async () => { - // This test expects the content type to be in schemas but API fetch returns null - // The beforeEach already sets up field_rules_ct, so this should work - mockStackClient.contentType.returns({ fetch: sinon.stub().resolves(null), }); @@ -578,14 +561,8 @@ describe('EntriesImport', () => { if (path.includes('schema.json')) { return [contentTypeWithoutFieldRules]; } - if (path.includes('field_rules_ct.json')) { - return contentTypeWithoutFieldRules; - } - return undefined; + return {}; }); - - // Override FsUtility.readdir for this test - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['field_rules_ct.json']); await entriesImport['updateFieldRules'](); @@ -3119,25 +3096,21 @@ describe('EntriesImport', () => { }); describe('updateFieldRules() Method Error Handling', () => { - beforeEach(() => { - // Override FsUtility stubs to return mock content types - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['simple_ct.json', 'ref_ct.json']); - }); - it('should handle content type fetch error', async () => { const mockContentTypes = [mockData.simpleContentType, mockData.contentTypeWithReferences]; - // Configure FsUtility.readFile to handle all file reads (for both fsUtil and readContentTypeSchemas) fsUtilityReadFileStub.callsFake((filePath) => { + console.log('fsUtil.readFile called with path:', filePath); if (filePath.includes('field_rules_uid.json')) { + console.log('Returning field rules data'); return ['simple_ct', 'ref_ct']; // array of strings } - if (filePath.includes('simple_ct.json')) return mockData.simpleContentType; - if (filePath.includes('ref_ct.json')) return mockData.contentTypeWithReferences; if (filePath.includes('schema.json')) { + console.log('Returning schema data'); return mockContentTypes; } - return undefined; + console.log('Returning empty array'); + return []; }); const mockContentType = { @@ -3161,17 +3134,14 @@ describe('EntriesImport', () => { it('should handle content type update error', async () => { const mockContentTypes = [mockData.simpleContentType, mockData.contentTypeWithReferences]; - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['simple_ct.json']); - fsUtilityReadFileStub.callsFake((path) => { if (path.includes('field_rules_uid.json')) { return ['simple_ct']; // array of strings } - if (path.includes('simple_ct.json')) return mockData.simpleContentType; if (path.includes('schema.json')) { return mockContentTypes; } - return undefined; + return []; }); const mockUpdate = sinon.stub().rejects(new Error('Update failed')); @@ -3201,17 +3171,14 @@ describe('EntriesImport', () => { it('should skip when content type not found', async () => { const mockContentTypes = [mockData.simpleContentType, mockData.contentTypeWithReferences]; - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['simple_ct.json']); - fsUtilityReadFileStub.callsFake((path) => { if (path.includes('field_rules_uid.json')) { return ['simple_ct']; // array of strings } - if (path.includes('simple_ct.json')) return mockData.simpleContentType; if (path.includes('schema.json')) { return mockContentTypes; } - return undefined; + return []; }); const mockContentType = { @@ -3246,17 +3213,14 @@ describe('EntriesImport', () => { delete contentTypeWithoutRules.field_rules; const mockContentTypes = [contentTypeWithoutRules]; - (FsUtility.prototype.readdir as sinon.SinonStub).returns(['simple_ct.json']); - fsUtilityReadFileStub.callsFake((path) => { if (path.includes('field_rules_uid.json')) { return ['simple_ct']; // array of strings } - if (path.includes('simple_ct.json')) return contentTypeWithoutRules; if (path.includes('schema.json')) { return mockContentTypes; } - return undefined; + return []; }); const mockLog = { diff --git a/packages/contentstack-migration/README.md b/packages/contentstack-migration/README.md index 6863933e4a..85e6a016d6 100644 --- a/packages/contentstack-migration/README.md +++ b/packages/contentstack-migration/README.md @@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-migration $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-migration/2.0.0-beta.4 darwin-arm64 node-v22.13.1 +@contentstack/cli-migration/2.0.0-beta.4 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-utilities/src/content-type-utils.ts b/packages/contentstack-utilities/src/content-type-utils.ts deleted file mode 100644 index fb628aff27..0000000000 --- a/packages/contentstack-utilities/src/content-type-utils.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { resolve as pResolve } from 'node:path'; -import { FsUtility } from './fs-utility'; - -/** - * Reads all content type schema files from a directory - * @param dirPath - Path to content types directory - * @param ignoredFiles - Files to ignore (defaults to schema.json, .DS_Store, __master.json, __priority.json) - * @returns Array of content type schemas - */ -export function readContentTypeSchemas( - dirPath: string, - ignoredFiles: string[] = ['schema.json', '.DS_Store', '__master.json', '__priority.json'], -): Record[] | null { - const fsUtil = new FsUtility(); - const files = fsUtil.readdir(dirPath); - - if (!files || files.length === 0) { - return null; - } - - const contentTypes: Record[] = []; - - for (const file of files) { - // Skip if not a JSON file - if (!file.endsWith('.json')) { - continue; - } - - // Skip ignored files - if (ignoredFiles.includes(file)) { - continue; - } - - try { - const filePath = pResolve(dirPath, file); - const contentType = fsUtil.readFile(filePath); - if (contentType) { - contentTypes.push(contentType as Record); - } - } catch (error) { - // Skip files that cannot be parsed - console.warn(`Failed to read content type file ${file}:`, error); - } - } - - return contentTypes; -} diff --git a/packages/contentstack-utilities/src/index.ts b/packages/contentstack-utilities/src/index.ts index 5e0df53290..10e17492ae 100644 --- a/packages/contentstack-utilities/src/index.ts +++ b/packages/contentstack-utilities/src/index.ts @@ -24,7 +24,6 @@ export { export * from './management-types'; export * from './http-client'; export * from './fs-utility'; -export * from './content-type-utils'; export { default as NodeCrypto } from './encrypter'; export { Args as args, Flags as flags, Command } from './cli-ux'; export * from './helpers'; diff --git a/packages/contentstack-utilities/test/unit/content-type-utils.test.ts b/packages/contentstack-utilities/test/unit/content-type-utils.test.ts deleted file mode 100644 index 89778292be..0000000000 --- a/packages/contentstack-utilities/test/unit/content-type-utils.test.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { expect } from 'chai'; -import sinon from 'sinon'; -import { readContentTypeSchemas } from '../../src/content-type-utils'; - -describe('readContentTypeSchemas', () => { - afterEach(() => { - sinon.restore(); - }); - - it('should return empty array when directory does not exist', () => { - sinon.stub(require('fs'), 'existsSync').returns(false); - - const result = readContentTypeSchemas('/nonexistent/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(0); - - sinon.restore(); - }); - - it('should read all JSON files and return content types', () => { - const mockContentTypes = [ - { uid: 'ct-1', title: 'Content Type 1', schema: [] }, - { uid: 'ct-2', title: 'Content Type 2', schema: [] }, - ]; - - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns(['ct-1.json', 'ct-2.json', 'schema.json', '.DS_Store']); - const readFileStub = sinon.stub(require('fs'), 'readFileSync'); - readFileStub.withArgs(sinon.match(/ct-1\.json/), 'utf8').returns(JSON.stringify(mockContentTypes[0])); - readFileStub.withArgs(sinon.match(/ct-2\.json/), 'utf8').returns(JSON.stringify(mockContentTypes[1])); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(2); - expect(result[0].uid).to.equal('ct-1'); - expect(result[1].uid).to.equal('ct-2'); - - sinon.restore(); - }); - - it('should ignore files in ignoredFiles list', () => { - const mockContentType = { uid: 'ct-1', title: 'Content Type 1', schema: [] }; - - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns([ - 'ct-1.json', - 'schema.json', - '__master.json', - '__priority.json', - '.DS_Store', - ]); - const readFileStub = sinon.stub(require('fs'), 'readFileSync'); - readFileStub.withArgs(sinon.match(/ct-1\.json/), 'utf8').returns(JSON.stringify(mockContentType)); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(1); - expect(result[0].uid).to.equal('ct-1'); - - sinon.restore(); - }); - - it('should skip non-JSON files', () => { - const mockContentType = { uid: 'ct-1', title: 'Content Type 1', schema: [] }; - - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns(['ct-1.json', 'readme.txt', 'config.yaml']); - const readFileStub = sinon.stub(require('fs'), 'readFileSync'); - readFileStub.withArgs(sinon.match(/ct-1\.json/), 'utf8').returns(JSON.stringify(mockContentType)); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(1); - expect(result[0].uid).to.equal('ct-1'); - - sinon.restore(); - }); - - it('should handle malformed JSON files gracefully', () => { - const mockContentType = { uid: 'ct-1', title: 'Content Type 1', schema: [] }; - - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns(['ct-1.json', 'ct-2.json']); - const readFileStub = sinon.stub(require('fs'), 'readFileSync'); - readFileStub.withArgs(sinon.match(/ct-1\.json/), 'utf8').returns(JSON.stringify(mockContentType)); - readFileStub.withArgs(sinon.match(/ct-2\.json/), 'utf8').returns('invalid json{'); - - const consoleWarnStub = sinon.stub(console, 'warn'); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(1); - expect(result[0].uid).to.equal('ct-1'); - expect(consoleWarnStub.called).to.be.true; - - sinon.restore(); - }); - - it('should accept custom ignoredFiles list', () => { - const mockContentTypes = [ - { uid: 'ct-1', title: 'Content Type 1', schema: [] }, - { uid: 'schema', title: 'Schema Type', schema: [] }, - ]; - - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns(['ct-1.json', 'schema.json']); - const readFileStub = sinon.stub(require('fs'), 'readFileSync'); - readFileStub.withArgs(sinon.match(/ct-1\.json/), 'utf8').returns(JSON.stringify(mockContentTypes[0])); - readFileStub.withArgs(sinon.match(/schema\.json/), 'utf8').returns(JSON.stringify(mockContentTypes[1])); - - const result = readContentTypeSchemas('/test/path', []); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(2); - - sinon.restore(); - }); - - it('should handle empty directory', () => { - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns([]); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(0); - - sinon.restore(); - }); - - it('should handle directory with only ignored files', () => { - sinon.stub(require('fs'), 'existsSync').returns(true); - sinon.stub(require('fs'), 'readdirSync').returns(['schema.json', '.DS_Store', '__master.json']); - - const result = readContentTypeSchemas('/test/path'); - - expect(result).to.be.an('array'); - expect(result).to.have.lengthOf(0); - - sinon.restore(); - }); -}); diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index 847969e55e..05b83b6091 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/2.0.0-beta.10 darwin-arm64 node-v22.13.1 +@contentstack/cli/2.0.0-beta.10 darwin-arm64 node-v24.12.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND