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

Staging -> Main #1044

Merged
merged 38 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
8329069
Merge pull request #1034 from contentstack/main
aman19K 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
af26ab1
Merge pull request #1042 from contentstack/development
netrajpatel Sep 18, 2023
dfe4278
Package versions bumped
netrajpatel Sep 20, 2023
8bbd4df
Graphql package version upgraded
netrajpatel Sep 20, 2023
6ed8b45
Merge pull request #1045 from contentstack/version_bumps
netrajpatel Sep 20, 2023
daa036e
Merge pull request #1046 from contentstack/development
netrajpatel Sep 20, 2023
a27533a
fix: check for asset and entry references in all tags
abhinav-from-contentstack Sep 21, 2023
14cc645
fix: updated package.json, lock and README files
abhinav-from-contentstack Sep 21, 2023
83897dd
Reverted readme files changes
netrajpatel Sep 21, 2023
057a2c8
Updated package versions to release ready
netrajpatel Sep 21, 2023
b460738
Merge pull request #1048 from contentstack/fix/CS-41462
netrajpatel Sep 21, 2023
6f54776
Merge branch 'staging' into development
netrajpatel Sep 21, 2023
95fc0f0
Merge pull request #1051 from contentstack/merge_fixes
netrajpatel Sep 21, 2023
387ec8f
Merge pull request #1050 from contentstack/development
netrajpatel Sep 21, 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,633 changes: 21,628 additions & 17,005 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.3.13 darwin-arm64 node-v20.3.1
@contentstack/cli-auth/1.3.13 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.4.15 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-bootstrap/1.4.16 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
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
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.0.12 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-branches/1.0.13 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
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
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.3.11 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-bulk-publish/1.3.11 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.4.16 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-clone/1.4.17 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
8 changes: 4 additions & 4 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-export": "~1.8.2",
"@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 Expand Up @@ -70,4 +70,4 @@
"cm:stack-clone": "O-CLN"
}
}
}
}
2 changes: 1 addition & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.4.11 darwin-arm64 node-v20.3.1
@contentstack/cli-config/1.4.11 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
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: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.8.1 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-export/1.8.2 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
6 changes: 2 additions & 4 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.8.1",
"version": "1.8.2",
"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 Expand Up @@ -100,4 +98,4 @@
}
},
"repository": "https://github.com/contentstack/cli"
}
}
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.8.3 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-import/1.8.4 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
5 changes: 2 additions & 3 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 Expand Up @@ -96,4 +95,4 @@
}
},
"repository": "https://github.com/contentstack/cli"
}
}
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
3 changes: 1 addition & 2 deletions packages/contentstack-import/src/utils/asset-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ export const lookupAssets = function (
jsonRteData.children.forEach((element: any) => {
if (element.type) {
switch (element.type) {
case 'a':
case 'p': {
default: {
if (element.children && element.children.length > 0) {
gatherJsonRteAssetIds(element);
}
Expand Down
7 changes: 3 additions & 4 deletions packages/contentstack-import/src/utils/entries-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export const lookupEntries = function (data: any, mappedUids: Record<string, any
jsonRteData.children.forEach((element: any) => {
if (element.type) {
switch (element.type) {
case 'a':
case 'p': {
default: {
if (element.children && element.children.length > 0) {
gatherJsonRteEntryIds(element);
}
Expand Down Expand Up @@ -412,7 +411,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 +422,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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-launch
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-launch/1.0.11 darwin-arm64 node-v20.3.1
@contentstack/cli-launch/1.0.12 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
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.12",
"commands": {
"launch:base-command": {
"id": "launch:base-command",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-launch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-launch",
"version": "1.0.11",
"version": "1.0.12",
"description": "Launch related operations",
"author": "Contentstack CLI",
"bin": {
Expand All @@ -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 All @@ -32,7 +32,7 @@
"esm": "^3.2.25",
"express": "^4.18.2",
"form-data": "^4.0.0",
"graphql": "^16.6.0",
"graphql": "^16.8.1",
"ini": "^3.0.1",
"lodash": "^4.17.21",
"open": "^8.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-migrate-rte
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-migrate-rte/1.4.11 darwin-arm64 node-v20.3.1
@contentstack/cli-cm-migrate-rte/1.4.11 darwin-x64 node-v20.7.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
Loading
Loading