Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #1042

Merged
merged 24 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8375e2e
fix: removed deprecated packages
Aug 31, 2023
6b55777
fix: resolved conflicts
Sep 7, 2023
0fb0e18
added .DS_Store to skipfile and version bump
cs-raj Sep 11, 2023
91e6c86
fix: sanitized entries before writing them to file
abhinav-from-contentstack Sep 11, 2023
7ada334
fix: updated package.json and lock files
abhinav-from-contentstack Sep 11, 2023
471007b
Merge pull request #1035 from contentstack/staging
aman19K Sep 11, 2023
2356294
Merge branch 'development' into fix/CS-38886
abhinav-from-contentstack Sep 12, 2023
b746e84
Merge pull request #1033 from contentstack/fix/CS-38886
abhinav-from-contentstack Sep 12, 2023
9b8cc0a
Added a case for if the entry is referred in jsonRTE inside a span tag
cs-raj Sep 13, 2023
596f1f6
Merge branch 'development' into bugfix/CS-40883
cs-raj Sep 13, 2023
c0793a4
version bump
cs-raj Sep 13, 2023
dd72073
fix: sanitized entries before writing them to file
abhinav-from-contentstack Sep 11, 2023
0c122a9
fix: updated package.json and lock files
abhinav-from-contentstack Sep 11, 2023
7e838e6
Merge branch 'development' into bugfix/CS-41350
cs-raj Sep 13, 2023
d405e66
Merge pull request #1031 from contentstack/bugfix/CS-41350
cs-raj Sep 13, 2023
74661d3
Merge branch 'development' into bugfix/CS-40883
cs-raj Sep 14, 2023
1de7129
Merge pull request #1039 from contentstack/bugfix/CS-40883
cs-raj Sep 14, 2023
664bfc5
Merge branch 'development' into fix/40944
netrajpatel Sep 14, 2023
c8839c0
Merge pull request #1014 from contentstack/fix/40944
netrajpatel Sep 14, 2023
8bb0e57
Fix: Workflow import is breaking for branch enabled
antonyagustine Sep 15, 2023
131f687
fix: uid issue in migration script
aman19K Sep 15, 2023
3975793
Merge pull request #1040 from contentstack/feat/CS-41445
antonyagustine Sep 15, 2023
97f978f
Merge branch 'development' into fix/CS-41435
aman19K Sep 18, 2023
7488c0a
Merge pull request #1041 from contentstack/fix/CS-41435
netrajpatel Sep 18, 2023
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
38,091 changes: 21,357 additions & 16,734 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.4.15",
"version": "1.4.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -17,7 +17,7 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.4.15",
"@contentstack/cli-cm-seed": "~1.4.16",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"inquirer": "8.2.4",
Expand Down
4 changes: 1 addition & 3 deletions packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.0.12",
"version": "1.0.13",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.18.3",
"@oclif/core": "^2.9.3",
"async": "^3.2.4",
"big-json": "^3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ export function entryCreateScript(contentType) {
.query({ query: { title: compareRefEntry.title } })
.find();

updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){
updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ export function entryCreateUpdateScript(contentType) {
.query({ query: { title: compareRefEntry.title } })
.find();

updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){
updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ export function entryUpdateScript(contentType) {
.query({ query: { title: compareRefEntry.title } })
.find();

updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){
updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid);
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.4.16",
"version": "1.4.17",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@contentstack/cli-cm-export": "~1.8.1",
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@colors/colors": "^1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export-to-csv",
"description": "Export entities to csv",
"version": "1.4.1",
"version": "1.4.2",
"author": "Abhinav Gupta @abhinav-from-contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
18 changes: 17 additions & 1 deletion packages/contentstack-export-to-csv/src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,22 @@ function exitProgram() {
process.exit();
}

function sanitizeEntries(flatEntry) {
// sanitize against CSV Injections
const CSVRegex = /^[\\+\\=@\\-]/
for (key in flatEntry) {
if (typeof flatEntry[key] === 'string' && flatEntry[key].match(CSVRegex)) {
flatEntry[key] = flatEntry[key].replace(/\"/g, "\"\"");
flatEntry[key] = `"'${flatEntry[key]}"`
} else if (typeof flatEntry[key] === 'object') {
// convert any objects or arrays to string
// to store this data correctly in csv
flatEntry[key] = JSON.stringify(flatEntry[key]);
}
}
return flatEntry;
}

function cleanEntries(entries, language, environments, contentTypeUid) {
const filteredEntries = entries.filter((entry) => {
return entry['locale'] === language;
Expand All @@ -393,6 +409,7 @@ function cleanEntries(entries, language, environments, contentTypeUid) {
}
}
entry = flatten(entry);
entry = sanitizeEntries(entry);
entry['publish_details'] = envArr;
entry['_workflow'] = workflow;
entry['ACL'] = JSON.stringify({}); // setting ACL to empty obj
Expand All @@ -409,7 +426,6 @@ function cleanEntries(entries, language, environments, contentTypeUid) {
delete entry.publishRequest;
return entry;
});
console.log(filteredEntries.length);
}

function getDateTime() {
Expand Down
2 changes: 0 additions & 2 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"dependencies": {
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.18.3",
"@oclif/core": "^2.9.3",
"async": "^3.2.4",
"big-json": "^3.2.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.8.3",
"version": "1.8.4",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@contentstack/management": "~1.10.0",
"@oclif/config": "^1.18.3",
"@oclif/core": "^2.9.3",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = class ImportEntries {
ctPath;
lPath;
importConcurrency;
skipFiles = ['__master.json', '__priority.json', 'schema.json'];
skipFiles = ['__master.json', '__priority.json', 'schema.json','.DS_Store'];

constructor(importConfig, stackAPIClient) {
this.config = _.merge(config, importConfig);
Expand Down Expand Up @@ -1258,7 +1258,7 @@ module.exports = class ImportEntries {

if (element.length) {
for (const item of element) {
if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
return this.doEntryReferencesExist(item.children);
} else if (this.isEntryRef(item)) {
return true;
Expand All @@ -1269,7 +1269,7 @@ module.exports = class ImportEntries {
return true;
}

if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
if ((element.type === 'p' || element.type === 'a' || element.type ==='span') && element.children && element.children.length > 0) {
return this.doEntryReferencesExist(element.children);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ module.exports = class importWorkflows {
});

const updateWorkflow = this.stackAPIClient.workflow(workflow.uid);
Object.assign(updateWorkflow, { workflow_stages: newWorkflowStages, name: workflow.name });
Object.assign(updateWorkflow, {
name: workflow.name,
branches: workflow.branches,
workflow_stages: newWorkflowStages,
});
return updateWorkflow.update();
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ export default class ImportWorkflows extends BaseClass {
});

const updateWorkflow = this.stack.workflow(workflow.uid);
Object.assign(updateWorkflow, { workflow_stages: newWorkflowStages, name: workflow.name });
Object.assign(updateWorkflow, {
name: workflow.name,
branches: workflow.branches,
workflow_stages: newWorkflowStages,
});

return updateWorkflow.update();
}
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack-import/src/utils/entries-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const lookupEntries = function (data: any, mappedUids: Record<string, any
if (element.type) {
switch (element.type) {
case 'a':
case 'span':
case 'p': {
if (element.children && element.children.length > 0) {
gatherJsonRteEntryIds(element);
Expand Down Expand Up @@ -412,7 +413,7 @@ function doEntryReferencesExist(element: Record<string, any>[] | any): boolean {

if (element.length) {
for (const item of element) {
if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
return doEntryReferencesExist(item.children);
} else if (isEntryRef(item)) {
return true;
Expand All @@ -423,7 +424,7 @@ function doEntryReferencesExist(element: Record<string, any>[] | any): boolean {
return true;
}

if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
if ((element.type === 'p' || element.type === 'a' || element.type === 'span') && element.children && element.children.length > 0) {
return doEntryReferencesExist(element.children);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-launch/oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.10",
"version": "1.0.11",
"commands": {
"launch:base-command": {
"id": "launch:base-command",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@oclif/plugin-help": "^5",
"@oclif/plugin-plugins": "^2.3.2",
"@oclif/plugin-plugins": "^3.3.2",
"@oclif/core": "^2.9.3",
"@types/express": "^4.17.17",
"@types/express-serve-static-core": "^4.17.34",
Expand Down
2 changes: 0 additions & 2 deletions packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"dependencies": {
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.18.3",
"async": "^3.2.4",
"callsites": "^3.1.0",
"cardinal": "^2.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.4.15",
"version": "1.4.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-utilities": "~1.5.2",
"axios": "1.3.4",
Expand Down
16 changes: 8 additions & 8 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
},
"dependencies": {
"@contentstack/cli-auth": "~1.3.13",
"@contentstack/cli-cm-bootstrap": "~1.4.15",
"@contentstack/cli-cm-bootstrap": "~1.4.16",
"@contentstack/cli-cm-bulk-publish": "~1.3.11",
"@contentstack/cli-cm-clone": "~1.4.16",
"@contentstack/cli-cm-clone": "~1.4.17",
"@contentstack/cli-cm-export": "~1.8.1",
"@contentstack/cli-cm-export-to-csv": "~1.4.1",
"@contentstack/cli-cm-import": "~1.8.3",
"@contentstack/cli-cm-import": "~1.8.4",
"@contentstack/cli-cm-export-to-csv": "~1.4.2",
"@contentstack/cli-cm-migrate-rte": "~1.4.11",
"@contentstack/cli-cm-seed": "~1.4.15",
"@contentstack/cli-cm-seed": "~1.4.16",
"@contentstack/cli-command": "~1.2.12",
"@contentstack/cli-config": "~1.4.11",
"@contentstack/cli-launch": "~1.0.11",
"@contentstack/cli-migration": "~1.3.12",
"@contentstack/cli-utilities": "~1.5.2",
"@contentstack/management": "~1.10.0",
"@contentstack/cli-cm-branches": "~1.0.12",
"@contentstack/cli-cm-branches": "~1.0.13",
"@oclif/plugin-help": "^5",
"@oclif/plugin-not-found": "^2.3.9",
"@oclif/plugin-plugins": "^2.1.7",
"@oclif/plugin-not-found": "^2.4.0",
"@oclif/plugin-plugins": "^3.3.2",
"@oclif/core": "^2.9.3",
"chalk": "^4.1.2",
"debug": "^4.1.1",
Expand Down
Loading
Loading