Skip to content

Commit 37e1188

Browse files
committed
Merge branch 'development' into feat/DX-2243
2 parents e021fe2 + 82d1299 commit 37e1188

File tree

53 files changed

+540
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+540
-502
lines changed

package-lock.json

Lines changed: 181 additions & 199 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ EXAMPLES
269269
$ csdx plugins
270270
```
271271

272-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/index.ts)_
272+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/index.ts)_
273273

274274
## `csdx plugins:add PLUGIN`
275275

@@ -343,7 +343,7 @@ EXAMPLES
343343
$ csdx plugins:inspect myplugin
344344
```
345345

346-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/inspect.ts)_
346+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/inspect.ts)_
347347

348348
## `csdx plugins:install PLUGIN`
349349

@@ -392,7 +392,7 @@ EXAMPLES
392392
$ csdx plugins:install someuser/someplugin
393393
```
394394

395-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/install.ts)_
395+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/install.ts)_
396396

397397
## `csdx plugins:link PATH`
398398

@@ -423,7 +423,7 @@ EXAMPLES
423423
$ csdx plugins:link myplugin
424424
```
425425

426-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/link.ts)_
426+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/link.ts)_
427427

428428
## `csdx plugins:remove [PLUGIN]`
429429

@@ -464,7 +464,7 @@ FLAGS
464464
--reinstall Reinstall all plugins after uninstalling.
465465
```
466466

467-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/reset.ts)_
467+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/reset.ts)_
468468

469469
## `csdx plugins:uninstall [PLUGIN]`
470470

@@ -492,7 +492,7 @@ EXAMPLES
492492
$ csdx plugins:uninstall myplugin
493493
```
494494

495-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/uninstall.ts)_
495+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/uninstall.ts)_
496496

497497
## `csdx plugins:unlink [PLUGIN]`
498498

