Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5d4b8b6
Merge pull request #2262 from contentstack/development
harshithad0703 Dec 5, 2025
6f41c23
Fixed entry update in bulk publish
sunil-lakshman Dec 8, 2025
dcdc88c
Fixed issue for groups and blocks
sunil-lakshman Dec 8, 2025
d046a1d
Fixed duplicate logs
sunil-lakshman Dec 9, 2025
f919c2c
Merge pull request #2269 from contentstack/fix/dx-3802
sunil-lakshman Dec 9, 2025
9de6910
updated UI text composable studio to studio
shafeeqd959 Dec 9, 2025
f8ad118
resolve version bump
harshithad0703 Dec 9, 2025
175b924
Merge branch 'staging' into fix/version_bump
harshithad0703 Dec 9, 2025
619b507
Merge pull request #2273 from contentstack/fix/version_bump
harshithad0703 Dec 9, 2025
db773a4
Merge pull request #2274 from contentstack/development
harshithad0703 Dec 9, 2025
b7b36e8
Merge pull request #2267 from contentstack/staging
harshithad0703 Dec 9, 2025
393d6cb
updated messages
shafeeqd959 Dec 11, 2025
75e0992
Merge branch 'development' of github.com:contentstack/cli into fix/co…
shafeeqd959 Dec 11, 2025
ff0282f
Merge pull request #2272 from contentstack/fix/composable-studio
shafeeqd959 Dec 11, 2025
411c4d0
bumped version
shafeeqd959 Dec 11, 2025
81b4f26
Merge branch 'development' of github.com:contentstack/cli into fix/co…
shafeeqd959 Dec 11, 2025
715d519
Merge pull request #2277 from contentstack/fix/composable-studio
harshithad0703 Dec 11, 2025
b2a1715
Merge branch 'staging' into fix/back-merge1
harshithad0703 Dec 11, 2025
07d6f96
Merge branch 'main' into fix/back-merge1
harshithad0703 Dec 11, 2025
1502509
Merge pull request #2279 from contentstack/fix/back-merge1
harshithad0703 Dec 11, 2025
2d2c22c
Merge pull request #2276 from contentstack/development
harshithad0703 Dec 11, 2025
a8d538f
Merge pull request #2280 from contentstack/staging
harshithad0703 Dec 15, 2025
97f6612
Merge branch 'main' into fix/backmerge-v2-beta
harshithad0703 Jan 9, 2026
ec39dfd
chore: update dependencies in package-lock and pnpm-lock.yaml
harshithad0703 Jan 9, 2026
0c19677
chore: update package versions
harshithad0703 Jan 9, 2026
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
6 changes: 4 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 40f1c53aad40a1f8d711c5ccdde7d1c147d371618c237e1fec2d313af51edb97
checksum: 6620ee3246617a534609c92b66dd982860a8f4ebb69a0c7e89570c6d92014259
- filename: pnpm-lock.yaml
checksum: aa6177859aaa87caf2892e8034657fd485c3abe7c13a833fd28449a1d33fa950
checksum: 457cb87e68a8bcbf490116e05d39272a5da442e3f06d9f23b47b646b924ffe9a
- filename: packages/contentstack-bulk-publish/src/producer/add-fields.js
checksum: 3e70b11978fc5f29a6a6c90b725c28c9df8d15bcc6fd74e2253fca23a3630160
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down
2,450 changes: 1,193 additions & 1,257 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~2.0.0-beta.2",
"@contentstack/cli-cm-seed": "~2.0.0-beta.3",
"@contentstack/cli-command": "~1.7.0",
"@contentstack/cli-utilities": "~1.15.0",
"@oclif/core": "^4.3.0",
Expand Down
13 changes: 8 additions & 5 deletions packages/contentstack-bulk-publish/src/consumer/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@ function removePublishDetails(elements) {
function displayEntriesDetails(sanitizedData, action, mapping = []) {
if (action === 'bulk_publish') {
sanitizedData.forEach((entry) => {
entry?.publish_details.forEach((pd) => {
if (Object.keys(mapping).includes(pd.environment)) {
if (Array.isArray(entry?.publish_details) && entry.publish_details.length > 0) {
const matchingPublishDetails = entry.publish_details.filter((pd) =>
Object.keys(mapping).includes(pd.environment)
);
if (matchingPublishDetails.length > 0) {
const pd = matchingPublishDetails[0];
console.log(
chalk.green(
`Entry UID: '${entry.uid}', Content Type: '${entry.content_type}', Locale: '${entry.locale}', Version: '${pd.version}', Environment: '${pd.environment}'`,
),
)
);
}
});
if(!Array.isArray(entry.publish_details)){
} else if (!Array.isArray(entry.publish_details)) {
console.log(chalk.green(`Entry UID: '${entry.uid}', Content Type: '${entry.content_type}', Locale: '${entry.locale}'`));
}
});
Expand Down
153 changes: 149 additions & 4 deletions packages/contentstack-bulk-publish/src/producer/add-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,124 @@ function removeUnwanted(entry, unwantedkeys) {
return entry;
}

function isLinkObject(obj, keyName) {
if (obj === null || typeof obj !== 'object' || Array.isArray(obj)) {
return false;
}

const linkKeyNames = ['link', 'card_link'];
if (linkKeyNames.includes(keyName)) {
return true;
}

const hasTitle = 'title' in obj && obj.title !== undefined;
const hasUrl = 'url' in obj && obj.url !== undefined;
const hasHref = 'href' in obj && obj.href !== undefined;

return hasTitle && (hasUrl || hasHref);
}

function ensureHrefIsString(linkObj) {
if (linkObj.href === undefined || linkObj.href === null) {
linkObj.href = '';
} else if (typeof linkObj.href !== 'string') {
linkObj.href = String(linkObj.href);
}
}

function isValidJsonRte(obj) {
return obj !== null &&
typeof obj === 'object' &&
!Array.isArray(obj) &&
typeof obj.type === 'string' &&
obj.type !== '';
}

function cleanJsonFields(obj) {
if (obj === null || obj === undefined || typeof obj !== 'object') {
return obj;
}

if (Array.isArray(obj)) {
return obj.map((item) => cleanJsonFields(item));
}

const cleaned = {};
for (const key in obj) {
if (!obj.hasOwnProperty(key)) {
continue;
}
let value = obj[key];
const isJsonField = key.endsWith('_rte') || key === 'json_rte';
const isAccessibilityField = key.endsWith('_accessibility') || key === 'image_preset_accessibility';

if (isJsonField) {
if (value === '' || value === null || value === undefined) {
continue;
}
if (typeof value === 'object' && !Array.isArray(value)) {
const keyCount = Object.keys(value).length;
if (keyCount === 0) {
continue;
}
if (!isValidJsonRte(value)) {
continue;
}
cleaned[key] = value;
} else {
continue;
}
} else if (isAccessibilityField && value === '') {
cleaned[key] = {};
} else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
value = cleanJsonFields(value);
if (value !== null && typeof value === 'object') {
cleaned[key] = value;
}
} else {
cleaned[key] = value;
}
}
return cleaned;
}

function convertUrlToHref(obj) {
if (obj === null || obj === undefined) {
return obj;
}

if (Array.isArray(obj)) {
return obj.map((item) => convertUrlToHref(item));
}

if (typeof obj === 'object') {
const converted = {};
for (const key in obj) {
const value = obj[key];

if (isLinkObject(value, key)) {
converted[key] = { ...value };
if (converted[key].url !== undefined && converted[key].href === undefined) {
if (typeof converted[key].url === 'string') {
converted[key].href = converted[key].url;
} else if (converted[key].url === null || converted[key].url === undefined) {
converted[key].href = '';
} else {
converted[key].href = String(converted[key].url);
}
delete converted[key].url;
}
ensureHrefIsString(converted[key]);
} else {
converted[key] = convertUrlToHref(value);
}
}
return converted;
}

return obj;
}

function fileFields(entry, uid, multiple) {
if (entry[uid]) {
if (typeof entry[uid] === 'object' || Array.isArray(entry[uid])) {
Expand Down Expand Up @@ -106,6 +224,11 @@ function addFields(contentType, entry) {
}
} else if (schema.enum) {
entry[schema.uid] = null;
} else if (schema.data_type === 'json') {
const isJsonRteField = schema.uid && (schema.uid.endsWith('_rte') || schema.uid === 'json_rte');
if (!isJsonRteField) {
entry[schema.uid] = {};
}
} else if (Object.prototype.hasOwnProperty.call(defaults, schema.data_type)) {
entry[schema.uid] = defaults[schema.data_type];
} else {
Expand All @@ -126,19 +249,31 @@ function addFields(contentType, entry) {

if (schema.data_type === 'group' && !schema.multiple) {
addFields(schema.schema, entry[schema.uid]);
if (entry[schema.uid]) {
entry[schema.uid] = convertUrlToHref(entry[schema.uid]);
}
}
if (schema.data_type === 'group' && schema.multiple) {
entry[schema.uid].forEach((field) => {
addFields(schema.schema, field);
});
if (entry[schema.uid]) {
entry[schema.uid] = convertUrlToHref(entry[schema.uid]);
}
}
if (schema.data_type === 'global_field' && !schema.multiple) {
addFields(schema.schema, entry[schema.uid]);
if (entry[schema.uid]) {
entry[schema.uid] = convertUrlToHref(entry[schema.uid]);
}
}
if (schema.data_type === 'global_field' && schema.multiple) {
entry[schema.uid].forEach((field) => {
addFields(schema.schema, field);
});
if (entry[schema.uid]) {
entry[schema.uid] = convertUrlToHref(entry[schema.uid]);
}
}
if (schema.data_type === 'blocks') {
if (!entry[schema.uid] && !Array.isArray(entry[schema.uid])) {
Expand All @@ -156,6 +291,9 @@ function addFields(contentType, entry) {
if (filterBlockFields.length > 0) {
filterBlockFields.forEach((bfield) => {
addFields(block.schema, bfield[block.uid]);
if (bfield[block.uid]) {
bfield[block.uid] = convertUrlToHref(bfield[block.uid]);
}
});
} else {
entry[schema.uid].push({ [block.uid]: {} });
Expand All @@ -169,6 +307,9 @@ function addFields(contentType, entry) {
if (filterBlockFields.length > 0) {
filterBlockFields.forEach((bfield) => {
addFields(block.schema, bfield[block.uid]);
if (bfield[block.uid]) {
bfield[block.uid] = convertUrlToHref(bfield[block.uid]);
}
});
}
}
Expand Down Expand Up @@ -221,8 +362,14 @@ async function getEntries(
for (let index = 0; index < entriesResponse.items.length; index++) {
let updatedEntry = addFields(schema, entries[index]);
if (updatedEntry.changedFlag || forceUpdate) {
updatedEntry = removeUnwanted(entries[index], deleteFields);
const flag = await updateEntry(updatedEntry, locale);
let entryData = JSON.parse(JSON.stringify(updatedEntry.entry));
entryData = removeUnwanted(entryData, deleteFields);
entryData = cleanJsonFields(entryData);
entryData = convertUrlToHref(entryData);
entryData = cleanJsonFields(entryData);
const entry = stack.contentType(contentType).entry(entries[index].uid);
Object.assign(entry, entryData);
const flag = await updateEntry(entry, locale);
if (flag) {
if (bulkPublish) {
if (bulkPublishSet.length < bulkPublishLimit) {
Expand Down Expand Up @@ -353,8 +500,6 @@ async function start(
}
}

// start()

module.exports = {
start,
getContentTypeSchema,
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~2.0.0-beta.2",
"@contentstack/cli-cm-import": "~2.0.0-beta.2",
"@contentstack/cli-cm-export": "~2.0.0-beta.3",
"@contentstack/cli-cm-import": "~2.0.0-beta.3",
"@contentstack/cli-command": "~1.7.0",
"@contentstack/cli-utilities": "~1.15.0",
"@oclif/core": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "1.16.0",
"version": "1.16.1",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand Down
14 changes: 7 additions & 7 deletions packages/contentstack-config/src/commands/config/set/region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
launch: _flags.string({
description: 'Custom host to set for Launch API',
}),
'composable-studio': _flags.string({
description: 'Custom host to set for Composable Studio API',
studio: _flags.string({
description: 'Custom host to set for Studio API',
}),
};
static examples = [
Expand All @@ -65,8 +65,8 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --personalize <custom_personalize_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --launch <custom_launch_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --composable-studio <custom_composable_studio_url>',
'$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --composable-studio <custom_composable_studio_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --studio <custom_studio_url>',
'$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url>',
];

static args: ArgInput = {
Expand All @@ -82,7 +82,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
let developerHubUrl = regionSetFlags['developer-hub'];
let personalizeUrl = regionSetFlags['personalize'];
let launchHubUrl = regionSetFlags['launch'];
let composableStudioUrl = regionSetFlags['composable-studio'];
let composableStudioUrl = regionSetFlags['studio'];
let selectedRegion = args.region;
if (!(cda && cma && uiHost && name) && !selectedRegion) {
selectedRegion = await interactive.askRegions();
Expand Down Expand Up @@ -132,7 +132,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
cliux.success(`Developer Hub URL: ${customRegion.developerHubUrl}`);
cliux.success(`Personalize URL: ${customRegion.personalizeUrl}`);
cliux.success(`Launch URL: ${customRegion.launchHubUrl}`);
cliux.success(`Composable Studio URL: ${customRegion.composableStudioUrl}`);
cliux.success(`Studio URL: ${customRegion.composableStudioUrl}`);
} catch (error) {
this.logger.error('failed to set the region', error);
cliux.error(`Failed to set region due to: ${error.message}`);
Expand All @@ -151,7 +151,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
cliux.success(`Developer Hub URL: ${regionDetails.developerHubUrl}`);
cliux.success(`Personalize URL: ${regionDetails.personalizeUrl}`);
cliux.success(`Launch URL: ${regionDetails.launchHubUrl}`);
cliux.success(`Composable Studio URL: ${regionDetails.composableStudioUrl}`);
cliux.success(`Studio URL: ${regionDetails.composableStudioUrl}`);
} else {
cliux.error(`Invalid region specified.`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('Region command', function () {
expect(result.launchHubUrl).to.equal(customRegion.launchHubUrl);
});

it('should set a custom region with composable studio URL', function () {
it('should set a custom region with studio URL', function () {
const customRegion = {
cma: 'https://custom-cma.com',
cda: 'https://custom-cda.com',
Expand Down
Loading
Loading