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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 12 additions & 39 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,42 +1,15 @@
fileignoreconfig:
- filename: packages/contentstack-audit/test/unit/mock/am-contents-no-stack/environments/environments.json
checksum: fe82c708f5f4d0b05694a601855fb7950661048eef8d7f9f794713e3a665064e
- filename: packages/contentstack-audit/test/unit/mock/am-contents/environments/environments.json
checksum: ffaaee9269a6e833cd3dbe337ddc5c060cce948519873c7a2777754519a31b52
- filename: pnpm-lock.yaml
checksum: 649aae748e3ae8c157439dc6c7c9ea402cc19b4dab7ca64b7e4d839d1375df53
- filename: packages/contentstack-audit/src/types/content-types.ts
checksum: d16a65415c3184f15a807d58e5858310aeb5633794fc9075e36f89c94da636c3
- filename: packages/contentstack-audit/src/audit-base-command.ts
checksum: b706ea114a3cb5e4c0e7e163f32ceffa3356a6b0766bf5b8fe387c3c72f44c36
- filename: packages/contentstack-audit/test/unit/mock/am-contents-no-stack/spaces/space_one/assets/chunk0-assets.json
checksum: a276dc984efd49c097b4c38a02a17cfd1d28d704bd403d65af2b7673b8e9dbe9
- filename: packages/contentstack-audit/src/modules/entries.ts
checksum: 13072df0872f8c098d23f49b02f9e8f3e492ab2f483d67a5ea5e423ab406ad94
- filename: packages/contentstack-audit/src/modules/assets.ts
checksum: 9cdc568453a3926d866de4d3d56e6fbc4629eafcaca1c51536c11d937a0bf126
- filename: packages/contentstack-audit/test/unit/modules/assets.test.ts
checksum: 203bb83afa84a696b84066dc6959712289e9fc4135c8cba641f9ff634f32b3db
- filename: packages/contentstack-audit/test/unit/modules/entries.test.ts
checksum: 31d9767d87e4e9db54f641e8cb9d3360f591acdaa8b089a83eaa4aacdf0c3a35
- filename: packages/contentstack-audit/test/unit/mock/am-contents/spaces/space_clean/assets/chunk0-assets.json
checksum: f02886c04ea1097ebc5965fa9a63a878adb9437d56a5b1797be1967fae35f9e4

- filename: packages/contentstack-bulk-operations/src/utils/backup-dir-asset-fetcher.ts
checksum: fbf1ef882bf4ea8f06a7a28b9248a07e01f5a5d2d4da98dbb9ee52bc16ce318a
- filename: packages/contentstack-bulk-operations/test/unit/utils/backup-dir-asset-fetcher.test.ts
checksum: b905524c952aff0f089fa5347e0db18479b75a438cd9ae77e2dfe1cb203d7e59
- filename: packages/contentstack-bulk-operations/test/unit/utils/revert-retry-handler.test.ts
checksum: 142e7b67a06bc13b6b4191b17f2ea8ae31a3bce20086ea35a92f3e3671eb603d
- filename: packages/contentstack-bulk-operations/src/utils/batch-helper.ts
checksum: ddcd8ef7c56d1122df88075883a2768a28813147e8fdef5b8e72a1ec118c045a
- filename: packages/contentstack-import/src/import/modules/assets.ts
checksum: d213265909a1b163ce733b9e2534e3a74304a2589c2d85e059f10fa0acfdee11
- filename: packages/contentstack-import/src/utils/import-config-handler.ts
checksum: 5b2050b283ea3d990e8ad3207b054c6932b76d2bd82a9f659b287ef11dec9f83
- filename: packages/contentstack-audit/test/unit/mock/am-contents/spaces/space_cross_only/assets/chunk0-assets.json
checksum: 27d5398f5d81bd3af53da9a5d10475a36c08e8fd8ad29df24e8f267494419a20
- filename: packages/contentstack-audit/test/unit/mock/am-contents/spaces/space_one/assets/chunk0-assets.json
checksum: 9fc8b266ef58ecce8d3c4182632d1f7d088dfbce81b3fcea46b087cde3129b91
- filename: packages/contentstack-audit/test/unit/mock/am-contents/stack/stack.json
checksum: c4ac3ff80eb38b1c58eb0db21a232bd84f856d4647093542296199036945083c
checksum: 014f612c3e8db21c891da0c17a1a3b4cd340c026c58034791d86cd5f73aa9f90
- filename: packages/contentstack-bulk-operations/src/commands/cm/stacks/bulk-assets.ts
checksum: 60f33657cc6e2664c17397a2f6b4b54a3f7bf71618931d63cd2811822bd4837e
- filename: packages/contentstack-bulk-operations/src/utils/data-dir-asset-fetcher.ts
checksum: ddcf4601ac47be300eba0eb901e4d45d748c2c4eab676c56677cb9a802fe3db0
- filename: packages/contentstack-migration/src/commands/cm/stacks/migration.ts
checksum: a64a4d396eddd936a63b799eff58c5c6660b5dcaa3a310fd8b09a027932f1789
- filename: packages/contentstack-migration/README.md
checksum: e96006c1a948f766c88ae972b29582fa58eaf8184606bf011eebddc5a06cd7b6
version: ""
checksum: 9392511b337c361b86c36eb2431d8fea9129a61f6b7d70dcb4a633fea339ca61
version: ""
17 changes: 10 additions & 7 deletions packages/contentstack-bulk-operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Bulk operations for assets: publish/unpublish/cross-publish (CMS) and delete/mov