@@ -536,5 +536,5 @@ DESCRIPTION
536536
Update installed plugins.
537537
```
538538

539-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.33/src/commands/plugins/update.ts)_
539+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/update.ts)_
540540
<!-- commandsstop -->

packages/contentstack-audit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"dependencies": {
2121
"@contentstack/cli-command": "~1.3.3",
22-
"@contentstack/cli-utilities": "~1.8.2",
22+
"@contentstack/cli-utilities": "~1.8.3",
2323
"@oclif/plugin-help": "^5.2.20",
2424
"@oclif/plugin-plugins": "^5.4.34",
2525
"chalk": "^4.1.2",

packages/contentstack-auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
1818
$ csdx COMMAND
1919
running command...
2020
$ csdx (--version)
21-
@contentstack/cli-auth/1.3.23 darwin-arm64 node-v22.14.0
21+
@contentstack/cli-auth/1.3.24 darwin-arm64 node-v22.14.0
2222
$ csdx --help [COMMAND]
2323
USAGE
2424
$ csdx COMMAND

packages/contentstack-auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-auth",
33
"description": "Contentstack CLI plugin for authentication activities",
4-
"version": "1.3.23",
4+
"version": "1.3.24",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@contentstack/cli-command": "~1.3.3",
26-
"@contentstack/cli-utilities": "~1.8.1"
26+
"@contentstack/cli-utilities": "~1.8.3"
2727
},
2828
"devDependencies": {
2929
"@fancy-test/nock": "^0.1.1",

packages/contentstack-bootstrap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
1515
$ csdx COMMAND
1616
running command...
1717
$ csdx (--version)
18-
@contentstack/cli-cm-bootstrap/1.13.1 darwin-arm64 node-v22.14.0
18+
@contentstack/cli-cm-bootstrap/1.13.2 darwin-x64 node-v22.14.0
1919
$ csdx --help [COMMAND]
2020
USAGE
2121
$ csdx COMMAND

packages/contentstack-bootstrap/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-bootstrap",
33
"description": "Bootstrap contentstack apps",
4-
"version": "1.13.1",
4+
"version": "1.13.2",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -17,9 +17,9 @@
1717
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
1818
},
1919
"dependencies": {
20-
"@contentstack/cli-cm-seed": "~1.10.1",
20+
"@contentstack/cli-cm-seed": "~1.10.2",
2121
"@contentstack/cli-command": "~1.3.3",
22-
"@contentstack/cli-utilities": "~1.8.2",
22+
"@contentstack/cli-utilities": "~1.8.3",
2323
"inquirer": "8.2.6",
2424
"mkdirp": "^1.0.4",
2525
"tar": "^6.2.1 "

packages/contentstack-branches/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
3737
$ csdx COMMAND
3838
running command...
3939
$ csdx (--version)
40-
@contentstack/cli-cm-branches/1.2.1 darwin-arm64 node-v22.14.0
40+
@contentstack/cli-cm-branches/1.3.0 darwin-x64 node-v22.14.0
4141
$ csdx --help [COMMAND]
4242
USAGE
4343
$ csdx COMMAND

packages/contentstack-branches/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@contentstack/cli-cm-branches",
33
"description": "Contentstack CLI plugin to do branches operations",
4-
"version": "1.2.1",
4+
"version": "1.3.0",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
88
"@contentstack/cli-command": "~1.3.3",
9-
"@contentstack/cli-utilities": "~1.8.2",
9+
"@contentstack/cli-utilities": "~1.8.3",
1010
"@oclif/core": "^3.27.0",
1111
"chalk": "^4.1.2",
1212
"just-diff": "^6.0.2",

packages/contentstack-branches/src/utils/entry-create-script.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function entryCreateScript(contentType) {
4444
function getValueByPath(obj, path) {
4545
return path.split('[').reduce((o, key) => o && o[key.replace(/\]$/, '')], obj);
4646
}
47-
47+
4848
function updateValueByPath(obj, path, newValue) {
4949
path.split('[').reduce((o, key, index, arr) => {
5050
if (index === arr.length - 1) {
@@ -54,10 +54,10 @@ export function entryCreateScript(contentType) {
5454
}
5555
}, obj);
5656
}
57-
57+
5858
const findReference = function (schema, path, flag) {
5959
let references = [];
60-
60+
6161
for (const i in schema) {
6262
const currentPath = path ? path + '[' + schema[i].uid : schema[i].uid;
6363
if (schema[i].data_type === 'group' || schema[i].data_type === 'global_field') {
@@ -77,7 +77,7 @@ export function entryCreateScript(contentType) {
7777
references.push(currentPath);
7878
}
7979
}
80-
80+
8181
return references;
8282
};
8383
@@ -169,7 +169,7 @@ export function entryCreateScript(contentType) {
169169
}
170170
parent.pop();
171171
}
172-
172+
173173
function findAssetIdsFromHtmlRte(entryObj, ctSchema) {
174174
const regex = /<img asset_uid=\\"([^"]+)\\"/g;
175175
let match;
@@ -179,7 +179,7 @@ export function entryCreateScript(contentType) {
179179
cAssetDetails.push({uid: match[1]});
180180
}
181181
}
182-
182+
183183
function findFileUrls(schema, _entry) {
184184
let markdownRegEx;
185185
let markdownMatch;
@@ -191,7 +191,7 @@ export function entryCreateScript(contentType) {
191191
text = JSON.stringify(_entry);
192192
}
193193
markdownRegEx = new RegExp(
194-
'(https://(assets|(eu-|azure-na-|azure-eu-|gcp-na-)?images).contentstack.(io|com)/v3/assets/(.*?)/(.*?)/(.*?)/(.*?)(?="))',
194+
'(https://(assets|(eu-|azure-na-|azure-eu-|gcp-na-|gcp-eu-)?images).contentstack.(io|com)/v3/assets/(.*?)/(.*?)/(.*?)/(.*?)(?="))',
195195
'g',
196196
);
197197
while ((markdownMatch = markdownRegEx.exec(text)) !== null) {
@@ -207,7 +207,7 @@ export function entryCreateScript(contentType) {
207207
}
208208
}
209209
}
210-
210+
211211
function findAssetIdsFromJsonRte(entryObj, ctSchema) {
212212
if(ctSchema !== undefined){
213213
for (const element of ctSchema) {
@@ -253,7 +253,7 @@ export function entryCreateScript(contentType) {
253253
}
254254
}
255255
}
256-
256+
257257
function gatherJsonRteAssetIds(jsonRteData) {
258258
jsonRteData.children.forEach((element) => {
259259
if (element.type) {
@@ -297,7 +297,7 @@ export function entryCreateScript(contentType) {
297297
}
298298
});
299299
}
300-
300+
301301
const updateAssetDetailsInEntries = function (entry) {
302302
let updatedEntry = Object.assign({},entry);
303303
entry = updateFileFields(updatedEntry, entry, null)
@@ -310,7 +310,7 @@ export function entryCreateScript(contentType) {
310310
entry = entry.replace(assetUrl, mappedAssetUrl);
311311
}
312312
});
313-
313+
314314
assetUIDs.forEach(function (assetUid) {
315315
let uid = assetUIDMapper[assetUid];
316316
if (typeof uid !== 'undefined') {
@@ -335,11 +335,11 @@ export function entryCreateScript(contentType) {
335335
parent[pos] = '';
336336
}
337337
};
338-
338+
339339
if (parent.uid && assetUIDMapper[parent.uid]) {
340340
parent.uid = assetUIDMapper[parent.uid];
341341
}
342-
342+
343343
if (
344344
object &&
345345
isObject(parent[pos]) &&
@@ -356,7 +356,7 @@ export function entryCreateScript(contentType) {
356356
) {
357357
parent = omit(parent, ['asset']);
358358
}
359-
359+
360360
if (object.uid && assetUIDMapper[object.uid]) {
361361
object.uid = assetUIDMapper[object.uid];
362362
}
@@ -373,12 +373,12 @@ export function entryCreateScript(contentType) {
373373
} else if (isArray(object) && object.length) {
374374
for (let i = 0; i <= object.length; i++){
375375
updateFileFields(object[i], object, i);
376-
}
376+
}
377377
parent[pos] = compact(object);
378378
}
379379
return object;
380380
}
381-
381+
382382
const checkAndDownloadAsset = async function (cAsset) {
383383
const assetUID = cAsset?.uid;
384384
if (cAsset && assetUID) {
@@ -431,24 +431,24 @@ export function entryCreateScript(contentType) {
431431
}
432432
return cAsset;
433433
};
434-
434+
435435
const uploadAssets = async function () {
436436
const assetFolderMap = JSON.parse(fs.readFileSync(path.resolve(filePath, 'folder-mapper.json'), 'utf8'));
437437
const stackAPIClient = managementAPIClient.stack({ api_key: stackSDKInstance.api_key, branch_uid: branch });
438438
for (let i = 0; i < downloadedAssets?.length; i++) {
439439
const asset = downloadedAssets[i];
440440
let requestOption = {};
441-
441+
442442
requestOption.parent_uid = assetFolderMap[asset.parent_uid] || asset.parent_uid;
443-
443+
444444
if (asset.hasOwnProperty('description') && typeof asset.description === 'string') {
445445
requestOption.description = asset.description;
446446
}
447-
447+
448448
if (asset.hasOwnProperty('tags') && Array.isArray(asset.tags)) {
449449
requestOption.tags = asset.tags;
450450
}
451-
451+
452452
if (asset.hasOwnProperty('title') && typeof asset.title === 'string') {
453453
requestOption.title = asset.title;
454454
}
@@ -464,7 +464,7 @@ export function entryCreateScript(contentType) {
464464
assetUrlMapper[asset.url] = res && res.url;
465465
}
466466
};
467-
467+
468468
function handleErrorMsg(err) {
469469
if (err?.errorMessage) {
470470
console.log(err.errorMessage);
@@ -479,14 +479,14 @@ export function entryCreateScript(contentType) {
479479
limit,
480480
include_count: true,
481481
};
482-
482+
483483
const entriesSearchResponse = await managementAPIClient
484484
.stack({ api_key: stackSDKInstance.api_key, branch_uid: branchName })
485485
.contentType(contentType)
486486
.entry()
487487
.query(requestObject)
488488
.find();
489-
489+
490490
if (entriesSearchResponse?.items?.length > 0) {
491491
skip += limit || 100;
492492
entries = [...entries, ...entriesSearchResponse.items];
@@ -507,12 +507,12 @@ export function entryCreateScript(contentType) {
507507
task: async () => {
508508
509509
const compareBranchEntries = await getEntries(compareBranch, '${contentType}')
510-
510+
511511
const compareFilteredProperties = compareBranchEntries.map((entry) => {
512512
keysToRemove.map((key) => delete entry[key]);
513513
return entry;
514514
});
515-
515+
516516
let contentType = await managementAPIClient
517517
.stack({ api_key: stackSDKInstance.api_key, branch_uid: compareBranch })
518518
.contentType('${contentType}')
@@ -553,7 +553,7 @@ export function entryCreateScript(contentType) {
553553
for (let i in references) {
554554
let compareEntryRef = getValueByPath(entryDetails, references[i]);
555555
let baseEntryRef = getValueByPath(baseEntry, references[i]);
556-
556+
557557
if (compareEntryRef && compareEntryRef.length > 0 && baseEntryRef && baseEntryRef.length >= 0) {
558558
let compareRefEntry = await managementAPIClient
559559
.stack({ api_key: stackSDKInstance.api_key, branch_uid: compareBranch })
@@ -565,7 +565,7 @@ export function entryCreateScript(contentType) {
565565
.entry()
566566
.query({ query: { title: compareRefEntry.title } })
567567
.find();
568-
568+
569569
if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){
570570
updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
571571
}

0 commit comments

Comments
 (0)