diff --git a/package-lock.json b/package-lock.json index ef0560fdd5..8ac7a4dd98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -807,26 +807,27 @@ } }, "node_modules/@contentstack/management": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@contentstack/management/-/management-1.10.0.tgz", - "integrity": "sha512-wnmVS19n3cZeh6T2PbBXGCr4irktunVmuECTyPF5++Rsc6GDO+FoQGCZdvzHpRZE0GLiPFIID50z2TZuNArEOg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@contentstack/management/-/management-1.10.2.tgz", + "integrity": "sha512-jO24EqcCJhOjqdsqw8y3T0SPPAd0DG4BByjUcV0S28W2yoa8aBbcjcbZioRPzRLYKTmZWsAZissl18cIJm5djQ==", "dependencies": { - "axios": "^0.27.2", + "axios": "^1.4.0", "form-data": "^3.0.1", "lodash": "^4.17.21", - "qs": "^6.10.3" + "qs": "^6.11.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/@contentstack/management/node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/@contentstack/management/node_modules/axios/node_modules/form-data": { @@ -2491,6 +2492,15 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/big-json": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/big-json/-/big-json-3.2.0.tgz", + "integrity": "sha512-2nV9P72HH6FAoxoJLIKxNGLSX6pM9nm1YiOfQQwr7Sy3oz2rF4RRsxmaB7T/tcESecAqM6f0CYjx6GqnrN5X2Q==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/bluebird": { "version": "3.5.38", "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.38.tgz", @@ -2588,6 +2598,16 @@ "integrity": "sha512-3zsplnP2djeps5P9OyarTxwRpMLoe5Ash8aL9iprw0JxB+FAHjY+ifn4yZUuW4/9hqtnmor6uvjSRzJhiVbrEQ==", "dev": true }, + "node_modules/@types/fs-extra": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", + "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", + "dev": true, + "dependencies": { + "@types/jsonfile": "*", + "@types/node": "*" + } + }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -2683,6 +2703,15 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "node_modules/@types/jsonfile": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", + "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -2755,15 +2784,6 @@ "integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==", "dev": true }, - "node_modules/@types/ncp": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/ncp/-/ncp-2.0.5.tgz", - "integrity": "sha512-ocK0p8JuFmX7UkMabFPjY0F7apPvQyLWt5qtdvuvQEBz9i4m2dbzV+6L1zNaUp042RfnL6pHnxDE53OH6XQ9VQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { "version": "14.18.53", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz", @@ -13157,14 +13177,6 @@ "node": "*" } }, - "node_modules/ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", - "bin": { - "ncp": "bin/ncp" - } - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -23130,19 +23142,19 @@ }, "packages/contentstack": { "name": "@contentstack/cli", - "version": "1.8.5", + "version": "1.9.0", "license": "MIT", "dependencies": { "@contentstack/cli-auth": "~1.3.13", - "@contentstack/cli-cm-bootstrap": "~1.4.16", + "@contentstack/cli-cm-bootstrap": "~1.5.0", "@contentstack/cli-cm-branches": "~1.0.13", "@contentstack/cli-cm-bulk-publish": "~1.3.11", - "@contentstack/cli-cm-clone": "~1.4.17", - "@contentstack/cli-cm-export": "~1.8.2", + "@contentstack/cli-cm-clone": "~1.5.0", + "@contentstack/cli-cm-export": "~1.9.0", "@contentstack/cli-cm-export-to-csv": "~1.4.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-cm-migrate-rte": "~1.4.11", - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-config": "~1.4.11", "@contentstack/cli-launch": "~1.0.12", @@ -23238,10 +23250,10 @@ }, "packages/contentstack-bootstrap": { "name": "@contentstack/cli-cm-bootstrap", - "version": "1.4.16", + "version": "1.5.0", "license": "MIT", "dependencies": { - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "inquirer": "8.2.4", @@ -23427,12 +23439,12 @@ }, "packages/contentstack-clone": { "name": "@contentstack/cli-cm-clone", - "version": "1.4.17", + "version": "1.5.0", "license": "MIT", "dependencies": { "@colors/colors": "^1.5.0", - "@contentstack/cli-cm-export": "~1.8.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-export": "~1.9.0", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "async": "^3.2.4", @@ -23851,7 +23863,7 @@ }, "packages/contentstack-export": { "name": "@contentstack/cli-cm-export", - "version": "1.8.2", + "version": "1.9.0", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.12", @@ -23878,6 +23890,7 @@ "@contentstack/cli-dev-dependencies": "~1.2.3", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/mkdirp": "^1.0.2", "@types/progress-stream": "^2.0.2", "assert": "^2.0.0", @@ -24165,33 +24178,34 @@ }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", - "version": "1.8.4", + "version": "1.9.0", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", - "@contentstack/management": "~1.10.0", + "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "big-json": "^3.2.0", "bluebird": "^3.7.2", "chalk": "^4.1.2", "debug": "^4.1.0", + "fs-extra": "^11.1.1", "lodash": "^4.17.20", "marked": "^4.0.17", "merge": "^2.1.1", "mkdirp": "^1.0.4", - "ncp": "^2.0.0", "promise-limit": "^2.7.0", "tslib": "^2.4.1", "winston": "^3.7.2" }, "devDependencies": { "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/bluebird": "^3.5.38", "@types/chai": "^4.2.18", + "@types/fs-extra": "^11.0.1", "@types/mkdirp": "^1.0.2", "@types/mocha": "^8.2.2", - "@types/ncp": "^2.0.5", "@types/node": "^14.14.32", "@types/sinon": "^10.0.2", "@types/tar": "^4.0.3", @@ -24264,6 +24278,19 @@ "@types/node": "*" } }, + "packages/contentstack-import/node_modules/fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "packages/contentstack-import/node_modules/sinon": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz", @@ -24859,10 +24886,10 @@ }, "packages/contentstack-seed": { "name": "@contentstack/cli-cm-seed", - "version": "1.4.16", + "version": "1.5.0", "license": "MIT", "dependencies": { - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "axios": "1.3.4", @@ -24943,7 +24970,7 @@ "version": "1.5.2", "license": "MIT", "dependencies": { - "@contentstack/management": "~1.10.0", + "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "axios": "1.3.4", "chalk": "^4.0.0", @@ -26541,15 +26568,15 @@ "version": "file:packages/contentstack", "requires": { "@contentstack/cli-auth": "~1.3.13", - "@contentstack/cli-cm-bootstrap": "~1.4.16", + "@contentstack/cli-cm-bootstrap": "~1.5.0", "@contentstack/cli-cm-branches": "~1.0.13", "@contentstack/cli-cm-bulk-publish": "~1.3.11", - "@contentstack/cli-cm-clone": "~1.4.17", - "@contentstack/cli-cm-export": "~1.8.2", + "@contentstack/cli-cm-clone": "~1.5.0", + "@contentstack/cli-cm-export": "~1.9.0", "@contentstack/cli-cm-export-to-csv": "~1.4.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-cm-migrate-rte": "~1.4.11", - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-config": "~1.4.11", "@contentstack/cli-launch": "~1.0.12", @@ -26631,7 +26658,7 @@ "@contentstack/cli-cm-bootstrap": { "version": "file:packages/contentstack-bootstrap", "requires": { - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "@oclif/test": "^2.2.10", @@ -26785,8 +26812,8 @@ "version": "file:packages/contentstack-clone", "requires": { "@colors/colors": "^1.5.0", - "@contentstack/cli-cm-export": "~1.8.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-export": "~1.9.0", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "@oclif/test": "^1.2.7", @@ -26840,6 +26867,7 @@ "@oclif/core": "^2.9.3", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/mkdirp": "^1.0.2", "@types/progress-stream": "^2.0.2", "assert": "^2.0.0", @@ -27081,14 +27109,15 @@ "requires": { "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", - "@contentstack/management": "~1.10.0", + "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/bluebird": "^3.5.38", "@types/chai": "^4.2.18", + "@types/fs-extra": "^11.0.1", "@types/mkdirp": "^1.0.2", "@types/mocha": "^8.2.2", - "@types/ncp": "^2.0.5", "@types/node": "^14.14.32", "@types/sinon": "^10.0.2", "@types/tar": "^4.0.3", @@ -27100,13 +27129,13 @@ "debug": "^4.1.0", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", + "fs-extra": "^11.1.1", "globby": "^10.0.2", "lodash": "^4.17.20", "marked": "^4.0.17", "merge": "^2.1.1", "mkdirp": "^1.0.4", "mocha": "^10.0.0", - "ncp": "^2.0.0", "nyc": "^15.1.0", "oclif": "^3.8.1", "promise-limit": "^2.7.0", @@ -27167,6 +27196,16 @@ "@types/node": "*" } }, + "fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "sinon": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz", @@ -27229,7 +27268,7 @@ "@contentstack/cli-cm-seed": { "version": "file:packages/contentstack-seed", "requires": { - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "@oclif/plugin-help": "^5.1.19", @@ -27946,7 +27985,7 @@ "@contentstack/cli-utilities": { "version": "file:packages/contentstack-utilities", "requires": { - "@contentstack/management": "~1.10.0", + "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", @@ -28800,23 +28839,24 @@ } }, "@contentstack/management": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@contentstack/management/-/management-1.10.0.tgz", - "integrity": "sha512-wnmVS19n3cZeh6T2PbBXGCr4irktunVmuECTyPF5++Rsc6GDO+FoQGCZdvzHpRZE0GLiPFIID50z2TZuNArEOg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@contentstack/management/-/management-1.10.2.tgz", + "integrity": "sha512-jO24EqcCJhOjqdsqw8y3T0SPPAd0DG4BByjUcV0S28W2yoa8aBbcjcbZioRPzRLYKTmZWsAZissl18cIJm5djQ==", "requires": { - "axios": "^0.27.2", + "axios": "^1.4.0", "form-data": "^3.0.1", "lodash": "^4.17.21", - "qs": "^6.10.3" + "qs": "^6.11.2" }, "dependencies": { "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" }, "dependencies": { "form-data": { @@ -30195,6 +30235,15 @@ "@babel/types": "^7.20.7" } }, + "@types/big-json": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/big-json/-/big-json-3.2.0.tgz", + "integrity": "sha512-2nV9P72HH6FAoxoJLIKxNGLSX6pM9nm1YiOfQQwr7Sy3oz2rF4RRsxmaB7T/tcESecAqM6f0CYjx6GqnrN5X2Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/bluebird": { "version": "3.5.38", "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.38.tgz", @@ -30292,6 +30341,16 @@ "integrity": "sha512-3zsplnP2djeps5P9OyarTxwRpMLoe5Ash8aL9iprw0JxB+FAHjY+ifn4yZUuW4/9hqtnmor6uvjSRzJhiVbrEQ==", "dev": true }, + "@types/fs-extra": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", + "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", + "dev": true, + "requires": { + "@types/jsonfile": "*", + "@types/node": "*" + } + }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -30389,6 +30448,15 @@ "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, + "@types/jsonfile": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", + "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -30460,15 +30528,6 @@ "integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==", "dev": true }, - "@types/ncp": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/ncp/-/ncp-2.0.5.tgz", - "integrity": "sha512-ocK0p8JuFmX7UkMabFPjY0F7apPvQyLWt5qtdvuvQEBz9i4m2dbzV+6L1zNaUp042RfnL6pHnxDE53OH6XQ9VQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/node": { "version": "14.18.53", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz", @@ -38361,11 +38420,6 @@ "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-2.0.3.tgz", "integrity": "sha512-p7KTHxU0CUrcOXe62Zfrb5Z13nLvPhSWR/so3kFulUQU0sgUll2Z0LwpsLN351eOOD+hRGu/F1g+6xDfPeD++Q==" }, - "ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==" - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", diff --git a/packages/contentstack-auth/README.md b/packages/contentstack-auth/README.md index 85aca6c15b..9b9ec8ea5a 100644 --- a/packages/contentstack-auth/README.md +++ b/packages/contentstack-auth/README.md @@ -5,40 +5,44 @@ It is Contentstack’s CLI plugin to perform authentication-related activities. [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli-auth](#contentstackcli-auth) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-auth](#contentstackcli-auth) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-auth $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-auth/1.3.13 darwin-x64 node-v20.7.0 +@contentstack/cli-auth/1.3.13 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx auth:login`](#csdx-authlogin) -* [`csdx auth:logout`](#csdx-authlogout) -* [`csdx auth:tokens`](#csdx-authtokens) -* [`csdx auth:tokens:add [-a ] [--delivery] [--management] [-e ] [-k ] [-y] [--token ]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value) -* [`csdx auth:tokens:remove`](#csdx-authtokensremove) -* [`csdx auth:whoami`](#csdx-authwhoami) -* [`csdx login`](#csdx-login) -* [`csdx logout`](#csdx-logout) -* [`csdx tokens`](#csdx-tokens) -* [`csdx whoami`](#csdx-whoami) + +- [`csdx auth:login`](#csdx-authlogin) +- [`csdx auth:logout`](#csdx-authlogout) +- [`csdx auth:tokens`](#csdx-authtokens) +- [`csdx auth:tokens:add [-a ] [--delivery] [--management] [-e ] [-k ] [-y] [--token ]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value) +- [`csdx auth:tokens:remove`](#csdx-authtokensremove) +- [`csdx auth:whoami`](#csdx-authwhoami) +- [`csdx login`](#csdx-login) +- [`csdx logout`](#csdx-logout) +- [`csdx tokens`](#csdx-tokens) +- [`csdx whoami`](#csdx-whoami) ## `csdx auth:login` @@ -324,4 +328,5 @@ ALIASES EXAMPLES $ csdx auth:whoami ``` + diff --git a/packages/contentstack-auth/bin/dev b/packages/contentstack-auth/bin/dev index f003f9d180..39382a0159 100644 --- a/packages/contentstack-auth/bin/dev +++ b/packages/contentstack-auth/bin/dev @@ -2,5 +2,5 @@ (async () => { const { execute } = require('@contentstack/cli-utilities'); - await execute({ type: 'cjs', development: true, dir: __dirname }); -})(); \ No newline at end of file + await execute({ type: 'cjs', dir: __dirname, development: true }); +})(); diff --git a/packages/contentstack-bootstrap/README.md b/packages/contentstack-bootstrap/README.md index e69028c253..a05ef512a5 100644 --- a/packages/contentstack-bootstrap/README.md +++ b/packages/contentstack-bootstrap/README.md @@ -3,24 +3,27 @@ Contentstack CLI’s “Bootstrap” plugin enables you to automate the process This means that all the required steps such as stack, environment, and content type creation, entry and asset publishing are performed just by using a single command. -* [Usage](#usage) -* [Commands](#commands) + +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-bootstrap $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-bootstrap/1.4.16 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-bootstrap/1.5.0 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + ```sh-session @@ -36,7 +39,8 @@ USAGE # Commands -* [`csdx cm:bootstrap`](#csdx-cmbootstrap) + +- [`csdx cm:bootstrap`](#csdx-cmbootstrap) ## `csdx cm:bootstrap` @@ -74,4 +78,5 @@ EXAMPLES ``` _See code: [src/commands/cm/bootstrap.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-bootstrap/src/commands/cm/bootstrap.ts)_ + diff --git a/packages/contentstack-bootstrap/bin/dev b/packages/contentstack-bootstrap/bin/dev new file mode 100644 index 0000000000..39382a0159 --- /dev/null +++ b/packages/contentstack-bootstrap/bin/dev @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +(async () => { + const { execute } = require('@contentstack/cli-utilities'); + await execute({ type: 'cjs', dir: __dirname, development: true }); +})(); diff --git a/packages/contentstack-bootstrap/bin/dev.cmd b/packages/contentstack-bootstrap/bin/dev.cmd new file mode 100644 index 0000000000..8ae2b12c19 --- /dev/null +++ b/packages/contentstack-bootstrap/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* diff --git a/packages/contentstack-bootstrap/package.json b/packages/contentstack-bootstrap/package.json index b6740d81c4..ec012ebef5 100644 --- a/packages/contentstack-bootstrap/package.json +++ b/packages/contentstack-bootstrap/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-bootstrap", "description": "Bootstrap contentstack apps", - "version": "1.4.16", + "version": "1.5.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { @@ -17,7 +17,7 @@ "test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\"" }, "dependencies": { - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "inquirer": "8.2.4", diff --git a/packages/contentstack-branches/README.md b/packages/contentstack-branches/README.md index f6ee39bc3e..4348a04f10 100755 --- a/packages/contentstack-branches/README.md +++ b/packages/contentstack-branches/README.md @@ -4,9 +4,10 @@ It is Contentstack’s CLI plugin to compare and merge content. [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli-cm-branches](#contentstackcli-cm-branches) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-cm-branches](#contentstackcli-cm-branches) +- [Usage](#usage) +- [Commands](#commands) For switching to EU region update the hosts at config/default.js @@ -32,27 +33,30 @@ For switching to AZURE-NA region update the hosts at config/default.js # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-branches $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-branches/1.0.13 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-branches/1.0.13 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:branches`](#csdx-cmbranches) -* [`csdx cm:branches:create`](#csdx-cmbranchescreate) -* [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) -* [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value) -* [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) + +- [`csdx cm:branches`](#csdx-cmbranches) +- [`csdx cm:branches:create`](#csdx-cmbranchescreate) +- [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) +- [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value) +- [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) ## `csdx cm:branches` @@ -222,4 +226,5 @@ EXAMPLES ``` _See code: [src/commands/cm/branches/merge.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/merge.ts)_ + diff --git a/packages/contentstack-bulk-publish/README.md b/packages/contentstack-bulk-publish/README.md index 025a418508..f7bd26395d 100644 --- a/packages/contentstack-bulk-publish/README.md +++ b/packages/contentstack-bulk-publish/README.md @@ -5,55 +5,59 @@ It is Contentstack’s CLI plugin to perform bulk publish/unpublish operations o [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli-cm-bulk-publish](#contentstackcli-cm-bulk-publish) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-cm-bulk-publish](#contentstackcli-cm-bulk-publish) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-bulk-publish $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-bulk-publish/1.3.11 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-bulk-publish/1.3.11 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) -* [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value-1) -* [`csdx cm:bulk-publish:clear`](#csdx-cmbulk-publishclear) -* [`csdx cm:bulk-publish:configure`](#csdx-cmbulk-publishconfigure) -* [`csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries]`](#csdx-cmbulk-publishcross-publish--a-value---retry-failed-value---bulk-publish-value---content-type-value---locales-value---source-env-value---environments-value---delivery-token-value--c-value--y---branch-value---onlyassets---onlyentries) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) -* [`csdx cm:bulk-publish:revert`](#csdx-cmbulk-publishrevert) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value-1) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:unpublish`](#csdx-cmentriesunpublish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value-1) -* [`csdx cm:stacks:publish`](#csdx-cmstackspublish) -* [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) -* [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) -* [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries-1) + +- [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) +- [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) +- [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) +- [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) +- [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value-1) +- [`csdx cm:bulk-publish:clear`](#csdx-cmbulk-publishclear) +- [`csdx cm:bulk-publish:configure`](#csdx-cmbulk-publishconfigure) +- [`csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries]`](#csdx-cmbulk-publishcross-publish--a-value---retry-failed-value---bulk-publish-value---content-type-value---locales-value---source-env-value---environments-value---delivery-token-value--c-value--y---branch-value---onlyassets---onlyentries) +- [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value) +- [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) +- [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) +- [`csdx cm:bulk-publish:revert`](#csdx-cmbulk-publishrevert) +- [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) +- [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) +- [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value-1) +- [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:unpublish`](#csdx-cmentriesunpublish) +- [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value-1) +- [`csdx cm:stacks:publish`](#csdx-cmstackspublish) +- [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) +- [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) +- [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) +- [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries-1) ## `csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]` @@ -1629,4 +1633,5 @@ EXAMPLES ``` _See code: [src/commands/cm/stacks/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/unpublish.js)_ + diff --git a/packages/contentstack-clone/README.md b/packages/contentstack-clone/README.md index 70823a9458..184ad95362 100644 --- a/packages/contentstack-clone/README.md +++ b/packages/contentstack-clone/README.md @@ -3,25 +3,28 @@ It is Contentstack’s CLI plugin to clone a stack. Using this command, you can export a stack’s content/schema to a new or existing stack. Refer to the [Clone a Stack](https://www.contentstack.com/docs/developers/cli/clone-a-stack/) documentation to learn more. -* [@contentstack/cli-cm-clone](#contentstackcli-cm-clone) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-cm-clone](#contentstackcli-cm-clone) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-clone $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-clone/1.4.17 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-clone/1.5.0 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + ```sh-session @@ -37,8 +40,9 @@ USAGE # Commands -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent-1) + +- [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) +- [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent-1) ## `csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]` @@ -139,4 +143,5 @@ EXAMPLES ``` _See code: [src/commands/cm/stacks/clone.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-clone/src/commands/cm/stacks/clone.js)_ + diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index 1aaaaddb47..ad501b9a21 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-clone", "description": "Contentstack stack clone plugin", - "version": "1.4.17", + "version": "1.5.0", "author": "Contentstack", "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { - "@contentstack/cli-cm-export": "~1.8.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-export": "~1.9.0", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "@colors/colors": "^1.5.0", @@ -70,4 +70,4 @@ "cm:stack-clone": "O-CLN" } } -} +} \ No newline at end of file diff --git a/packages/contentstack-config/README.md b/packages/contentstack-config/README.md index e82fdfc65a..a4a209758b 100644 --- a/packages/contentstack-config/README.md +++ b/packages/contentstack-config/README.md @@ -5,35 +5,39 @@ The config namespace contains all the commands that you will need to configure t [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli-config](#contentstackcli-config) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-config](#contentstackcli-config) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-config $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-config/1.4.11 darwin-x64 node-v20.7.0 +@contentstack/cli-config/1.4.11 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx config:get:base-branch`](#csdx-configgetbase-branch) -* [`csdx config:get:region`](#csdx-configgetregion) -* [`csdx config:remove:base-branch`](#csdx-configremovebase-branch) -* [`csdx config:set:base-branch`](#csdx-configsetbase-branch) -* [`csdx config:set:region [REGION]`](#csdx-configsetregion-region) + +- [`csdx config:get:base-branch`](#csdx-configgetbase-branch) +- [`csdx config:get:region`](#csdx-configgetregion) +- [`csdx config:remove:base-branch`](#csdx-configremovebase-branch) +- [`csdx config:set:base-branch`](#csdx-configsetbase-branch) +- [`csdx config:set:region [REGION]`](#csdx-configsetregion-region) ## `csdx config:get:base-branch` @@ -152,4 +156,5 @@ EXAMPLES ``` _See code: [src/commands/config/set/region.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/region.ts)_ + diff --git a/packages/contentstack-config/bin/dev b/packages/contentstack-config/bin/dev new file mode 100644 index 0000000000..39382a0159 --- /dev/null +++ b/packages/contentstack-config/bin/dev @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +(async () => { + const { execute } = require('@contentstack/cli-utilities'); + await execute({ type: 'cjs', dir: __dirname, development: true }); +})(); diff --git a/packages/contentstack-config/bin/dev.cmd b/packages/contentstack-config/bin/dev.cmd new file mode 100644 index 0000000000..8ae2b12c19 --- /dev/null +++ b/packages/contentstack-config/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* diff --git a/packages/contentstack-export/README.md b/packages/contentstack-export/README.md index 446ce94a2b..13805a8c85 100755 --- a/packages/contentstack-export/README.md +++ b/packages/contentstack-export/README.md @@ -5,9 +5,10 @@ It is Contentstack’s CLI plugin to export content from the stack. To learn how [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli-cm-export](#contentstackcli-cm-export) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-cm-export](#contentstackcli-cm-export) +- [Usage](#usage) +- [Commands](#commands) For switching to EU region update the hosts at config/default.js @@ -43,24 +44,27 @@ For switching to AZURE-EU region update the hosts at config/default.js # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-export $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-export/1.8.2 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-export/1.9.0 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets) -* [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets-1) + +- [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets) +- [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets-1) ## `csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]` @@ -147,4 +151,5 @@ EXAMPLES ``` _See code: [src/commands/cm/stacks/export.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/stacks/export.ts)_ + diff --git a/packages/contentstack-export/bin/dev b/packages/contentstack-export/bin/dev index 74555287cd..59b22a63af 100755 --- a/packages/contentstack-export/bin/dev +++ b/packages/contentstack-export/bin/dev @@ -1,4 +1,5 @@ #!/usr/bin/env node + (async () => { const oclif = require('@oclif/core'); await oclif.execute({ type: 'cjs', development: true, dir: __dirname }); diff --git a/packages/contentstack-export/example_config/auth_config.json b/packages/contentstack-export/example_config/auth_config.json index 4e4743f721..10a3d173c7 100644 --- a/packages/contentstack-export/example_config/auth_config.json +++ b/packages/contentstack-export/example_config/auth_config.json @@ -1,4 +1,5 @@ { + "contentVersion": 2, "master_locale": { "name": "English - United States", "code": "en-us" @@ -9,10 +10,5 @@ "moduleName": "content-types", "fetchConcurrency": 5, "writeConcurrency": 5, - "updatedModules": [ - "assets", - "locales" - ], - "useNewModuleStructure": true, "securedAssets": false } \ No newline at end of file diff --git a/packages/contentstack-export/example_config/management_config.json b/packages/contentstack-export/example_config/management_config.json index d2dd367007..7e5efa03ea 100644 --- a/packages/contentstack-export/example_config/management_config.json +++ b/packages/contentstack-export/example_config/management_config.json @@ -1,4 +1,5 @@ { + "contentVersion": 2, "master_locale": { "name": "English - United States", "code": "en-us" @@ -8,11 +9,6 @@ "moduleName": "content-types", "fetchConcurrency": 5, "writeConcurrency": 5, - "updatedModules": [ - "assets", - "locales" - ], - "useNewModuleStructure": true, "securedAssets": false, "createBackupDir": "./temp" } \ No newline at end of file diff --git a/packages/contentstack-export/package.json b/packages/contentstack-export/package.json index 2aa8ed8472..99d6c7ea33 100644 --- a/packages/contentstack-export/package.json +++ b/packages/contentstack-export/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-export", "description": "Contentstack CLI plugin to export content from stack", - "version": "1.8.2", + "version": "1.9.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { @@ -29,9 +29,9 @@ "@contentstack/cli-dev-dependencies": "~1.2.3", "@oclif/plugin-help": "^5.1.19", "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/mkdirp": "^1.0.2", "@types/progress-stream": "^2.0.2", - "@types/mkdirp": "^1.0.2", "assert": "^2.0.0", "chai": "^4.2.0", "dotenv": "^16.0.1", @@ -98,4 +98,4 @@ } }, "repository": "https://github.com/contentstack/cli" -} +} \ No newline at end of file diff --git a/packages/contentstack-export/src/commands/cm/stacks/export.ts b/packages/contentstack-export/src/commands/cm/stacks/export.ts index 02fe134816..24eb5cde66 100644 --- a/packages/contentstack-export/src/commands/cm/stacks/export.ts +++ b/packages/contentstack-export/src/commands/cm/stacks/export.ts @@ -10,7 +10,7 @@ import { FlagInput, } from '@contentstack/cli-utilities'; import { ModuleExporter } from '../../../export'; -import { setupExportConfig, log, formatError } from '../../../utils'; +import { setupExportConfig, log, formatError, writeExportMetaFile } from '../../../utils'; import { ExportConfig } from '../../../types'; export default class ExportCommand extends Command { @@ -110,7 +110,9 @@ export default class ExportCommand extends Command { const managementAPIClient: ContentstackClient = await managementSDKClient(exportConfig); const moduleExporter = new ModuleExporter(managementAPIClient, exportConfig); await moduleExporter.start(); + writeExportMetaFile(exportConfig); log(exportConfig, `The content of the stack ${exportConfig.apiKey} has been exported successfully!`, 'success'); + log(exportConfig, `The log has been stored at '${path.join(exportDir, 'logs', 'export')}'`, 'success'); } catch (error) { log({ data: exportDir } as ExportConfig, `Failed to export stack content - ${formatError(error)}`, 'error'); log( diff --git a/packages/contentstack-export/src/config/index.ts b/packages/contentstack-export/src/config/index.ts index 52a0bd214b..ceb09c1cb0 100644 --- a/packages/contentstack-export/src/config/index.ts +++ b/packages/contentstack-export/src/config/index.ts @@ -1,6 +1,7 @@ import { DefaultConfig } from '../types'; const config: DefaultConfig = { + contentVersion: 2, versioning: false, host: 'https://api.contentstack.io/v3', developerHubUrls: { @@ -96,8 +97,8 @@ const config: DefaultConfig = { invalidKeys: ['created_at', 'updated_at', 'created_by', 'updated_by', '_metadata', 'published'], // no of asset version files (of a single asset) that'll be downloaded parallel chunkFileSize: 1, // measured on Megabits (5mb) - downloadLimit: 10, - fetchConcurrency: 10, + downloadLimit: 5, + fetchConcurrency: 5, assetsMetaKeys: [], // Default keys ['uid', 'url', 'filename'] securedAssets: false, displayExecutionTime: false, @@ -369,20 +370,6 @@ const config: DefaultConfig = { 'xh', 'zu', ], - updatedModules: [ - 'assets', - 'locales', - 'extensions', - 'marketplace-apps', - 'labels', - 'webhooks', - 'custom-roles', - 'global-fields', - 'content-types', - 'entries', - 'workflows', - 'stack', - ], apis: { userSession: '/user-session/', globalfields: '/global_fields/', @@ -402,7 +389,6 @@ const config: DefaultConfig = { writeConcurrency: 5, developerHubBaseUrl: '', marketplaceAppEncryptionKey: 'nF2ejRQcTv', - useNewModuleStructure: false, }; export default config; diff --git a/packages/contentstack-export/src/export/module-exporter.ts b/packages/contentstack-export/src/export/module-exporter.ts index a404af4570..dacd48c639 100644 --- a/packages/contentstack-export/src/export/module-exporter.ts +++ b/packages/contentstack-export/src/export/module-exporter.ts @@ -47,6 +47,7 @@ class ModuleExporter { } async export() { + log(this.exportConfig, `Started to export content, version is ${this.exportConfig.contentVersion}`, 'info'); // checks for single module or all modules if (this.exportConfig.singleModuleExport) { return this.exportSingleModule(this.exportConfig.moduleName); @@ -59,7 +60,7 @@ class ModuleExporter { // export the modules by name // calls the module runner which inturn calls the module itself let exportedModuleResponse; - if (this.exportConfig.useNewModuleStructure && this.exportConfig.updatedModules.indexOf(moduleName) !== -1) { + if (this.exportConfig.contentVersion === 2) { exportedModuleResponse = await startModuleExport({ stackAPIClient: this.stackAPIClient, exportConfig: this.exportConfig, diff --git a/packages/contentstack-export/src/export/modules-js/marketplace-apps.js b/packages/contentstack-export/src/export/modules-js/marketplace-apps.js index a9b94e09d7..d4b6c0cb42 100644 --- a/packages/contentstack-export/src/export/modules-js/marketplace-apps.js +++ b/packages/contentstack-export/src/export/modules-js/marketplace-apps.js @@ -44,7 +44,9 @@ module.exports = class ExportMarketplaceApps { } this.developerHubBaseUrl = this.config.developerHubBaseUrl || (await getDeveloperHubUrl(this.config)); - + this.appSdkAxiosInstance = await managementSDKClient({ + host: this.developerHubBaseUrl.split('://').pop() + }); await this.getOrgUid(); const httpClient = new HttpClient(); @@ -65,7 +67,7 @@ module.exports = class ExportMarketplaceApps { ); mkdirp.sync(this.marketplaceAppPath); - this.nodeCrypto= await createNodeCryptoInstance(config); + this.nodeCrypto = await createNodeCryptoInstance(config); return this.exportInstalledExtensions(); } @@ -106,8 +108,12 @@ module.exports = class ExportMarketplaceApps { } getAllStackSpecificApps(listOfApps = [], skip = 0) { - return this.httpClient - .get(`${this.developerHubBaseUrl}/installations?target_uids=${this.config.source_stack}&skip=${skip}`) + return this.appSdkAxiosInstance.axiosInstance + .get(`/installations?target_uids=${this.config.source_stack}&skip=${skip}`, { + headers: { + organization_uid: this.config.org_uid + }, + }) .then(async ({ data }) => { const { data: apps, count } = data; @@ -161,9 +167,9 @@ module.exports = class ExportMarketplaceApps { } else if (error) { log(this.config, `Error on exporting ${appName} app and it's config.`, 'error'); } - }) - .catch(err => { - log(this.config, `Failed to export ${appName} app config ${formatError(err)}`, 'error'); - }) + }) + .catch((err) => { + log(this.config, `Failed to export ${appName} app config ${formatError(err)}`, 'error'); + }); } }; diff --git a/packages/contentstack-export/src/export/modules/custom-roles.ts b/packages/contentstack-export/src/export/modules/custom-roles.ts index 4ad66dd7f4..74397555c0 100644 --- a/packages/contentstack-export/src/export/modules/custom-roles.ts +++ b/packages/contentstack-export/src/export/modules/custom-roles.ts @@ -4,7 +4,6 @@ import forEach from 'lodash/forEach'; import values from 'lodash/values'; import { resolve as pResolve } from 'node:path'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { CustomRoleConfig, ModuleClassParams } from '../../types'; @@ -21,7 +20,7 @@ export default class ExportCustomRoles extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.customRoles = {}; - this.customRolesConfig = config.modules.customRoles; + this.customRolesConfig = exportConfig.modules.customRoles; this.existingRoles = { Admin: 1, Developer: 1, 'Content Manager': 1 }; this.localesMap = {}; this.sourceLocalesMap = {}; diff --git a/packages/contentstack-export/src/export/modules/entries.ts b/packages/contentstack-export/src/export/modules/entries.ts index f795cee78c..b1981929cf 100644 --- a/packages/contentstack-export/src/export/modules/entries.ts +++ b/packages/contentstack-export/src/export/modules/entries.ts @@ -54,11 +54,11 @@ export default class EntriesExport extends BaseClass { } const entryRequestOptions = this.createRequestObjects(locales, contentTypes); for (let entryRequestOption of entryRequestOptions) { - log( - this.exportConfig, - `Starting export of entries of content type - ${entryRequestOption.contentType} locale - ${entryRequestOption.locale}`, - 'info', - ); + // log( + // this.exportConfig, + // `Starting export of entries of content type - ${entryRequestOption.contentType} locale - ${entryRequestOption.locale}`, + // 'info', + // ); await this.getEntries(entryRequestOption); this.entriesFileHelper?.completeFile(true); log( diff --git a/packages/contentstack-export/src/export/modules/environments.ts b/packages/contentstack-export/src/export/modules/environments.ts index 980b18c1ac..25e02dadac 100644 --- a/packages/contentstack-export/src/export/modules/environments.ts +++ b/packages/contentstack-export/src/export/modules/environments.ts @@ -2,7 +2,6 @@ import { resolve as pResolve } from 'node:path'; import omit from 'lodash/omit'; import isEmpty from 'lodash/isEmpty'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { EnvironmentConfig, ModuleClassParams } from '../../types'; @@ -19,7 +18,7 @@ export default class ExportEnvironments extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.environments = {}; - this.environmentConfig = config.modules.environments; + this.environmentConfig = exportConfig.modules.environments; this.qs = { include_count: true }; } diff --git a/packages/contentstack-export/src/export/modules/extensions.ts b/packages/contentstack-export/src/export/modules/extensions.ts index 4b1ecd514e..5eb51b2433 100644 --- a/packages/contentstack-export/src/export/modules/extensions.ts +++ b/packages/contentstack-export/src/export/modules/extensions.ts @@ -2,7 +2,6 @@ import omit from 'lodash/omit'; import isEmpty from 'lodash/isEmpty'; import { resolve as pResolve } from 'node:path'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { ExtensionsConfig, ModuleClassParams } from '../../types'; @@ -19,7 +18,7 @@ export default class ExportExtensions extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.extensions = {}; - this.extensionConfig = config.modules.extensions; + this.extensionConfig = exportConfig.modules.extensions; this.qs = { include_count: true }; } diff --git a/packages/contentstack-export/src/export/modules/labels.ts b/packages/contentstack-export/src/export/modules/labels.ts index ce9c320240..3bbb680f8b 100644 --- a/packages/contentstack-export/src/export/modules/labels.ts +++ b/packages/contentstack-export/src/export/modules/labels.ts @@ -2,7 +2,6 @@ import omit from 'lodash/omit'; import isEmpty from 'lodash/isEmpty'; import { resolve as pResolve } from 'node:path'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { LabelConfig, ModuleClassParams } from '../../types'; @@ -19,7 +18,7 @@ export default class ExportLabels extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.labels = {}; - this.labelConfig = config.modules.labels; + this.labelConfig = exportConfig.modules.labels; this.qs = { include_count: true }; } diff --git a/packages/contentstack-export/src/export/modules/marketplace-apps.ts b/packages/contentstack-export/src/export/modules/marketplace-apps.ts index 0f2fa18815..1102992e63 100644 --- a/packages/contentstack-export/src/export/modules/marketplace-apps.ts +++ b/packages/contentstack-export/src/export/modules/marketplace-apps.ts @@ -15,7 +15,6 @@ import { ContentstackClient, } from '@contentstack/cli-utilities'; -import config from '../../config'; import { log, getDeveloperHubUrl, @@ -40,7 +39,7 @@ export default class ExportMarketplaceApps extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.httpClient = new HttpClient(); - this.marketplaceAppConfig = config.modules.marketplace_apps; + this.marketplaceAppConfig = exportConfig.modules.marketplace_apps; this.listOfApps = []; this.installedApps = []; } diff --git a/packages/contentstack-export/src/export/modules/stack.ts b/packages/contentstack-export/src/export/modules/stack.ts index e05ddffcee..59174022b5 100644 --- a/packages/contentstack-export/src/export/modules/stack.ts +++ b/packages/contentstack-export/src/export/modules/stack.ts @@ -2,7 +2,6 @@ import find from 'lodash/find'; import { resolve as pResolve } from 'node:path'; import { isAuthenticated, managementSDKClient } from '@contentstack/cli-utilities'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { StackConfig, ModuleClassParams } from '../../types'; @@ -17,7 +16,7 @@ export default class ExportStack extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); - this.stackConfig = config.modules.stack; + this.stackConfig = exportConfig.modules.stack; this.qs = { include_count: true }; this.stackFolderPath = pResolve(this.exportConfig.data, this.stackConfig.dirName); } @@ -41,11 +40,9 @@ export default class ExportStack extends BaseClass { async getStack(): Promise { const tempAPIClient = await managementSDKClient({ host: this.exportConfig.host }); return await tempAPIClient - .stack({ api_key: this.exportConfig.source_stack }) - .fetch() - .catch((error: any) => { - log(this.exportConfig, `Failed to export stack. ${formatError(error)}`, 'error'); - }); + .stack({ api_key: this.exportConfig.source_stack }) + .fetch() + .catch((error: any) => {}); } async getLocales(skip: number = 0) { diff --git a/packages/contentstack-export/src/export/modules/webhooks.ts b/packages/contentstack-export/src/export/modules/webhooks.ts index 77b7b99e4f..0d07b67b36 100644 --- a/packages/contentstack-export/src/export/modules/webhooks.ts +++ b/packages/contentstack-export/src/export/modules/webhooks.ts @@ -2,7 +2,6 @@ import omit from 'lodash/omit'; import isEmpty from 'lodash/isEmpty'; import { resolve as pResolve } from 'node:path'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { WebhookConfig, ModuleClassParams } from '../../types'; @@ -20,7 +19,7 @@ export default class ExportWebhooks extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.webhooks = {}; - this.webhookConfig = config.modules.webhooks; + this.webhookConfig = exportConfig.modules.webhooks; this.qs = { include_count: true, asc: 'updated_at' }; } diff --git a/packages/contentstack-export/src/export/modules/workflows.ts b/packages/contentstack-export/src/export/modules/workflows.ts index cdce55e359..d757faa7b1 100644 --- a/packages/contentstack-export/src/export/modules/workflows.ts +++ b/packages/contentstack-export/src/export/modules/workflows.ts @@ -2,7 +2,6 @@ import omit from 'lodash/omit'; import isEmpty from 'lodash/isEmpty'; import { resolve as pResolve } from 'node:path'; -import config from '../../config'; import BaseClass from './base-class'; import { log, formatError, fsUtil } from '../../utils'; import { WorkflowConfig, ModuleClassParams } from '../../types'; @@ -19,7 +18,7 @@ export default class ExportWorkFlows extends BaseClass { constructor({ exportConfig, stackAPIClient }: ModuleClassParams) { super({ exportConfig, stackAPIClient }); this.workflows = {}; - this.workflowConfig = config.modules.workflows; + this.workflowConfig = exportConfig.modules.workflows; this.qs = { include_count: true }; } @@ -53,10 +52,12 @@ export default class ExportWorkFlows extends BaseClass { .fetchAll(this.qs) .then(async (data: any) => { const { items, count } = data; + //NOTE - Handle the case where old workflow api is enabled in that case getting responses as objects. + const workflowCount = count !== undefined ? count : items.length; if (items?.length) { await this.sanitizeAttribs(items); skip += this.workflowConfig.limit || 100; - if (skip >= count) { + if (skip >= workflowCount) { return; } return await this.getWorkflows(skip); diff --git a/packages/contentstack-export/src/types/default-config.ts b/packages/contentstack-export/src/types/default-config.ts index 918786bdac..e3f92cbc63 100644 --- a/packages/contentstack-export/src/types/default-config.ts +++ b/packages/contentstack-export/src/types/default-config.ts @@ -1,6 +1,7 @@ import { Modules } from '.'; export default interface DefaultConfig { + contentVersion: number; versioning: boolean; host: string; cdn?: string; @@ -145,7 +146,6 @@ export default interface DefaultConfig { }; }; languagesCode: string[]; - updatedModules: string[]; apis: { userSession: string; globalfields: string; @@ -165,5 +165,4 @@ export default interface DefaultConfig { writeConcurrency: number; developerHubBaseUrl: string; marketplaceAppEncryptionKey: string; - useNewModuleStructure: boolean; } diff --git a/packages/contentstack-export/src/utils/common-helper.ts b/packages/contentstack-export/src/utils/common-helper.ts index fc5327d070..6d6baaaf8e 100644 --- a/packages/contentstack-export/src/utils/common-helper.ts +++ b/packages/contentstack-export/src/utils/common-helper.ts @@ -5,9 +5,10 @@ */ import promiseLimit from 'promise-limit'; +import * as path from 'path'; import { isAuthenticated } from '@contentstack/cli-utilities'; - -import { ExternalConfig } from '../types'; +import { ExternalConfig, ExportConfig } from '../types'; +import { fsUtil } from './file-helper'; export const validateConfig = function (config: ExternalConfig) { if (!config.host || !config.cdn) { @@ -77,3 +78,12 @@ export const executeTask = function ( }), ); }; + +// Note: we can add more useful details in meta file +export const writeExportMetaFile = (exportConfig: ExportConfig) => { + const exportMeta = { + contentVersion: exportConfig.contentVersion, + logsPath: path.join(exportConfig.exportDir, 'logs', 'export'), + }; + fsUtil.writeFile(path.join(exportConfig.exportDir, exportConfig.branchName || '', 'export-info.json'), exportMeta); +}; diff --git a/packages/contentstack-export/src/utils/file-helper.ts b/packages/contentstack-export/src/utils/file-helper.ts index cc9863c843..ce7c7f326e 100644 --- a/packages/contentstack-export/src/utils/file-helper.ts +++ b/packages/contentstack-export/src/utils/file-helper.ts @@ -50,7 +50,7 @@ export const readLargeFile = function (filePath: string, options: { type?: strin console.log('error', error); reject(error); }); - readStream.pipe(parseStream); + readStream.pipe(parseStream as any); }); } }; diff --git a/packages/contentstack-export/src/utils/logger.ts b/packages/contentstack-export/src/utils/logger.ts index e808f2dbdf..c3edf2ce27 100644 --- a/packages/contentstack-export/src/utils/logger.ts +++ b/packages/contentstack-export/src/utils/logger.ts @@ -134,13 +134,13 @@ function init(_logPath: string) { } export const log = async (config: ExportConfig, message: any, type: string) => { - config.data = config.data || path.join(__dirname, 'logs'); + const logsPath = config.data || __dirname; // ignoring the type argument, as we are not using it to create a logfile anymore if (type !== 'error') { // removed type argument from init method - init(config.data).log(message); + init(logsPath).log(message); } else { - init(config.data).error(message); + init(logsPath).error(message); } }; diff --git a/packages/contentstack-export/src/utils/marketplace-app-helper.ts b/packages/contentstack-export/src/utils/marketplace-app-helper.ts index 5ade083077..35752d4820 100644 --- a/packages/contentstack-export/src/utils/marketplace-app-helper.ts +++ b/packages/contentstack-export/src/utils/marketplace-app-helper.ts @@ -3,7 +3,6 @@ import { cliux, configHandler, NodeCrypto, HttpClient, managementSDKClient } fro import { formatError, log } from '../utils'; import { ExportConfig } from '../types'; import { askDeveloperHub } from './interactive'; - export const getDeveloperHubUrl = async (exportConfig: ExportConfig) => { const { cma, name } = configHandler.get('region') || {}; let developerHubBaseUrl = exportConfig?.developerHubUrls[cma]; @@ -21,7 +20,7 @@ export async function getOrgUid(config: ExportConfig): Promise { .stack({ api_key: config.source_stack }) .fetch() .catch((error: any) => { - log(this.config, formatError(error), 'error'); + log(config, formatError(error), 'error'); }); return tempStackData?.org_uid; @@ -56,8 +55,15 @@ export const getStackSpecificApps = async (params: { skip: number; }) => { const { developerHubBaseUrl, httpClient, config, skip } = params; - return httpClient - .get(`${developerHubBaseUrl}/installations?target_uids=${config.source_stack}&skip=${skip}`) + const appSdkAxiosInstance = await managementSDKClient({ + host: developerHubBaseUrl.split('://').pop() + }); + return appSdkAxiosInstance.axiosInstance + .get(`${developerHubBaseUrl}/installations?target_uids=${config.source_stack}&skip=${skip}`, { + headers: { + organization_uid: config.org_uid, + }, + }) .then((data: any) => data.data) .catch((error: any) => log(config, `Failed to export marketplace-apps ${formatError(error)}`, 'error')); }; diff --git a/packages/contentstack-import/README.md b/packages/contentstack-import/README.md index 151a753308..16b661eec3 100644 --- a/packages/contentstack-import/README.md +++ b/packages/contentstack-import/README.md @@ -5,8 +5,9 @@ It is Contentstack’s CLI plugin to import content in the stack. To learn how t [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [Usage](#usage) -* [Commands](#commands) + +- [Usage](#usage) +- [Commands](#commands) For switching to EU region update the hosts at config/default.js @@ -42,24 +43,27 @@ For switching to AZURE-EU region update the hosts at config/default.js # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-import $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-import/1.8.4 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-import/1.9.0 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) -* [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent-1) + +- [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) +- [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent-1) ## `csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]` @@ -152,4 +156,5 @@ EXAMPLES ``` _See code: [src/commands/cm/stacks/import.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-import/src/commands/cm/stacks/import.ts)_ + diff --git a/packages/contentstack-import/bin/dev b/packages/contentstack-import/bin/dev index 02b50d62ab..59b22a63af 100644 --- a/packages/contentstack-import/bin/dev +++ b/packages/contentstack-import/bin/dev @@ -1,17 +1,6 @@ #!/usr/bin/env node -const oclif = require('@oclif/core'); - -const path = require('path'); -const project = path.join(__dirname, '..', 'tsconfig.json'); - -// In dev mode -> use ts-node and dev plugins -process.env.NODE_ENV = 'development'; - -require('ts-node').register({ project }); - -// In dev mode, always show stack traces -oclif.settings.debug = true; - -// Start the CLI -oclif.run().then(oclif.flush).catch(oclif.Errors.handle); +(async () => { + const oclif = require('@oclif/core'); + await oclif.execute({ type: 'cjs', development: true, dir: __dirname }); +})(); diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 4e9d7080eb..f92f51477c 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -1,34 +1,35 @@ { "name": "@contentstack/cli-cm-import", "description": "Contentstack CLI plugin to import content into stack", - "version": "1.8.4", + "version": "1.9.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { + "@contentstack/management": "~1.10.2", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", - "@contentstack/management": "~1.10.0", "@oclif/core": "^2.9.3", "big-json": "^3.2.0", "bluebird": "^3.7.2", "chalk": "^4.1.2", "debug": "^4.1.0", + "fs-extra": "^11.1.1", "lodash": "^4.17.20", "marked": "^4.0.17", "merge": "^2.1.1", "mkdirp": "^1.0.4", - "ncp": "^2.0.0", "promise-limit": "^2.7.0", "tslib": "^2.4.1", "winston": "^3.7.2" }, "devDependencies": { "@oclif/test": "^1.2.6", + "@types/big-json": "^3.2.0", "@types/bluebird": "^3.5.38", "@types/chai": "^4.2.18", + "@types/fs-extra": "^11.0.1", "@types/mkdirp": "^1.0.2", "@types/mocha": "^8.2.2", - "@types/ncp": "^2.0.5", "@types/node": "^14.14.32", "@types/sinon": "^10.0.2", "@types/tar": "^4.0.3", diff --git a/packages/contentstack-import/src/commands/cm/stacks/import.ts b/packages/contentstack-import/src/commands/cm/stacks/import.ts index d3cc5650ed..2712ca7b5c 100644 --- a/packages/contentstack-import/src/commands/cm/stacks/import.ts +++ b/packages/contentstack-import/src/commands/cm/stacks/import.ts @@ -103,22 +103,25 @@ export default class ImportCommand extends Command { // initialize the importer // start import let contentDir: string; + let backupDir: string; try { const { flags } = await this.parse(ImportCommand); let importConfig = await setupImportConfig(flags); // Note setting host to create cma client importConfig.host = this.cmaHost; contentDir = importConfig.contentDir; + backupDir = importConfig.backupDir; const managementAPIClient: ContentstackClient = await managementSDKClient(importConfig); const moduleImporter = new ModuleImporter(managementAPIClient, importConfig); await moduleImporter.start(); log(importConfig, `The content has been imported to the stack ${importConfig.apiKey} successfully!`, 'success'); + log(importConfig, `The log has been stored at '${path.join(importConfig.backupDir, 'logs', 'import')}'`, 'success'); } catch (error) { - log({ data: contentDir } as ImportConfig, `Failed to import stack content - ${formatError(error)}`, 'error'); + log({ data: backupDir } as ImportConfig, `Failed to import stack content - ${formatError(error)}`, 'error'); log( - { data: contentDir } as ImportConfig, + { data: backupDir } as ImportConfig, `The log has been stored at ${ - { data: contentDir } ? path.join(contentDir || __dirname, 'logs', 'import') : path.join(__dirname, 'logs') + { data: backupDir } ? path.join(backupDir || __dirname, 'logs', 'import') : path.join(__dirname, 'logs') }`, 'info', ); diff --git a/packages/contentstack-import/src/config/index.ts b/packages/contentstack-import/src/config/index.ts index 63fb403e5f..c9003f3622 100644 --- a/packages/contentstack-import/src/config/index.ts +++ b/packages/contentstack-import/src/config/index.ts @@ -84,9 +84,9 @@ const config: DefaultConfig = { publishAssets: true, fileName: 'assets.json', importSameStructure: true, - uploadAssetsConcurrency: 10, + uploadAssetsConcurrency: 2, displayExecutionTime: false, - importFoldersConcurrency: 10, + importFoldersConcurrency: 1, includeVersionedAssets: false, host: 'https://api.contentstack.io', folderValidKeys: ['name', 'parent_uid'], @@ -367,19 +367,6 @@ const config: DefaultConfig = { stacks: '/stacks/', labels: '/labels/', }, - updatedModules: [ - 'assets', - 'extensions', - 'locales', - 'marketplace-apps', - 'labels', - 'global-fields', - 'content-types', - 'webhooks', - 'custom-roles', - 'workflows', - 'entries', - ], rateLimit: 5, preserveStackVersion: false, entriesPublish: true, @@ -390,7 +377,6 @@ const config: DefaultConfig = { developerHubBaseUrl: '', marketplaceAppEncryptionKey: 'nF2ejRQcTv', getEncryptionKeyMaxRetry: 3, - useNewModuleStructure: false, // useBackedupDir: '', // backupConcurrency: 10, }; diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index 1ce2c624ca..36551d16d0 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -59,6 +59,8 @@ class ModuleImporter { } async import() { + log(this.importConfig, `Starting to import content version ${this.importConfig.contentVersion}`, 'info'); + // checks for single module or all modules if (this.importConfig.singleModuleImport) { return this.importByModuleByName(this.importConfig.moduleName); @@ -68,27 +70,21 @@ class ModuleImporter { async importByModuleByName(moduleName: Modules) { log(this.importConfig, `Starting import of ${moduleName} module`, 'info'); - - const basePath = `${this.importConfig.backupDir}/${moduleName}`; // import the modules by name // calls the module runner which inturn calls the module itself // Todo: Implement a mechanism to determine whether module is new or old - if ( - this.importConfig.useNewModuleStructure && - this.importConfig.updatedModules.indexOf(moduleName) !== -1 - //&& new FsUtility({ basePath }).isNewFsStructure - ) { + if (this.importConfig.contentVersion === 2) { return startModuleImport({ stackAPIClient: this.stackAPIClient, importConfig: this.importConfig, moduleName, }); } - return startJSModuleImport({ - stackAPIClient: this.stackAPIClient, - importConfig: this.importConfig, - moduleName, - }); + return startJSModuleImport({ + stackAPIClient: this.stackAPIClient, + importConfig: this.importConfig, + moduleName, + }); } async importAllModules(): Promise { diff --git a/packages/contentstack-import/src/import/modules-js/marketplace-apps.js b/packages/contentstack-import/src/import/modules-js/marketplace-apps.js index 0537576c01..f0af583cc8 100644 --- a/packages/contentstack-import/src/import/modules-js/marketplace-apps.js +++ b/packages/contentstack-import/src/import/modules-js/marketplace-apps.js @@ -61,7 +61,9 @@ module.exports = class ImportMarketplaceApps { this.developerHubBaseUrl = this.config.developerHubBaseUrl || (await getDeveloperHubUrl(this.config)); this.client = await managementSDKClient({ endpoint: this.developerHubBaseUrl }); - + this.appSdkAxiosInstance = await managementSDKClient({ + host: this.developerHubBaseUrl.split('://').pop() + }); await this.getOrgUid(); const httpClient = new HttpClient(); @@ -519,9 +521,12 @@ module.exports = class ImportMarketplaceApps { if (_.isEmpty(app) || _.isEmpty(payload) || !uid) { return Promise.resolve(); } - - return this.httpClient - .put(`${this.developerHubBaseUrl}/installations/${uid}`, payload) + return this.appSdkAxiosInstance.axiosInstance + .put(`${this.developerHubBaseUrl}/installations/${uid}`, payload, { + headers: { + organization_uid: this.config.org_uid + }, + }) .then(({ data }) => { if (data.message) { log(this.config, formatError(data.message), 'success'); diff --git a/packages/contentstack-import/src/import/modules/assets.ts b/packages/contentstack-import/src/import/modules/assets.ts index 1863bed5a8..8b048da5bf 100644 --- a/packages/contentstack-import/src/import/modules/assets.ts +++ b/packages/contentstack-import/src/import/modules/assets.ts @@ -4,6 +4,7 @@ import filter from 'lodash/filter'; import unionBy from 'lodash/unionBy'; import orderBy from 'lodash/orderBy'; import isEmpty from 'lodash/isEmpty'; +import uniq from 'lodash/uniq'; import { existsSync } from 'node:fs'; import includes from 'lodash/includes'; import { resolve as pResolve, join } from 'node:path'; @@ -258,9 +259,11 @@ export default class ImportAssets extends BaseClass { }; const serializeData = (apiOptions: ApiOptions) => { const { apiData: asset } = apiOptions; - const publishDetails = filter(asset.publish_details, 'environment'); + const publishDetails = filter(asset.publish_details, ({ environment }) => { + return this.environments.hasOwnProperty(environment); + }); + const environments = uniq(map(publishDetails, ({ environment }) => this.environments[environment].name)); const locales = map(publishDetails, 'locale'); - const environments = map(publishDetails, ({ environment }) => this.environments[environment].name); asset.locales = locales; asset.environments = environments; diff --git a/packages/contentstack-import/src/import/modules/base-class.ts b/packages/contentstack-import/src/import/modules/base-class.ts index 932e375235..fa99462ead 100644 --- a/packages/contentstack-import/src/import/modules/base-class.ts +++ b/packages/contentstack-import/src/import/modules/base-class.ts @@ -13,7 +13,7 @@ import { FolderData } from '@contentstack/management/types/stack/asset/folder'; import { ExtensionData } from '@contentstack/management/types/stack/extension'; import { GlobalFieldData } from '@contentstack/management/types/stack/globalField'; import { ContentTypeData } from '@contentstack/management/types/stack/contentType'; -// import { EnvironmentData } from '@contentstack/management/types/stack/environment'; +import { EnvironmentData } from '@contentstack/management/types/stack/environment'; import { LabelData } from '@contentstack/management/types/stack/label'; import { WebhookData } from '@contentstack/management/types/stack/webhook'; import { WorkflowData } from '@contentstack/management/types/stack/workflow'; @@ -206,11 +206,7 @@ export default abstract class BaseClass { // info: Batch No. 20 of import assets is complete if (currentIndexer) batchMsg += `Current chunk processing is (${currentIndexer}/${indexerCount})`; - log( - this.importConfig, - `Batch No. (${batchNo}/${totelBatches}) of ${processName} is complete. ${batchMsg}`, - 'success', - ); + log(this.importConfig, `Batch No. (${batchNo}/${totelBatches}) of ${processName} is complete`, 'success'); } if (this.importConfig.modules.assets.displayExecutionTime) { @@ -299,18 +295,21 @@ export default abstract class BaseClass { case 'create-cts': return this.stack.contentType().create(apiData).then(onSuccess).catch(onReject); case 'update-cts': - if (additionalInfo.skip) { - return Promise.resolve(onSuccess(apiData)); + if (!apiData) { + return Promise.resolve(); } return apiData.update().then(onSuccess).catch(onReject); case 'update-gfs': + if (!apiData) { + return Promise.resolve(); + } return apiData.update().then(onSuccess).catch(onReject); case 'create-environments': - // return this.stack - // .environment() - // .create({ environment: omit(apiData, ['uid']) as EnvironmentData }) - // .then(onSuccess) - // .catch(onReject); + return this.stack + .environment() + .create({ environment: omit(apiData, ['uid']) as EnvironmentData }) + .then(onSuccess) + .catch(onReject); case 'create-labels': return this.stack .label() @@ -345,6 +344,12 @@ export default abstract class BaseClass { .then(onSuccess) .catch(onReject); case 'create-entries': + if (!apiData) { + return Promise.resolve(); + } + if (additionalInfo[apiData?.uid]?.isLocalized) { + return apiData.update({ locale: additionalInfo.locale }).then(onSuccess).catch(onReject); + } return this.stack .contentType(additionalInfo.cTUid) .entry() @@ -352,22 +357,28 @@ export default abstract class BaseClass { .then(onSuccess) .catch(onReject); case 'update-entries': + if (!apiData) { + return Promise.resolve(); + } return apiData.update({ locale: additionalInfo.locale }).then(onSuccess).catch(onReject); case 'publish-entries': - if (additionalInfo.skip) { - return Promise.resolve(onSuccess(apiData)); + if (!apiData || !apiData.entryUid) { + return Promise.resolve(); } return this.stack .contentType(additionalInfo.cTUid) - .entry(additionalInfo.entryUid) - .publish({ publishDetails: apiData, locale: additionalInfo.locale }) + .entry(apiData.entryUid) + .publish({ + publishDetails: { environments: apiData.environments, locales: apiData.locales }, + locale: additionalInfo.locale, + }) .then(onSuccess) .catch(onReject); case 'delete-entries': return this.stack .contentType(apiData.cTUid) .entry(apiData.entryUid) - .delete({ locale: this.importConfig?.master_locale?.code }) + .delete({ locale: additionalInfo.locale }) .then(onSuccess) .catch(onReject); default: diff --git a/packages/contentstack-import/src/import/modules/custom-roles.ts b/packages/contentstack-import/src/import/modules/custom-roles.ts index 643812a8dd..240db7a680 100644 --- a/packages/contentstack-import/src/import/modules/custom-roles.ts +++ b/packages/contentstack-import/src/import/modules/custom-roles.ts @@ -1,8 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import values from 'lodash/values'; -import { join, resolve } from 'node:path'; +import { join } from 'node:path'; -import config from '../../config'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ModuleClassParams, CustomRoleConfig } from '../../types'; @@ -30,7 +29,7 @@ export default class ImportCustomRoles extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.customRolesConfig = config.modules.customRoles; + this.customRolesConfig = importConfig.modules.customRoles; this.customRolesMapperPath = join(this.importConfig.backupDir, 'mapper', 'custom-roles'); this.customRolesFolderPath = join(this.importConfig.backupDir, this.customRolesConfig.dirName); this.customRolesUidMapperPath = join(this.customRolesMapperPath, 'uid-mapping.json'); @@ -119,7 +118,7 @@ export default class ImportCustomRoles extends BaseClass { async importCustomRoles() { if (this.customRoles === undefined || isEmpty(this.customRoles)) { log(this.importConfig, 'No custom-roles found', 'info'); - return resolve(); + return; } const apiContent = values(this.customRoles); @@ -155,7 +154,7 @@ export default class ImportCustomRoles extends BaseClass { entity: 'create-custom-role', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, @@ -198,11 +197,17 @@ export default class ImportCustomRoles extends BaseClass { getTransformUidsFactory = (rule: Record) => { if (rule.module === 'environment') { - rule.environments = map(rule.environments, (env: any) => this.environmentsUidMap[env]); + if(!isEmpty(this.environmentsUidMap)){ + rule.environments = map(rule.environments, (env: any) => this.environmentsUidMap[env]); + } } else if (rule.module === 'locale') { - rule.locales = map(rule.locales, (locale: any) => this.localesUidMap[locale]); + if(!isEmpty(this.localesUidMap)){ + rule.locales = map(rule.locales, (locale: any) => this.localesUidMap[locale]); + } } else if (rule.module === 'entry') { - rule.entries = map(rule.entries, (entry: any) => this.entriesUidMap[entry]); + if(!isEmpty(this.entriesUidMap)){ + rule.entries = map(rule.entries, (entry: any) => this.entriesUidMap[entry]); + } } return rule; }; diff --git a/packages/contentstack-import/src/import/modules/entries.ts b/packages/contentstack-import/src/import/modules/entries.ts index 580abe7df9..fa83c02d06 100644 --- a/packages/contentstack-import/src/import/modules/entries.ts +++ b/packages/contentstack-import/src/import/modules/entries.ts @@ -80,6 +80,7 @@ export default class EntriesImport extends BaseClass { this.jsonRteCTsWithRef = []; this.envs = {}; this.autoCreatedEntries = []; + this.failedEntries = []; } async start(): Promise { @@ -109,6 +110,17 @@ export default class EntriesImport extends BaseClass { await fileHelper.writeLargeFile(path.join(this.entriesMapperPath, 'uid-mapping.json'), this.entriesUidMapper); // TBD: manages mapper in one file, should find an alternative fsUtil.writeFile(path.join(this.entriesMapperPath, 'failed-entries.json'), this.failedEntries); + if (this.autoCreatedEntries.length > 0) { + log(this.importConfig, 'Removing entries from master language which got created by default', 'info'); + await this.removeAutoCreatedEntries().catch((error) => { + log( + this.importConfig, + `Error while removing auto created entries in master locale ${formatError(error)}`, + 'error', + ); + }); + } + // Update entries with references const entryUpdateRequestOptions = this.populateEntryUpdatePayload(); for (let entryUpdateRequestOption of entryUpdateRequestOptions) { @@ -128,16 +140,6 @@ export default class EntriesImport extends BaseClass { log(this.importConfig, `Error while updating content type references ${formatError(error)}`, 'error'); }); - if (this.autoCreatedEntries.length > 0) { - log(this.importConfig, 'Removing entries from master language which got created by default', 'info'); - await this.removeAutoCreatedEntries().catch((error) => { - log( - this.importConfig, - `Error while removing auto created entries in master locale ${formatError(error)}`, - 'error', - ); - }); - } // Update field rule of content types which are got removed earlier log(this.importConfig, 'Updating the field rules of content type', 'info'); await this.updateFieldRules().catch((error) => { @@ -209,14 +211,6 @@ export default class EntriesImport extends BaseClass { jsonRteEmbeddedEntries: false, }; suppressSchemaReference(contentType.schema, flag); - // Check if suppress modified flag - if (flag.suppressed) { - this.modifiedCTs.push(find(this.cTs, { uid: contentType.uid })); - } else { - // Note: Skips the content type from update if no reference found - apiOptions.additionalInfo = { skip: true }; - return apiOptions; - } if (flag.references) { this.refCTs.push(contentType.uid); @@ -231,6 +225,16 @@ export default class EntriesImport extends BaseClass { } } } + + // Check if suppress modified flag + if (flag.suppressed) { + this.modifiedCTs.push(find(this.cTs, { uid: contentType.uid })); + } else { + // Note: Skips the content type from update if no reference found + apiOptions.apiData = null; + return apiOptions; + } + lookupExtension( this.importConfig, contentType.schema, @@ -266,11 +270,11 @@ export default class EntriesImport extends BaseClass { if (indexerCount === 0) { return Promise.resolve(); } - log(this.importConfig, `Starting to create entries for ${cTUid} in locale ${locale}`, 'info'); + // log(this.importConfig, `Starting to create entries for ${cTUid} in locale ${locale}`, 'info'); const isMasterLocale = locale === this.importConfig?.master_locale?.code; // Write created entries const entriesCreateFileHelper = new FsUtility({ - moduleName: 'created-entries', + moduleName: 'entries', indexFileName: 'index.json', basePath: path.join(this.entriesMapperPath, cTUid, locale), chunkFileSize: this.entriesConfig.chunkFileSize, @@ -279,15 +283,28 @@ export default class EntriesImport extends BaseClass { }); const contentType = find(this.cTs, { uid: cTUid }); - const onSuccess = ({ response, apiData: entry, additionalInfo: { entryFileName } }: any) => { - log(this.importConfig, `Created entry: '${entry.title}' of content type ${cTUid} in locale ${locale}`, 'info'); - this.entriesUidMapper[entry.uid] = response.uid; - entry.sourceEntryFilePath = path.join(basePath, entryFileName); // stores source file path temporarily - entry.entryOldUid = entry.uid; // stores old uid temporarily - if (!isMasterLocale) { - this.autoCreatedEntries.push({ cTUid, locale, entryUid: response.uid }); + const onSuccess = ({ response, apiData: entry, additionalInfo }: any) => { + if (additionalInfo[entry.uid]?.isLocalized) { + let oldUid = additionalInfo[entry.uid].entryOldUid; + log(this.importConfig, `Localized entry: '${entry.title}' of content type ${cTUid} in locale ${locale}`, 'info'); + entry.uid = oldUid; + entry.entryOldUid = oldUid; + entry.sourceEntryFilePath = path.join(basePath, additionalInfo.entryFileName); // stores source file path temporarily + entriesCreateFileHelper.writeIntoFile({ [oldUid]: entry } as any, { mapKeyVal: true }); + } else { + log(this.importConfig, `Created entry: '${entry.title}' of content type ${cTUid} in locale ${locale}`, 'info'); + // This is for creating localized entries that do not have a counterpart in master locale. + // For example : To create entry1 in fr-fr, where en-us is the master locale + // entry1 will get created in en-us first, then fr-fr version will be created + // thus entry1 has to be removed from en-us at the end. + if (!isMasterLocale && !additionalInfo[entry.uid]?.isLocalized) { + this.autoCreatedEntries.push({ cTUid, locale, entryUid: response.uid }); + } + this.entriesUidMapper[entry.uid] = response.uid; + entry.sourceEntryFilePath = path.join(basePath, additionalInfo.entryFileName); // stores source file path temporarily + entry.entryOldUid = entry.uid; // stores old uid temporarily + entriesCreateFileHelper.writeIntoFile({ [entry.uid]: entry } as any, { mapKeyVal: true }); } - entriesCreateFileHelper.writeIntoFile({ [response.uid]: entry } as any, { mapKeyVal: true }); }; const onReject = ({ error, apiData: { uid, title } }: any) => { log(this.importConfig, `${title} entry of content type ${cTUid} in locale ${locale} failed to create`, 'error'); @@ -313,7 +330,7 @@ export default class EntriesImport extends BaseClass { entity: 'create-entries', includeParamOnCompletion: true, serializeData: this.serializeEntries.bind(this), - additionalInfo: { contentType, locale, cTUid, entryFileName: indexer[index] }, + additionalInfo: { contentType, locale, cTUid, entryFileName: indexer[index], isMasterLocale }, }, concurrencyLimit: this.importConcurrency, }).then(() => { @@ -332,29 +349,51 @@ export default class EntriesImport extends BaseClass { serializeEntries(apiOptions: ApiOptions): ApiOptions { let { apiData: entry, - additionalInfo: { cTUid, locale, contentType }, + additionalInfo: { cTUid, locale, contentType, isMasterLocale }, } = apiOptions; - if (this.jsonRteCTs.indexOf(cTUid) > -1) { - entry = removeUidsFromJsonRteFields(entry, contentType.schema); - } - // remove entry references from json-rte fields - if (this.jsonRteCTsWithRef.indexOf(cTUid) > -1) { - entry = removeEntryRefsFromJSONRTE(entry, contentType.schema); + try { + if (this.jsonRteCTs.indexOf(cTUid) > -1) { + entry = removeUidsFromJsonRteFields(entry, contentType.schema); + } + // remove entry references from json-rte fields + if (this.jsonRteCTsWithRef.indexOf(cTUid) > -1) { + entry = removeEntryRefsFromJSONRTE(entry, contentType.schema); + } + // will replace all old asset uid/urls with new ones + entry = lookupAssets( + { + content_type: contentType, + entry: entry, + }, + this.assetUidMapper, + this.assetUrlMapper, + path.join(this.entriesPath, cTUid), + this.installedExtensions, + ); + delete entry.publish_details; + // checking the entry is a localized one or not + if (!isMasterLocale && this.entriesUidMapper.hasOwnProperty(entry.uid)) { + const entryResponse = this.stack.contentType(contentType.uid).entry(this.entriesUidMapper[entry.uid]); + Object.assign(entryResponse, cloneDeep(entry), { uid: this.entriesUidMapper[entry.uid] }); + apiOptions.apiData = entryResponse; + apiOptions.additionalInfo[entryResponse.uid] = { + isLocalized: true, + entryOldUid: entry.uid + }; + return apiOptions; + } + apiOptions.apiData = entry; + } catch (error) { + log( + this.importConfig, + `${entry.title} entry of content type ${cTUid} in locale ${locale} failed to create`, + 'error', + ); + log(this.importConfig, formatError(error), 'error'); + this.failedEntries.push({ content_type: cTUid, locale, entry: { uid: entry.uid, title: entry.title } }); + apiOptions.apiData = null; } - // will replace all old asset uid/urls with new ones - entry = lookupAssets( - { - content_type: contentType, - entry: entry, - }, - this.assetUidMapper, - this.assetUrlMapper, - path.join(this.entriesPath, cTUid), - this.installedExtensions, - ); - delete entry.publish_details; - apiOptions.apiData = entry; return apiOptions; } @@ -381,7 +420,7 @@ export default class EntriesImport extends BaseClass { if (indexerCount === 0) { return Promise.resolve(); } - log(this.importConfig, `Starting to update entries with references for ${cTUid} in locale ${locale}`, 'info'); + // log(this.importConfig, `Starting to update entries with references for ${cTUid} in locale ${locale}`, 'info'); const contentType = find(this.cTs, { uid: cTUid }); @@ -391,7 +430,12 @@ export default class EntriesImport extends BaseClass { const onReject = ({ error, apiData: { uid, title } }: any) => { log(this.importConfig, `${title} entry of content type ${cTUid} in locale ${locale} failed to update`, 'error'); log(this.importConfig, formatError(error), 'error'); - this.failedEntries.push({ content_type: cTUid, locale, entry: { uid: this.entriesUidMapper[uid], title } }); + this.failedEntries.push({ + content_type: cTUid, + locale, + entry: { uid: this.entriesUidMapper[uid], title }, + entryId: uid, + }); }; for (const index in indexer) { @@ -432,33 +476,43 @@ export default class EntriesImport extends BaseClass { apiData: entry, additionalInfo: { cTUid, locale, contentType }, } = apiOptions; + try { + const sourceEntryFilePath = entry.sourceEntryFilePath; + const sourceEntry = ((fsUtil.readFile(sourceEntryFilePath) || {}) as Record)[entry.entryOldUid]; + const newUid = this.entriesUidMapper[entry.entryOldUid]; + // Removing temp values + delete entry.sourceEntryFilePath; + delete entry.entryOldUid; + if (this.jsonRteCTs.indexOf(cTUid) > -1) { + // the entries stored in eSuccessFilePath, have the same uids as the entries from source data + entry = restoreJsonRteEntryRefs(entry, sourceEntry, contentType.schema, { + mappedAssetUids: this.assetUidMapper, + mappedAssetUrls: this.assetUrlMapper, + }); + } - const sourceEntryFilePath = entry.sourceEntryFilePath; - const sourceEntry = ((fsUtil.readFile(sourceEntryFilePath) || {}) as Record)[entry.entryOldUid]; - // Removing temp values - delete entry.sourceEntryFilePath; - delete entry.entryOldUid; - if (this.jsonRteCTs.indexOf(cTUid) > -1) { - // the entries stored in eSuccessFilePath, have the same uids as the entries from source data - entry = restoreJsonRteEntryRefs(entry, sourceEntry, contentType.schema, { - mappedAssetUids: this.assetUidMapper, - mappedAssetUrls: this.assetUrlMapper, - }); - } - - entry = lookupEntries( - { - content_type: contentType, - entry, - }, - this.entriesUidMapper, - path.join(this.entriesMapperPath, cTUid, locale), - ); + entry = lookupEntries( + { + content_type: contentType, + entry, + }, + this.entriesUidMapper, + path.join(this.entriesMapperPath, cTUid, locale), + ); - const entryResponse = this.stack.contentType(contentType.uid).entry(this.entriesUidMapper[entry.uid]); - Object.assign(entryResponse, cloneDeep(entry)); - delete entryResponse.publish_details; - apiOptions.apiData = entryResponse; + const entryResponse = this.stack.contentType(contentType.uid).entry(newUid); + Object.assign(entryResponse, cloneDeep(entry), { uid: newUid }); + delete entryResponse.publish_details; + apiOptions.apiData = entryResponse; + } catch (error) { + log( + this.importConfig, + `${entry.title} entry of content type ${cTUid} in locale ${locale} failed to update`, + 'error', + ); + log(this.importConfig, formatError(error), 'error'); + apiOptions.apiData = null; + } return apiOptions; } @@ -525,6 +579,7 @@ export default class EntriesImport extends BaseClass { resolve: onSuccess.bind(this), entity: 'delete-entries', includeParamOnCompletion: true, + additionalInfo: { locale: this.importConfig?.master_locale?.code }, }, concurrencyLimit: this.importConcurrency, }); @@ -536,15 +591,18 @@ export default class EntriesImport extends BaseClass { return; } for (let cTUid of cTsWithFieldRules) { - const cTs: Record[] = fsUtil.readFile(path.join(this.cTsPath, 'schema.json')) as Record[]; + const cTs: Record[] = fsUtil.readFile(path.join(this.cTsPath, 'schema.json')) as Record< + string, + unknown + >[]; const contentType: any = find(cTs, { uid: cTUid }); if (contentType.field_rules) { - let fieldRuleLength = contentType.field_rules.length; - const fieldDatatypeMap: {[key: string]: string} = {}; + const fieldDatatypeMap: { [key: string]: string } = {}; for (let i = 0; i < contentType.schema.length; i++) { const field = contentType.schema[i].uid; fieldDatatypeMap[field] = contentType.schema[i].data_type; } + let fieldRuleLength = contentType.field_rules.length; for (let k = 0; k < fieldRuleLength; k++) { let fieldRuleConditionLength = contentType.field_rules[k].conditions.length; for (let i = 0; i < fieldRuleConditionLength; i++) { @@ -579,7 +637,7 @@ export default class EntriesImport extends BaseClass { }); log(this.importConfig, `Updated the field rules of ${cTUid}`, 'info'); } else { - log(this.importConfig, `No field rules found in content type ${cTUid} to update`, 'error'); + log(this.importConfig, `No field rules found in content type ${cTUid} to update`, 'info'); } } } @@ -596,9 +654,9 @@ export default class EntriesImport extends BaseClass { if (indexerCount === 0) { return Promise.resolve(); } - log(this.importConfig, `Starting publish entries for ${cTUid} in locale ${locale}`, 'info'); + // log(this.importConfig, `Starting publish entries for ${cTUid} in locale ${locale}`, 'info'); - const onSuccess = ({ response, apiData: { environments }, additionalInfo: { entryUid } }: any) => { + const onSuccess = ({ response, apiData: { environments, entryUid }, additionalInfo }: any) => { log( this.importConfig, `Published entry: '${entryUid}' of content type ${cTUid} and locale ${locale} in ${environments?.join( @@ -607,10 +665,10 @@ export default class EntriesImport extends BaseClass { 'info', ); }; - const onReject = ({ error, apiData, additionalInfo: { entryUid } }: any) => { + const onReject = ({ error, apiData, additionalInfo }: any) => { log( this.importConfig, - `${entryUid} entry of content type ${cTUid} in locale ${locale} failed to publish`, + `${apiData.entryUid} entry of content type ${cTUid} in locale ${locale} failed to publish`, 'error', ); log(this.importConfig, formatError(error), 'error'); @@ -651,13 +709,14 @@ export default class EntriesImport extends BaseClass { */ serializePublishEntries(apiOptions: ApiOptions): ApiOptions { let { apiData: entry, additionalInfo } = apiOptions; - additionalInfo.entryUid = this.entriesUidMapper[entry.uid]; const requestObject: { environments: Array; locales: Array; + entryUid: string; } = { environments: [], locales: [], + entryUid: this.entriesUidMapper[entry.uid], }; if (entry.publish_details && entry.publish_details.length > 0) { forEach(entry.publish_details, (pubObject) => { @@ -672,7 +731,8 @@ export default class EntriesImport extends BaseClass { } }); } else { - additionalInfo.skip = true; + apiOptions.apiData = null; + return apiOptions; } apiOptions.apiData = requestObject; return apiOptions; diff --git a/packages/contentstack-import/src/import/modules/environments.ts b/packages/contentstack-import/src/import/modules/environments.ts index a5c7ce4446..7bff9e57c6 100644 --- a/packages/contentstack-import/src/import/modules/environments.ts +++ b/packages/contentstack-import/src/import/modules/environments.ts @@ -1,8 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import values from 'lodash/values'; -import { join, resolve } from 'node:path'; +import { join } from 'node:path'; -import config from '../../config'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ModuleClassParams, EnvironmentConfig } from '../../types'; @@ -21,7 +20,7 @@ export default class ImportEnvironments extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.environmentsConfig = config.modules.environments; + this.environmentsConfig =importConfig.modules.environments; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'environments'); this.environmentsFolderPath = join(this.importConfig.backupDir, this.environmentsConfig.dirName); this.envUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -68,7 +67,7 @@ export default class ImportEnvironments extends BaseClass { async importEnvironments() { if (this.environments === undefined || isEmpty(this.environments)) { log(this.importConfig, 'No Environment Found', 'info'); - return resolve(); + return; } const apiContent = values(this.environments); @@ -103,7 +102,7 @@ export default class ImportEnvironments extends BaseClass { entity: 'create-environments', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 2, + concurrencyLimit: this.importConfig.fetchConcurrency || 2, }, undefined, false, diff --git a/packages/contentstack-import/src/import/modules/extensions.ts b/packages/contentstack-import/src/import/modules/extensions.ts index 6798d69b84..adaa33f477 100644 --- a/packages/contentstack-import/src/import/modules/extensions.ts +++ b/packages/contentstack-import/src/import/modules/extensions.ts @@ -1,8 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import values from 'lodash/values'; -import { join, resolve } from 'node:path'; +import { join } from 'node:path'; -import config from '../../config'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ModuleClassParams, Extensions } from '../../types'; @@ -21,7 +20,7 @@ export default class ImportExtensions extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.extensionsConfig = config.modules.extensions; + this.extensionsConfig = importConfig.modules.extensions; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'extensions'); this.extensionsFolderPath = join(this.importConfig.backupDir, this.extensionsConfig.dirName); this.extUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -68,7 +67,7 @@ export default class ImportExtensions extends BaseClass { async importExtensions(): Promise { if (this.extensions === undefined || isEmpty(this.extensions)) { log(this.importConfig, 'No Extensions Found', 'info'); - return resolve(); + return; } const apiContent = values(this.extensions); @@ -103,7 +102,7 @@ export default class ImportExtensions extends BaseClass { entity: 'create-extensions', includeParamOnCompletion: true, }, - concurrencyLimit: config.concurrency || config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.concurrency || this.importConfig.fetchConcurrency || 1, }, undefined, false, diff --git a/packages/contentstack-import/src/import/modules/global-fields.ts b/packages/contentstack-import/src/import/modules/global-fields.ts index c0fe880c30..958ada0c17 100644 --- a/packages/contentstack-import/src/import/modules/global-fields.ts +++ b/packages/contentstack-import/src/import/modules/global-fields.ts @@ -116,8 +116,9 @@ export default class ImportGlobalFields extends BaseClass { }) { return new Promise(async (resolve, reject) => { lookupExtension(this.config, globalField.schema, this.config.preserveStackVersion, this.installedExtensions); - const isReferenceFieldRemoved = await removeReferenceFields(globalField.schema, undefined, this.stackAPIClient); - if (isReferenceFieldRemoved) { + let flag = { supressed: false }; + await removeReferenceFields(globalField.schema, flag, this.stackAPIClient); + if (flag.supressed) { this.pendingGFs.push(globalField.uid); } return this.stack diff --git a/packages/contentstack-import/src/import/modules/labels.ts b/packages/contentstack-import/src/import/modules/labels.ts index 8db99db9ce..2ba0d5eddb 100644 --- a/packages/contentstack-import/src/import/modules/labels.ts +++ b/packages/contentstack-import/src/import/modules/labels.ts @@ -1,9 +1,8 @@ import isEmpty from 'lodash/isEmpty'; import values from 'lodash/values'; import omit from 'lodash/omit'; -import { join, resolve } from 'node:path'; +import { join } from 'node:path'; -import config from '../../config'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ModuleClassParams, LabelConfig } from '../../types'; @@ -22,7 +21,7 @@ export default class Importlabels extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.labelsConfig = config.modules.labels; + this.labelsConfig = importConfig.modules.labels; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'labels'); this.labelsFolderPath = join(this.importConfig.backupDir, this.labelsConfig.dirName); this.labelUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -73,7 +72,7 @@ export default class Importlabels extends BaseClass { async importlabels() { if (this.labels === undefined || isEmpty(this.labels)) { log(this.importConfig, 'No Label Found', 'info'); - return resolve(); + return; } const apiContent = values(this.labels); @@ -106,7 +105,7 @@ export default class Importlabels extends BaseClass { entity: 'create-labels', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, @@ -152,13 +151,13 @@ export default class Importlabels extends BaseClass { apiContent, processName: 'update labels', apiParams: { - serializeData: this.serializeUpdatelabels.bind(this), + serializeData: this.serializeUpdateLabels.bind(this), reject: onReject.bind(this), resolve: onSuccess.bind(this), entity: 'update-labels', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, @@ -171,7 +170,7 @@ export default class Importlabels extends BaseClass { * @param {ApiOptions} apiOptions ApiOptions * @returns {ApiOptions} ApiOptions */ - serializeUpdatelabels(apiOptions: ApiOptions): ApiOptions { + serializeUpdateLabels(apiOptions: ApiOptions): ApiOptions { const { apiData: label } = apiOptions; const labelUid = label.uid; if (this.labelUidMapper.hasOwnProperty(labelUid)) { diff --git a/packages/contentstack-import/src/import/modules/marketplace-apps.ts b/packages/contentstack-import/src/import/modules/marketplace-apps.ts index 0e9ad0cb43..63869e6cc7 100644 --- a/packages/contentstack-import/src/import/modules/marketplace-apps.ts +++ b/packages/contentstack-import/src/import/modules/marketplace-apps.ts @@ -20,7 +20,6 @@ import { ContentstackClient, } from '@contentstack/cli-utilities'; -import config from '../../config'; import BaseClass from './base-class'; import { askEncryptionKey } from '../../utils/interactive'; import { ModuleClassParams, MarketplaceAppsConfig } from '../../types'; @@ -56,11 +55,11 @@ export default class ImportMarketplaceApps extends BaseClass { public developerHubBaseUrl: string; public sdkClient: ContentstackClient; public nodeCrypto: NodeCrypto; - + public appSdkAxiosInstance: any constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.marketPlaceAppConfig = config.modules.marketplace_apps; + this.marketPlaceAppConfig = importConfig.modules.marketplace_apps; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'marketplace_apps'); this.marketPlaceFolderPath = join(this.importConfig.backupDir, this.marketPlaceAppConfig.dirName); this.marketPlaceUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -101,6 +100,9 @@ export default class ImportMarketplaceApps extends BaseClass { await fsUtil.makeDirectory(this.mapperDirPath); this.developerHubBaseUrl = this.importConfig.developerHubBaseUrl || (await getDeveloperHubUrl(this.importConfig)); this.sdkClient = await managementSDKClient({ endpoint: this.developerHubBaseUrl }); + this.appSdkAxiosInstance = await managementSDKClient({ + host: this.developerHubBaseUrl.split('://').pop() + }); this.importConfig.org_uid = await getOrgUid(this.importConfig); await this.setHttpClient(); await this.startInstallation(); @@ -404,15 +406,19 @@ export default class ImportMarketplaceApps extends BaseClass { // TODO migrate this HTTP API call into SDK // NOTE Use updateAppConfig(this.sdkClient, this.importConfig, app, payload) utility when migrating to SDK call; - return this.httpClient - .put(`${this.developerHubBaseUrl}/installations/${uid}`, payload) - .then(({ data }) => { - if (data.message) { + return this.appSdkAxiosInstance.axiosInstance + .put(`${this.developerHubBaseUrl}/installations/${uid}`, payload, { + headers: { + organization_uid: this.importConfig.org_uid, + }, + }) + .then(({data}:any) => { + if (data?.message) { log(this.importConfig, formatError(data.message), 'success'); } else { log(this.importConfig, `${app.manifest.name} app config updated successfully.!`, 'success'); } }) - .catch((error) => log(this.importConfig, formatError(error), 'error')); + .catch((error:any) => log(this.importConfig, formatError(error), 'error')); } } diff --git a/packages/contentstack-import/src/import/modules/webhooks.ts b/packages/contentstack-import/src/import/modules/webhooks.ts index 10f28c5894..35dc814d93 100644 --- a/packages/contentstack-import/src/import/modules/webhooks.ts +++ b/packages/contentstack-import/src/import/modules/webhooks.ts @@ -1,8 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import values from 'lodash/values'; -import { join, resolve } from 'node:path'; +import { join } from 'node:path'; -import config from '../../config'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import BaseClass, { ApiOptions } from './base-class'; import { ModuleClassParams, WebhookConfig } from '../../types'; @@ -21,7 +20,7 @@ export default class ImportWebhooks extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.webhooksConfig = config.modules.webhooks; + this.webhooksConfig = importConfig.modules.webhooks; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'webhooks'); this.webhooksFolderPath = join(this.importConfig.backupDir, this.webhooksConfig.dirName); this.webhookUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -70,7 +69,7 @@ export default class ImportWebhooks extends BaseClass { async importWebhooks() { if (this.webhooks === undefined || isEmpty(this.webhooks)) { log(this.importConfig, 'No Webhook Found', 'info'); - return resolve(); + return; } const apiContent = values(this.webhooks); @@ -104,7 +103,7 @@ export default class ImportWebhooks extends BaseClass { entity: 'create-webhooks', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, diff --git a/packages/contentstack-import/src/import/modules/workflows.ts b/packages/contentstack-import/src/import/modules/workflows.ts index d7ba380ea7..bd79fbfee9 100644 --- a/packages/contentstack-import/src/import/modules/workflows.ts +++ b/packages/contentstack-import/src/import/modules/workflows.ts @@ -8,7 +8,6 @@ import isEmpty from 'lodash/isEmpty'; import cloneDeep from 'lodash/cloneDeep'; import findIndex from 'lodash/findIndex'; -import config from '../../config'; import BaseClass, { ApiOptions } from './base-class'; import { log, formatError, fsUtil, fileHelper } from '../../utils'; import { ModuleClassParams, WorkflowConfig } from '../../types'; @@ -28,7 +27,7 @@ export default class ImportWorkflows extends BaseClass { constructor({ importConfig, stackAPIClient }: ModuleClassParams) { super({ importConfig, stackAPIClient }); - this.workflowsConfig = config.modules.workflows; + this.workflowsConfig = importConfig.modules.workflows; this.mapperDirPath = join(this.importConfig.backupDir, 'mapper', 'workflows'); this.workflowsFolderPath = join(this.importConfig.backupDir, this.workflowsConfig.dirName); this.workflowUidMapperPath = join(this.mapperDirPath, 'uid-mapping.json'); @@ -132,7 +131,8 @@ export default class ImportWorkflows extends BaseClass { const onReject = ({ error, apiData }: any) => { const err = error?.message ? JSON.parse(error.message) : error; const { name } = apiData; - if (err?.errors?.name) { + const workflowExists = err?.errors?.name || err?.errors?.['workflow.name']; + if (workflowExists) { log(this.importConfig, `Workflow '${name}' already exists`, 'info'); } else { this.failedWebhooks.push(apiData); @@ -159,7 +159,7 @@ export default class ImportWorkflows extends BaseClass { entity: 'create-workflows', includeParamOnCompletion: true, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, @@ -258,7 +258,7 @@ export default class ImportWorkflows extends BaseClass { includeParamOnCompletion: true, additionalInfo: { workflowUid: workflow.uid, stageIndex }, }, - concurrencyLimit: config.fetchConcurrency || 1, + concurrencyLimit: this.importConfig.fetchConcurrency || 1, }, undefined, false, diff --git a/packages/contentstack-import/src/types/default-config.ts b/packages/contentstack-import/src/types/default-config.ts index b833ed90fa..c41b949fdb 100644 --- a/packages/contentstack-import/src/types/default-config.ts +++ b/packages/contentstack-import/src/types/default-config.ts @@ -129,7 +129,6 @@ export default interface DefaultConfig { stacks: string; labels: string; }; - updatedModules: string[]; rateLimit: number; preserveStackVersion: boolean; entriesPublish: boolean; @@ -140,6 +139,5 @@ export default interface DefaultConfig { developerHubBaseUrl: string; marketplaceAppEncryptionKey: string; getEncryptionKeyMaxRetry: number; - useNewModuleStructure: boolean; createBackupDir?: string; } diff --git a/packages/contentstack-import/src/types/import-config.ts b/packages/contentstack-import/src/types/import-config.ts index d857551fac..1609d00df9 100644 --- a/packages/contentstack-import/src/types/import-config.ts +++ b/packages/contentstack-import/src/types/import-config.ts @@ -42,7 +42,8 @@ export default interface ImportConfig extends DefaultConfig, ExternalConfig { backupConcurrency?: number; authtoken?: string; destinationStackName?: string; - org_uid?:string; + org_uid?: string; + contentVersion: number; } type branch = { diff --git a/packages/contentstack-import/src/utils/backup-handler.ts b/packages/contentstack-import/src/utils/backup-handler.ts index bc87f1b5bf..c132a7abdc 100755 --- a/packages/contentstack-import/src/utils/backup-handler.ts +++ b/packages/contentstack-import/src/utils/backup-handler.ts @@ -1,8 +1,9 @@ import * as path from 'path'; -import ncp from 'ncp'; +import { copy } from 'fs-extra'; +import { cliux } from '@contentstack/cli-utilities'; -import { ImportConfig } from '../types'; import { fileHelper } from './index'; +import { ImportConfig } from '../types'; export default function setupBackupDir(importConfig: ImportConfig): Promise { return new Promise(async (resolve, reject) => { @@ -10,26 +11,34 @@ export default function setupBackupDir(importConfig: ImportConfig): Promise { - if (error) { - return reject(error); - } - return resolve(backupDirPath); - }); - } else { - ncp(importConfig.contentDir, backupDirPath, (error) => { + if (backupDirPath) { + cliux.print('Copying content to the backup directory...'); + return copy(importConfig.contentDir, backupDirPath, (error: any) => { if (error) { return reject(error); } @@ -38,3 +47,19 @@ export default function setupBackupDir(importConfig: ImportConfig): Promise, uidMapperPath: string) { +export const lookupEntries = function ( + data: { + content_type: any; + entry: any; + }, + mappedUids: Record, + uidMapperPath: string, +) { let parent: string[] = []; let uids: string[] = []; let unmapped: string[] = []; @@ -90,7 +97,7 @@ export const lookupEntries = function (data: any, mappedUids: Record, - ctSchema: Record[], + ctSchema: Record[] = [], ): Record => { for (const element of ctSchema) { switch (element.data_type) { @@ -341,7 +348,7 @@ function removeUidsFromChildren(children: Record[] | any) { } } -export const removeEntryRefsFromJSONRTE = (entry: Record, ctSchema: Record[]) => { +export const removeEntryRefsFromJSONRTE = (entry: Record, ctSchema: Record[] = []) => { for (const element of ctSchema) { switch (element.data_type) { case 'blocks': { @@ -380,8 +387,9 @@ export const removeEntryRefsFromJSONRTE = (entry: Record, ctSchema: let entryReferences = jsonRteData.children.filter((e: any) => doEntryReferencesExist(e)); if (entryReferences.length > 0) { jsonRteData.children = jsonRteData.children.filter((e: any) => !doEntryReferencesExist(e)); - if (jsonRteData.children.length === 0) { // empty children array are no longer acceptable by the API, a default structure must be there - jsonRteData.children.push(JSON.parse(structuredPTag)); + if (jsonRteData.children.length === 0) { + // empty children array are no longer acceptable by the API, a default structure must be there + jsonRteData.children.push(JSON.parse(structuredPTag)); } return jsonRteData; // return jsonRteData without entry references } else { @@ -393,7 +401,7 @@ export const removeEntryRefsFromJSONRTE = (entry: Record, ctSchema: if (entryReferences.length > 0) { entry[element.uid].children = entry[element.uid].children.filter((e: any) => !doEntryReferencesExist(e)); if (entry[element.uid].children.length === 0) { - entry[element.uid].children.push(JSON.parse(structuredPTag)); + entry[element.uid].children.push(JSON.parse(structuredPTag)); } } } @@ -436,7 +444,7 @@ function isEntryRef(element: any) { export const restoreJsonRteEntryRefs = ( entry: Record, sourceStackEntry: any, - ctSchema: any, + ctSchema: any = [], { mappedAssetUids, mappedAssetUrls }: any, ) => { // let mappedAssetUids = fileHelper.readFileSync(this.mappedAssetUidPath) || {}; @@ -445,7 +453,7 @@ export const restoreJsonRteEntryRefs = ( switch (element.data_type) { case 'blocks': { if (entry[element.uid]) { - if (element.multiple) { + if (element.multiple && Array.isArray(entry[element.uid])) { entry[element.uid] = entry[element.uid].map((e: any, eIndex: number) => { let key = Object.keys(e).pop(); let subBlock = element.blocks.filter((block: any) => block.uid === key).pop(); @@ -463,7 +471,7 @@ export const restoreJsonRteEntryRefs = ( case 'global_field': case 'group': { if (entry[element.uid]) { - if (element.multiple) { + if (element.multiple && Array.isArray(entry[element.uid])) { entry[element.uid] = entry[element.uid].map((e: any, eIndex: number) => { let sourceStackElement = sourceStackEntry[element.uid][eIndex]; e = restoreJsonRteEntryRefs(e, sourceStackElement, element.schema, { mappedAssetUids, mappedAssetUrls }); @@ -481,7 +489,7 @@ export const restoreJsonRteEntryRefs = ( } case 'json': { if (entry[element.uid] && element.field_metadata.rich_text_type) { - if (element.multiple) { + if (element.multiple && Array.isArray(entry[element.uid])) { entry[element.uid] = entry[element.uid].map((field: any, index: number) => { // i am facing a Maximum call stack exceeded issue, // probably because of this loop operation @@ -551,7 +559,7 @@ function setDirtyTrue(jsonRteChild: any) { delete jsonRteChild.uid; if (jsonRteChild.children && jsonRteChild.children.length > 0) { - jsonRteChild.children = jsonRteChild.children.map((subElement: any) => this.setDirtyTrue(subElement)); + jsonRteChild.children = jsonRteChild.children.map((subElement: any) => setDirtyTrue(subElement)); } } return jsonRteChild; diff --git a/packages/contentstack-import/src/utils/file-helper.ts b/packages/contentstack-import/src/utils/file-helper.ts index dd97ea0dc4..a8446e93cb 100644 --- a/packages/contentstack-import/src/utils/file-helper.ts +++ b/packages/contentstack-import/src/utils/file-helper.ts @@ -56,7 +56,7 @@ export const readLargeFile = function (filePath: string, opts?: any): Promise => { } config = merge.recursive(config, externalConfig); } + config.contentDir = importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()); config.contentDir = path.resolve(config.contentDir); //Note to support the old key config.data = config.contentDir; + if (fileExistsSync(path.join(config.contentDir, 'export-info.json'))) { + config.contentVersion = + ((await readFile(path.join(config.contentDir, 'export-info.json'))) || {}).contentVersion || 2; + } else { + config.contentVersion = 1; + } + const managementTokenAlias = importCmdFlags['management-token-alias'] || importCmdFlags['alias']; if (managementTokenAlias) { diff --git a/packages/contentstack-import/src/utils/logger.ts b/packages/contentstack-import/src/utils/logger.ts index 2b7ce63c3f..d6ca174a75 100644 --- a/packages/contentstack-import/src/utils/logger.ts +++ b/packages/contentstack-import/src/utils/logger.ts @@ -58,7 +58,7 @@ let errorTransport; function init(_logPath: string) { if (!logger || !errorLogger) { - var logsDir = path.resolve(_logPath, 'logs', 'export'); + var logsDir = path.resolve(_logPath, 'logs', 'import'); // Create dir if doesn't already exist mkdirp.sync(logsDir); diff --git a/packages/contentstack-import/src/utils/marketplace-app-helper.ts b/packages/contentstack-import/src/utils/marketplace-app-helper.ts index 5e14ddd69b..3f643472ca 100644 --- a/packages/contentstack-import/src/utils/marketplace-app-helper.ts +++ b/packages/contentstack-import/src/utils/marketplace-app-helper.ts @@ -16,10 +16,17 @@ export const getAllStackSpecificApps = async ( httpClient: HttpClient, config: ImportConfig, ) => { - return await httpClient - .get(`${developerHubBaseUrl}/installations?target_uids=${config.target_stack}`) - .then(({ data }) => data.data) - .catch((error) => log(config, `Failed to export marketplace-apps ${formatError(error)}`, 'error')); + const appSdkAxiosInstance = await managementSDKClient({ + host: developerHubBaseUrl.split('://').pop() + }); + return await appSdkAxiosInstance.axiosInstance + .get(`${developerHubBaseUrl}/installations?target_uids=${config.target_stack}`, { + headers: { + organization_uid: config.org_uid, + }, + }) + .then(( {data}:any) => data.data) + .catch((error:any) => log(config, `Failed to export marketplace-apps ${formatError(error)}`, 'error')); }; export const getDeveloperHubUrl = async (config: ImportConfig): Promise => { diff --git a/packages/contentstack-import/tsconfig.json b/packages/contentstack-import/tsconfig.json index 679afbeaf5..353cb22a4f 100644 --- a/packages/contentstack-import/tsconfig.json +++ b/packages/contentstack-import/tsconfig.json @@ -4,6 +4,7 @@ "declaration": true, "importHelpers": true, "module": "commonjs", + "rootDir": "src", "outDir": "lib", "strict": false, "target": "es2017", @@ -13,8 +14,8 @@ "esModuleInterop": true, "noImplicitAny": true, "lib": [ - "es2019", - "es2020.promise", + "ES2019", + "es2020.promise" ], "strictPropertyInitialization": false, "forceConsistentCasingInFileNames": true diff --git a/packages/contentstack-launch/README.md b/packages/contentstack-launch/README.md index 0a5dc078aa..de346bd1f4 100755 --- a/packages/contentstack-launch/README.md +++ b/packages/contentstack-launch/README.md @@ -5,26 +5,29 @@ With Launch CLI, you can interact with the Contentstack Launch platform using the terminal to create, manage and deploy Launch projects. -* [Launch CLI plugin](#launch-cli-plugin) -* [Usage](#usage) -* [Installation steps](#installation-steps) -* [Commands](#commands) + +- [Launch CLI plugin](#launch-cli-plugin) +- [Usage](#usage) +- [Installation steps](#installation-steps) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-launch $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli-launch/1.0.12 darwin-x64 node-v20.7.0 +@contentstack/cli-launch/1.0.12 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Installation steps diff --git a/packages/contentstack-launch/bin/dev b/packages/contentstack-launch/bin/dev index 794d701677..39382a0159 100755 --- a/packages/contentstack-launch/bin/dev +++ b/packages/contentstack-launch/bin/dev @@ -1,17 +1,6 @@ #!/usr/bin/env node -require("dotenv").config(); -const oclif = require('@oclif/core') -const path = require('path') -const project = path.join(__dirname, '..', 'tsconfig.json') - -// In dev mode -> use ts-node and dev plugins -process.env.NODE_ENV = 'development' - -require('ts-node').register({project }) - -// In dev mode, always show stack traces -oclif.settings.debug = true; - -// Start the CLI -oclif.run().then(oclif.flush).catch(oclif.Errors.handle) +(async () => { + const { execute } = require('@contentstack/cli-utilities'); + await execute({ type: 'cjs', dir: __dirname, development: true }); +})(); diff --git a/packages/contentstack-launch/package.json b/packages/contentstack-launch/package.json index 42b4cf93e3..7d32ba21ab 100755 --- a/packages/contentstack-launch/package.json +++ b/packages/contentstack-launch/package.json @@ -105,4 +105,4 @@ "launch:deployments": "LNCH-DPLMNT" } } -} +} \ No newline at end of file diff --git a/packages/contentstack-migrate-rte/README.md b/packages/contentstack-migrate-rte/README.md index 6123bc313f..fe5dd21c75 100644 --- a/packages/contentstack-migrate-rte/README.md +++ b/packages/contentstack-migrate-rte/README.md @@ -3,32 +3,36 @@ It is Contentstack’s CLI plugin to migrate rte. Using this command, you can copy existing value of HTML RTE into JSON RTE. -* [@contentstack/cli-cm-migrate-rte](#contentstackcli-cm-migrate-rte) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-cm-migrate-rte](#contentstackcli-cm-migrate-rte) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-cm-migrate-rte $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-migrate-rte/1.4.11 darwin-x64 node-v20.7.0 +@contentstack/cli-cm-migrate-rte/1.4.11 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:entries:migrate-html-rte`](#csdx-cmentriesmigrate-html-rte) -* [`csdx cm:migrate-rte`](#csdx-cmmigrate-rte) + +- [`csdx cm:entries:migrate-html-rte`](#csdx-cmentriesmigrate-html-rte) +- [`csdx cm:migrate-rte`](#csdx-cmmigrate-rte) ## `csdx cm:entries:migrate-html-rte` @@ -149,4 +153,5 @@ EXAMPLES $ csdx cm:entries:migrate-html-rte --alias alias --content-type global_field_uid --global-field --html-path html-path --json-path json-path ``` + diff --git a/packages/contentstack-migration/README.md b/packages/contentstack-migration/README.md index 366466c830..f878bac60b 100644 --- a/packages/contentstack-migration/README.md +++ b/packages/contentstack-migration/README.md @@ -8,32 +8,36 @@ The Contentstack CLI’s “Migration” plugin allows developers to automate th [![License](https://img.shields.io/npm/l/@contentstack/cli-migration.svg)](https://github.com/ninadhatkar/cli-migration/blob/master/package.json) -* [@contentstack/cli-migration](#contentstackcli-migration) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli-migration](#contentstackcli-migration) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli-migration $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-migration/1.3.13 darwin-x64 node-v20.7.0 +@contentstack/cli-migration/1.3.13 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple-1) + +- [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) +- [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple-1) ## `csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]` @@ -69,7 +73,7 @@ EXAMPLES $ csdx cm:migration --config-file --file-path - $ csdx cm:migration --multiple --file-path + $ csdx cm:migration --multiple --file-path $ csdx cm:migration --alias --file-path -k ``` @@ -108,12 +112,13 @@ EXAMPLES $ csdx cm:migration --config-file --file-path - $ csdx cm:migration --multiple --file-path + $ csdx cm:migration --multiple --file-path $ csdx cm:migration --alias --file-path -k ``` _See code: [src/commands/cm/stacks/migration.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-migration/src/commands/cm/stacks/migration.js)_ + ### Points to remember diff --git a/packages/contentstack-seed/bin/dev b/packages/contentstack-seed/bin/dev new file mode 100644 index 0000000000..39382a0159 --- /dev/null +++ b/packages/contentstack-seed/bin/dev @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +(async () => { + const { execute } = require('@contentstack/cli-utilities'); + await execute({ type: 'cjs', dir: __dirname, development: true }); +})(); diff --git a/packages/contentstack-seed/bin/dev.cmd b/packages/contentstack-seed/bin/dev.cmd new file mode 100644 index 0000000000..8ae2b12c19 --- /dev/null +++ b/packages/contentstack-seed/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* diff --git a/packages/contentstack-seed/package.json b/packages/contentstack-seed/package.json index 99bf2df45f..e30c9efcb0 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -1,11 +1,11 @@ { "name": "@contentstack/cli-cm-seed", "description": "create a Stack from existing content types, entries, assets, etc.", - "version": "1.4.16", + "version": "1.5.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-utilities": "~1.5.2", "axios": "1.3.4", diff --git a/packages/contentstack-utilities/package.json b/packages/contentstack-utilities/package.json index 495e5b5297..06bd988f4a 100644 --- a/packages/contentstack-utilities/package.json +++ b/packages/contentstack-utilities/package.json @@ -32,7 +32,7 @@ "author": "contentstack", "license": "MIT", "dependencies": { - "@contentstack/management": "~1.10.0", + "@contentstack/management": "~1.10.2", "@oclif/core": "^2.9.3", "axios": "1.3.4", "chalk": "^4.0.0", diff --git a/packages/contentstack-utilities/src/fs-utility/core.ts b/packages/contentstack-utilities/src/fs-utility/core.ts index 13d796d77d..dcfaea4ad8 100644 --- a/packages/contentstack-utilities/src/fs-utility/core.ts +++ b/packages/contentstack-utilities/src/fs-utility/core.ts @@ -285,8 +285,8 @@ export default class FsUtility { if (this.fileExt === 'json') { this.writableStream.write('}'); } - this.closeFile(closeIndexer); } + this.closeFile(closeIndexer); } /** diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index 383f8c7501..23ba588070 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -5,105 +5,109 @@ Use Contentstack Command-line Interface to command Contentstack for executing a [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) -* [@contentstack/cli](#contentstackcli) -* [Usage](#usage) -* [Commands](#commands) + +- [@contentstack/cli](#contentstackcli) +- [Usage](#usage) +- [Commands](#commands) # Usage + ```sh-session $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/1.8.5 darwin-x64 node-v20.7.0 +@contentstack/cli/1.9.0 darwin-arm64 node-v20.7.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND ... ``` + # Commands -* [`csdx auth:login`](#csdx-authlogin) -* [`csdx auth:logout`](#csdx-authlogout) -* [`csdx auth:tokens`](#csdx-authtokens) -* [`csdx auth:tokens:add [-a ] [--delivery] [--management] [-e ] [-k ] [-y] [--token ]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value) -* [`csdx auth:tokens:remove`](#csdx-authtokensremove) -* [`csdx auth:whoami`](#csdx-authwhoami) -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) -* [`csdx cm:bootstrap`](#csdx-cmbootstrap) -* [`csdx cm:branches`](#csdx-cmbranches) -* [`csdx cm:branches:create`](#csdx-cmbranchescreate) -* [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) -* [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value) -* [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) -* [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) -* [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value-1) -* [`csdx cm:bulk-publish:clear`](#csdx-cmbulk-publishclear) -* [`csdx cm:bulk-publish:configure`](#csdx-cmbulk-publishconfigure) -* [`csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries]`](#csdx-cmbulk-publishcross-publish--a-value---retry-failed-value---bulk-publish-value---content-type-value---locales-value---source-env-value---environments-value---delivery-token-value--c-value--y---branch-value---onlyassets---onlyentries) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) -* [`csdx cm:bulk-publish:revert`](#csdx-cmbulk-publishrevert) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) -* [`csdx cm:entries:migrate-html-rte`](#csdx-cmentriesmigrate-html-rte) -* [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value-1) -* [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) -* [`csdx cm:entries:unpublish`](#csdx-cmentriesunpublish) -* [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value-1) -* [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets) -* [`csdx cm:export-to-csv`](#csdx-cmexport-to-csv) -* [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) -* [`csdx cm:migrate-rte`](#csdx-cmmigrate-rte) -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) -* [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y ] [-s ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value) -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) -* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent-1) -* [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets-1) -* [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent-1) -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple-1) -* [`csdx cm:stacks:publish`](#csdx-cmstackspublish) -* [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) -* [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) -* [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) -* [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y ] [-s ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value-1) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries-1) -* [`csdx config:get:base-branch`](#csdx-configgetbase-branch) -* [`csdx config:get:region`](#csdx-configgetregion) -* [`csdx config:remove:base-branch`](#csdx-configremovebase-branch) -* [`csdx config:set:base-branch`](#csdx-configsetbase-branch) -* [`csdx config:set:region [REGION]`](#csdx-configsetregion-region) -* [`csdx help [COMMANDS]`](#csdx-help-commands) -* [`csdx launch`](#csdx-launch) -* [`csdx launch:deployments`](#csdx-launchdeployments) -* [`csdx launch:environments`](#csdx-launchenvironments) -* [`csdx launch:functions`](#csdx-launchfunctions) -* [`csdx launch:logs`](#csdx-launchlogs) -* [`csdx launch:open`](#csdx-launchopen) -* [`csdx login`](#csdx-login) -* [`csdx logout`](#csdx-logout) -* [`csdx plugins`](#csdx-plugins) -* [`csdx plugins:install PLUGIN...`](#csdx-pluginsinstall-plugin) -* [`csdx plugins:inspect PLUGIN...`](#csdx-pluginsinspect-plugin) -* [`csdx plugins:install PLUGIN...`](#csdx-pluginsinstall-plugin-1) -* [`csdx plugins:link PLUGIN`](#csdx-pluginslink-plugin) -* [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin) -* [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-1) -* [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-2) -* [`csdx plugins:update`](#csdx-pluginsupdate) -* [`csdx tokens`](#csdx-tokens) -* [`csdx whoami`](#csdx-whoami) + +- [`csdx auth:login`](#csdx-authlogin) +- [`csdx auth:logout`](#csdx-authlogout) +- [`csdx auth:tokens`](#csdx-authtokens) +- [`csdx auth:tokens:add [-a ] [--delivery] [--management] [-e ] [-k ] [-y] [--token ]`](#csdx-authtokensadd--a-value---delivery---management--e-value--k-value--y---token-value) +- [`csdx auth:tokens:remove`](#csdx-authtokensremove) +- [`csdx auth:whoami`](#csdx-authwhoami) +- [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value) +- [`csdx cm:assets:unpublish`](#csdx-cmassetsunpublish) +- [`csdx cm:bootstrap`](#csdx-cmbootstrap) +- [`csdx cm:branches`](#csdx-cmbranches) +- [`csdx cm:branches:create`](#csdx-cmbranchescreate) +- [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) +- [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value) +- [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) +- [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) +- [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value) +- [`csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmassetspublish--a-value---retry-failed-value--e-value---folder-uid-value---bulk-publish-value--c-value--y---locales-value---branch-value---delivery-token-value---source-env-value-1) +- [`csdx cm:bulk-publish:clear`](#csdx-cmbulk-publishclear) +- [`csdx cm:bulk-publish:configure`](#csdx-cmbulk-publishconfigure) +- [`csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries]`](#csdx-cmbulk-publishcross-publish--a-value---retry-failed-value---bulk-publish-value---content-type-value---locales-value---source-env-value---environments-value---delivery-token-value--c-value--y---branch-value---onlyassets---onlyentries) +- [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value) +- [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) +- [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value) +- [`csdx cm:bulk-publish:revert`](#csdx-cmbulk-publishrevert) +- [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) +- [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value) +- [`csdx cm:entries:migrate-html-rte`](#csdx-cmentriesmigrate-html-rte) +- [`csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ]`](#csdx-cmentriespublish--a-value---retry-failed-value---bulk-publish-value---publish-all-content-types---content-types-value---locales-value--e-value--c-value--y---branch-value---delivery-token-value---source-env-value-1) +- [`csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-modified--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-non-localized-fields--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]`](#csdx-cmentriespublish-only-unpublished--a-value---retry-failed-value---bulk-publish-value---source-env-value---content-types-value---locales-value--e-value--c-value--y---branch-value-1) +- [`csdx cm:entries:unpublish`](#csdx-cmentriesunpublish) +- [`csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]`](#csdx-cmentriesupdate-and-publish--a-value---retry-failed-value---bulk-publish-value---content-types-value--t-value--e-value--c-value--y---locales-value---branch-value-1) +- [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets) +- [`csdx cm:export-to-csv`](#csdx-cmexport-to-csv) +- [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) +- [`csdx cm:migrate-rte`](#csdx-cmmigrate-rte) +- [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) +- [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y ] [-s ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value) +- [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) +- [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent-1) +- [`csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets-1) +- [`csdx cm:stacks:import [-c ] [-k ] [-d ] [-a ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent-1) +- [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple-1) +- [`csdx cm:stacks:publish`](#csdx-cmstackspublish) +- [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) +- [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) +- [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) +- [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y ] [-s ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value-1) +- [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries-1) +- [`csdx config:get:base-branch`](#csdx-configgetbase-branch) +- [`csdx config:get:region`](#csdx-configgetregion) +- [`csdx config:remove:base-branch`](#csdx-configremovebase-branch) +- [`csdx config:set:base-branch`](#csdx-configsetbase-branch) +- [`csdx config:set:region [REGION]`](#csdx-configsetregion-region) +- [`csdx help [COMMANDS]`](#csdx-help-commands) +- [`csdx launch`](#csdx-launch) +- [`csdx launch:deployments`](#csdx-launchdeployments) +- [`csdx launch:environments`](#csdx-launchenvironments) +- [`csdx launch:functions`](#csdx-launchfunctions) +- [`csdx launch:logs`](#csdx-launchlogs) +- [`csdx launch:open`](#csdx-launchopen) +- [`csdx login`](#csdx-login) +- [`csdx logout`](#csdx-logout) +- [`csdx plugins`](#csdx-plugins) +- [`csdx plugins:install PLUGIN...`](#csdx-pluginsinstall-plugin) +- [`csdx plugins:inspect PLUGIN...`](#csdx-pluginsinspect-plugin) +- [`csdx plugins:install PLUGIN...`](#csdx-pluginsinstall-plugin-1) +- [`csdx plugins:link PLUGIN`](#csdx-pluginslink-plugin) +- [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin) +- [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-1) +- [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-2) +- [`csdx plugins:update`](#csdx-pluginsupdate) +- [`csdx tokens`](#csdx-tokens) +- [`csdx whoami`](#csdx-whoami) ## `csdx auth:login` @@ -2116,7 +2120,7 @@ EXAMPLES $ csdx cm:migration --config-file --file-path - $ csdx cm:migration --multiple --file-path + $ csdx cm:migration --multiple --file-path $ csdx cm:migration --alias --file-path -k ``` @@ -2381,7 +2385,7 @@ EXAMPLES $ csdx cm:migration --config-file --file-path - $ csdx cm:migration --multiple --file-path + $ csdx cm:migration --multiple --file-path $ csdx cm:migration --alias --file-path -k ``` @@ -3138,7 +3142,7 @@ ALIASES $ csdx plugins:add EXAMPLES - $ csdx plugins:install myplugin + $ csdx plugins:install myplugin $ csdx plugins:install https://github.com/someuser/someplugin @@ -3203,7 +3207,7 @@ ALIASES $ csdx plugins:add EXAMPLES - $ csdx plugins:install myplugin + $ csdx plugins:install myplugin $ csdx plugins:install https://github.com/someuser/someplugin @@ -3377,6 +3381,7 @@ ALIASES EXAMPLES $ csdx auth:whoami ``` + ``` diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index c54370f4b7..c4cd0eac61 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli", "description": "Command-line tool (CLI) to interact with Contentstack", - "version": "1.8.5", + "version": "1.9.0", "author": "Contentstack", "bin": { "csdx": "./bin/run" @@ -23,14 +23,14 @@ }, "dependencies": { "@contentstack/cli-auth": "~1.3.13", - "@contentstack/cli-cm-bootstrap": "~1.4.16", + "@contentstack/cli-cm-bootstrap": "~1.5.0", "@contentstack/cli-cm-bulk-publish": "~1.3.11", - "@contentstack/cli-cm-clone": "~1.4.17", - "@contentstack/cli-cm-export": "~1.8.2", - "@contentstack/cli-cm-import": "~1.8.4", + "@contentstack/cli-cm-clone": "~1.5.0", + "@contentstack/cli-cm-export": "~1.9.0", + "@contentstack/cli-cm-import": "~1.9.0", "@contentstack/cli-cm-export-to-csv": "~1.4.2", "@contentstack/cli-cm-migrate-rte": "~1.4.11", - "@contentstack/cli-cm-seed": "~1.4.16", + "@contentstack/cli-cm-seed": "~1.5.0", "@contentstack/cli-command": "~1.2.12", "@contentstack/cli-config": "~1.4.11", "@contentstack/cli-launch": "~1.0.12", @@ -158,4 +158,4 @@ } }, "repository": "https://github.com/contentstack/cli" -} +} \ No newline at end of file diff --git a/packages/contentstack/tsconfig.json b/packages/contentstack/tsconfig.json index 78c488cfd9..c12161b0f1 100644 --- a/packages/contentstack/tsconfig.json +++ b/packages/contentstack/tsconfig.json @@ -10,7 +10,11 @@ "allowJs": true, "sourceMap": false, "skipLibCheck": true, - "esModuleInterop": true + "esModuleInterop": true, + "lib": [ + "ES2019", + "es2020.promise" + ], }, "include": [ "src/**/*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9278de18f5..71c060cd31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,15 +11,15 @@ importers: packages/contentstack: specifiers: '@contentstack/cli-auth': ~1.3.13 - '@contentstack/cli-cm-bootstrap': ~1.4.16 + '@contentstack/cli-cm-bootstrap': ~1.5.0 '@contentstack/cli-cm-branches': ~1.0.13 '@contentstack/cli-cm-bulk-publish': ~1.3.11 - '@contentstack/cli-cm-clone': ~1.4.17 - '@contentstack/cli-cm-export': ~1.8.2 + '@contentstack/cli-cm-clone': ~1.5.0 + '@contentstack/cli-cm-export': ~1.9.0 '@contentstack/cli-cm-export-to-csv': ~1.4.2 - '@contentstack/cli-cm-import': ~1.8.4 + '@contentstack/cli-cm-import': ~1.9.0 '@contentstack/cli-cm-migrate-rte': ~1.4.11 - '@contentstack/cli-cm-seed': ~1.4.16 + '@contentstack/cli-cm-seed': ~1.5.0 '@contentstack/cli-command': ~1.2.12 '@contentstack/cli-config': ~1.4.11 '@contentstack/cli-launch': ~1.0.12 @@ -78,7 +78,7 @@ importers: '@contentstack/cli-launch': link:../contentstack-launch '@contentstack/cli-migration': link:../contentstack-migration '@contentstack/cli-utilities': link:../contentstack-utilities - '@contentstack/management': 1.10.0_debug@4.3.4 + '@contentstack/management': 1.10.2_debug@4.3.4 '@oclif/core': 2.9.4_4qcp7qp4jxxdgb4qbxgwox4hwq '@oclif/plugin-help': 5.2.14_4qcp7qp4jxxdgb4qbxgwox4hwq '@oclif/plugin-not-found': 2.4.0_4qcp7qp4jxxdgb4qbxgwox4hwq @@ -182,7 +182,7 @@ importers: packages/contentstack-bootstrap: specifiers: - '@contentstack/cli-cm-seed': ~1.4.16 + '@contentstack/cli-cm-seed': ~1.5.0 '@contentstack/cli-command': ~1.2.12 '@contentstack/cli-utilities': ~1.5.2 '@oclif/test': ^2.2.10 @@ -356,8 +356,8 @@ importers: packages/contentstack-clone: specifiers: '@colors/colors': ^1.5.0 - '@contentstack/cli-cm-export': ~1.8.2 - '@contentstack/cli-cm-import': ~1.8.4 + '@contentstack/cli-cm-export': ~1.9.0 + '@contentstack/cli-cm-import': ~1.9.0 '@contentstack/cli-command': ~1.2.12 '@contentstack/cli-utilities': ~1.5.2 '@oclif/test': ^1.2.7 @@ -541,6 +541,7 @@ importers: '@oclif/core': ^2.9.3 '@oclif/plugin-help': ^5.1.19 '@oclif/test': ^1.2.6 + '@types/big-json': ^3.2.0 '@types/mkdirp': ^1.0.2 '@types/progress-stream': ^2.0.2 assert: ^2.0.0 @@ -594,6 +595,7 @@ importers: '@contentstack/cli-dev-dependencies': link:../contentstack-dev-dependencies '@oclif/plugin-help': 5.2.14_typescript@4.9.5 '@oclif/test': 1.2.9 + '@types/big-json': 3.2.0 '@types/mkdirp': 1.0.2 '@types/progress-stream': 2.0.2 assert: 2.0.0 @@ -651,14 +653,15 @@ importers: specifiers: '@contentstack/cli-command': ~1.2.12 '@contentstack/cli-utilities': ~1.5.2 - '@contentstack/management': ~1.10.0 + '@contentstack/management': ~1.10.2 '@oclif/core': ^2.9.3 '@oclif/test': ^1.2.6 + '@types/big-json': ^3.2.0 '@types/bluebird': ^3.5.38 '@types/chai': ^4.2.18 + '@types/fs-extra': ^11.0.1 '@types/mkdirp': ^1.0.2 '@types/mocha': ^8.2.2 - '@types/ncp': ^2.0.5 '@types/node': ^14.14.32 '@types/sinon': ^10.0.2 '@types/tar': ^4.0.3 @@ -670,13 +673,13 @@ importers: debug: ^4.1.0 eslint: ^8.18.0 eslint-config-oclif: ^4.0.0 + fs-extra: ^11.1.1 globby: ^10.0.2 lodash: ^4.17.20 marked: ^4.0.17 merge: ^2.1.1 mkdirp: ^1.0.4 mocha: ^10.0.0 - ncp: ^2.0.0 nyc: ^15.1.0 oclif: ^3.8.1 promise-limit: ^2.7.0 @@ -690,27 +693,28 @@ importers: dependencies: '@contentstack/cli-command': link:../contentstack-command '@contentstack/cli-utilities': link:../contentstack-utilities - '@contentstack/management': 1.10.0_debug@4.3.4 + '@contentstack/management': 1.10.2_debug@4.3.4 '@oclif/core': 2.9.4_4qcp7qp4jxxdgb4qbxgwox4hwq big-json: 3.2.0 bluebird: 3.7.2 chalk: 4.1.2 debug: 4.3.4 + fs-extra: 11.1.1 lodash: 4.17.21 marked: 4.3.0 merge: 2.1.1 mkdirp: 1.0.4 - ncp: 2.0.0 promise-limit: 2.7.0 tslib: 2.6.0 winston: 3.10.0 devDependencies: '@oclif/test': 1.2.9 + '@types/big-json': 3.2.0 '@types/bluebird': 3.5.38 '@types/chai': 4.3.5 + '@types/fs-extra': 11.0.1 '@types/mkdirp': 1.0.2 '@types/mocha': 8.2.3 - '@types/ncp': 2.0.5 '@types/node': 14.18.53 '@types/sinon': 10.0.15 '@types/tar': 4.0.5 @@ -901,7 +905,7 @@ importers: packages/contentstack-seed: specifiers: - '@contentstack/cli-cm-import': ~1.8.4 + '@contentstack/cli-cm-import': ~1.9.0 '@contentstack/cli-command': ~1.2.12 '@contentstack/cli-utilities': ~1.5.2 '@oclif/plugin-help': ^5.1.19 @@ -956,7 +960,7 @@ importers: packages/contentstack-utilities: specifiers: - '@contentstack/management': ~1.10.0 + '@contentstack/management': ~1.10.2 '@oclif/core': ^2.9.3 '@oclif/test': ^2.2.10 '@types/chai': ^4.2.18 @@ -1000,7 +1004,7 @@ importers: winston: ^3.7.2 xdg-basedir: ^4.0.0 dependencies: - '@contentstack/management': 1.10.0_debug@4.3.4 + '@contentstack/management': 1.10.2_debug@4.3.4 '@oclif/core': 2.9.4_4qcp7qp4jxxdgb4qbxgwox4hwq axios: 1.3.4_debug@4.3.4 chalk: 4.1.2 @@ -1487,11 +1491,11 @@ packages: uuid: 8.3.2 dev: false - /@contentstack/management/1.10.0_debug@4.3.4: - resolution: {integrity: sha512-wnmVS19n3cZeh6T2PbBXGCr4irktunVmuECTyPF5++Rsc6GDO+FoQGCZdvzHpRZE0GLiPFIID50z2TZuNArEOg==} + /@contentstack/management/1.10.2_debug@4.3.4: + resolution: {integrity: sha512-jO24EqcCJhOjqdsqw8y3T0SPPAd0DG4BByjUcV0S28W2yoa8aBbcjcbZioRPzRLYKTmZWsAZissl18cIJm5djQ==} engines: {node: '>=8.0.0'} dependencies: - axios: 0.27.2_debug@4.3.4 + axios: 1.5.0_debug@4.3.4 form-data: 3.0.1 lodash: 4.17.21 qs: 6.11.2 @@ -3208,6 +3212,12 @@ packages: '@babel/types': 7.22.5 dev: true + /@types/big-json/3.2.0: + resolution: {integrity: sha512-2nV9P72HH6FAoxoJLIKxNGLSX6pM9nm1YiOfQQwr7Sy3oz2rF4RRsxmaB7T/tcESecAqM6f0CYjx6GqnrN5X2Q==} + dependencies: + '@types/node': 16.18.38 + dev: true + /@types/bluebird/3.5.38: resolution: {integrity: sha512-yR/Kxc0dd4FfwtEoLZMoqJbM/VE/W7hXn/MIjb+axcwag0iFmSPK7OBUZq1YWLynJUoWQkfUrI7T0HDqGApNSg==} dev: true @@ -3278,6 +3288,13 @@ packages: resolution: {integrity: sha512-3zsplnP2djeps5P9OyarTxwRpMLoe5Ash8aL9iprw0JxB+FAHjY+ifn4yZUuW4/9hqtnmor6uvjSRzJhiVbrEQ==} dev: true + /@types/fs-extra/11.0.1: + resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} + dependencies: + '@types/jsonfile': 6.1.1 + '@types/node': 16.18.38 + dev: true + /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: @@ -3337,6 +3354,12 @@ packages: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} dev: true + /@types/jsonfile/6.1.1: + resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} + dependencies: + '@types/node': 16.18.38 + dev: true + /@types/keyv/3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: @@ -3394,12 +3417,6 @@ packages: resolution: {integrity: sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==} dev: true - /@types/ncp/2.0.5: - resolution: {integrity: sha512-ocK0p8JuFmX7UkMabFPjY0F7apPvQyLWt5qtdvuvQEBz9i4m2dbzV+6L1zNaUp042RfnL6pHnxDE53OH6XQ9VQ==} - dependencies: - '@types/node': 16.18.38 - dev: true - /@types/node/14.18.53: resolution: {integrity: sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==} @@ -4242,27 +4259,28 @@ packages: xml2js: 0.5.0 dev: true - /axios/0.27.2_debug@4.3.4: - resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + /axios/1.3.4: + resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} dependencies: - follow-redirects: 1.15.2_debug@4.3.4 + follow-redirects: 1.15.2 form-data: 4.0.0 + proxy-from-env: 1.1.0 transitivePeerDependencies: - debug dev: false - /axios/1.3.4: + /axios/1.3.4_debug@4.3.4: resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} dependencies: - follow-redirects: 1.15.2 + follow-redirects: 1.15.2_debug@4.3.4 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug dev: false - /axios/1.3.4_debug@4.3.4: - resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} + /axios/1.5.0_debug@4.3.4: + resolution: {integrity: sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==} dependencies: follow-redirects: 1.15.2_debug@4.3.4 form-data: 4.0.0 @@ -6651,6 +6669,15 @@ packages: resolution: {integrity: sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==} dev: true + /fs-extra/11.1.1: + resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} + engines: {node: '>=14.14'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.0 + dev: false + /fs-extra/8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} @@ -9337,11 +9364,6 @@ packages: /natural-orderby/2.0.3: resolution: {integrity: sha512-p7KTHxU0CUrcOXe62Zfrb5Z13nLvPhSWR/so3kFulUQU0sgUll2Z0LwpsLN351eOOD+hRGu/F1g+6xDfPeD++Q==} - /ncp/2.0.0: - resolution: {integrity: sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==} - hasBin: true - dev: false - /negotiator/0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'}