```
USAGE
$ csdx cm:stacks:bulk-assets [-a <value>] [-k <value>] [--operation publish|unpublish|delete|move] [--environments
<value>...] [--locales <value>...] [--source-env <value>] [--source-alias <value>] [--publish-mode bulk|single]
[--branch <value>] [-c <value>] [-y] [--retry-failed <value>] [--revert <value>] [--bulk-operation-file <value>]
[--folder-uid <value>] [-d <value>] [--dry-run] [--space-uid <value>] [--org-uid <value>] [--workspace <value>]
[--asset-uids-file <value>] [--locale <value>] [--target-folder-uid <value>]
$ csdx cm:stacks:bulk-assets [-a <value>] [-k <value>] [--operation publish|unpublish|delete|move] [--source-alias
<value>] [--publish-mode bulk|single] [--branch <value>] [-c <value>] [-y] [--retry-failed <value>] [--revert
<value>] [--bulk-operation-file <value>] [--backup-dir <value> | --source-env <value> | --folder-uid <value> |
--environments <value>... | --locales <value>...] [--dry-run] [--space-uid <value>] [--org-uid <value>] [--workspace
<value>] [--asset-uids-file <value>] [--locale <value>] [--target-folder-uid <value>]

FLAGS
-a, --alias=<value> Uses the name of a saved Management Token to authenticate the command. The command
Expand All @@ -54,13 +54,16 @@ FLAGS
-c, --config=<value> (optional) Specifies the path to a JSON configuration file that defines the options
for the command. Use this file instead of passing multiple CLI flags for a single
run.
-d, --data-dir=<value> Path to exported content folder containing asset publish details.
-k, --stack-api-key=<value> API key of the source stack. You must use either the --stack-api-key flag or the
--alias flag.
-y, --yes Skips interactive confirmation prompts and runs the command immediately using the
provided options. Useful for automation and scripts.
--asset-uids-file=<value> Path to UTF-8 JSON file: exactly `{ "uids": ["uid1", "uid2"] }` (non-empty string
array, no trimming; large lists: see docs for NODE_OPTIONS)
--backup-dir=<value> Path to the import backup directory. Each imported asset is published only to the
environments and locales it was published to in the source stack (read from the
backup publish details and asset UID mapping), with asset-scan gating applied.
Intended for the post-import publish flow.
--branch=<value> [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.
Expand Down Expand Up @@ -114,7 +117,7 @@ EXAMPLES

$ csdx cm:stacks:bulk-assets --revert ./bulk-operation -a myAlias

$ csdx cm:stacks:bulk-assets --data-dir ./content --operation publish -k blt123
$ csdx cm:stacks:bulk-assets --backup-dir ./content --operation publish -k blt123

$ csdx cm:stacks:bulk-assets --operation delete --space-uid am123 --org-uid bltOrg --locale en-us --asset-uids-file ./assets.json

Expand Down
12 changes: 7 additions & 5 deletions packages/contentstack-bulk-operations/src/base-bulk-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import {
setupStackConfig,
setupBatchQueueListeners,
confirmOperation as confirmOperationUtil,
getUniqueEnvironments,
getUniqueLocales,
batchItems,
hasPublishTargets,
handleCrossPublishOperation,
logOperationInfo,
validateBatch,
Expand Down Expand Up @@ -519,9 +518,12 @@ export abstract class BaseBulkCommand extends Command {
* Execute operation in BULK mode - processes items in batches
*/
private async executeBulkMode(items: any[], startTime: number): Promise<BulkOperationResult> {
const environments = getUniqueEnvironments(items);
const locales = getUniqueLocales(items);
const batches = batchItems(items, environments, locales);
const untargeted = items.filter((item) => !hasPublishTargets(item)).length;
if (untargeted > 0) {
this.logger.warn(`Skipping ${untargeted} item(s) with no publish target (missing publish_details).`);
}

const batches = batchItems(items);

batches.forEach((batch) => validateBatch(batch));
this.logger.debug(`Created ${batches.length} batches for processing`, this.loggerContext);
Expand Down
Loading
Loading