diff --git a/package-lock.json b/package-lock.json index 6352aac57f..eba3009fcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2223,15 +2223,33 @@ } }, "node_modules/@oclif/test": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-1.2.9.tgz", - "integrity": "sha512-op+ak0NTyeBKqjLVH1jfPCRGWK5befIoQpCL/xwekjucUEmMfCbUpV1Sa60f9rU8X58HEqrclwWbAH+DtQR6FQ==", - "dev": true, + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", + "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", "dependencies": { - "fancy-test": "^1.4.10" + "@oclif/core": "^2.15.0", + "fancy-test": "^2.0.42" }, "engines": { - "node": ">=8.0.0" + "node": ">=12.0.0" + } + }, + "node_modules/@oclif/test/node_modules/fancy-test": { + "version": "2.0.42", + "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", + "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", + "dependencies": { + "@types/chai": "*", + "@types/lodash": "*", + "@types/node": "*", + "@types/sinon": "*", + "lodash": "^4.17.13", + "mock-stdin": "^1.0.0", + "nock": "^13.3.3", + "stdout-stderr": "^0.1.9" + }, + "engines": { + "node": ">=12.0.0" } }, "node_modules/@octokit/auth-token": { @@ -11696,9 +11714,9 @@ } }, "node_modules/jsdoc-api": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-7.2.0.tgz", - "integrity": "sha512-93YDnlm/OYTlLOFeNs4qAv0RBCJ0kGj67xQaWy8wrbk97Rw1EySitoOTHsTHXPEs3uyx2IStPKGrbE7LTnZXbA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-8.0.0.tgz", + "integrity": "sha512-Rnhor0suB1Ds1abjmFkFfKeD+kSMRN9oHMTMZoJVUrmtCGDwXty+sWMA9sa4xbe4UyxuPjhC7tavZ40mDKK6QQ==", "dev": true, "dependencies": { "array-back": "^6.2.2", @@ -11733,17 +11751,17 @@ } }, "node_modules/jsdoc-to-markdown": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-7.1.1.tgz", - "integrity": "sha512-CI86d63xAVNO+ENumWwmJ034lYe5iGU5GwjtTA11EuphP9tpnoi4hrKgR/J8uME0D+o4KUpVfwX1fjZhc8dEtg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.0.tgz", + "integrity": "sha512-2FQvYkg491+FP6s15eFlgSSWs69CvQrpbABGYBtvAvGWy/lWo8IKKToarT283w59rQFrpcjHl3YdhHCa3l7gXg==", "dev": true, "dependencies": { "array-back": "^6.2.2", "command-line-tool": "^0.8.0", "config-master": "^3.1.0", - "dmd": "^6.1.0", - "jsdoc-api": "^7.1.1", - "jsdoc-parse": "^6.1.0", + "dmd": "^6.2.0", + "jsdoc-api": "^8.0.0", + "jsdoc-parse": "^6.2.0", "walk-back": "^5.1.0" }, "bin": { @@ -23522,23 +23540,23 @@ }, "packages/contentstack": { "name": "@contentstack/cli", - "version": "1.13.1", + "version": "1.14.0", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.3.4", + "@contentstack/cli-audit": "~1.3.5", "@contentstack/cli-auth": "~1.3.17", - "@contentstack/cli-cm-bootstrap": "~1.7.1", + "@contentstack/cli-cm-bootstrap": "~1.8.0", "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", - "@contentstack/cli-cm-clone": "~1.9.0", - "@contentstack/cli-cm-export": "~1.10.4", + "@contentstack/cli-cm-clone": "~1.10.0", + "@contentstack/cli-cm-export": "~1.10.5", "@contentstack/cli-cm-export-to-csv": "~1.6.2", "@contentstack/cli-cm-import": "~1.13.3", "@contentstack/cli-cm-migrate-rte": "~1.4.15", "@contentstack/cli-cm-seed": "~1.7.1", "@contentstack/cli-command": "~1.2.17", - "@contentstack/cli-config": "~1.6.1", - "@contentstack/cli-launch": "~1.0.15", + "@contentstack/cli-config": "~1.6.2", + "@contentstack/cli-launch": "~1.0.16", "@contentstack/cli-migration": "~1.4.2", "@contentstack/cli-utilities": "~1.5.11", "@contentstack/management": "~1.13.0", @@ -23560,7 +23578,7 @@ "csdx": "bin/run" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", @@ -23590,7 +23608,7 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.3.4", + "version": "1.3.5", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -23609,7 +23627,7 @@ }, "devDependencies": { "@contentstack/cli-dev-dependencies": "^1.2.4", - "@oclif/test": "^2.0.3", + "@oclif/test": "^2.5.6", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", "@types/mocha": "^10.0.6", @@ -23633,58 +23651,6 @@ "node": ">=16" } }, - "packages/contentstack-audit/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "packages/contentstack-audit/node_modules/@oclif/test/node_modules/@oclif/core": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-2.15.0.tgz", - "integrity": "sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA==", - "dev": true, - "dependencies": { - "@types/cli-progress": "^3.11.0", - "ansi-escapes": "^4.3.2", - "ansi-styles": "^4.3.0", - "cardinal": "^2.1.1", - "chalk": "^4.1.2", - "clean-stack": "^3.0.1", - "cli-progress": "^3.12.0", - "debug": "^4.3.4", - "ejs": "^3.1.8", - "get-package-type": "^0.1.0", - "globby": "^11.1.0", - "hyperlinker": "^1.0.0", - "indent-string": "^4.0.0", - "is-wsl": "^2.2.0", - "js-yaml": "^3.14.1", - "natural-orderby": "^2.0.3", - "object-treeify": "^1.1.33", - "password-prompt": "^1.1.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "supports-color": "^8.1.1", - "supports-hyperlinks": "^2.2.0", - "ts-node": "^10.9.1", - "tslib": "^2.5.0", - "widest-line": "^3.1.0", - "wordwrap": "^1.0.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, "packages/contentstack-audit/node_modules/@sinonjs/fake-timers": { "version": "11.2.2", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", @@ -23726,25 +23692,6 @@ "wrap-ansi": "^7.0.0" } }, - "packages/contentstack-audit/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-audit/node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -23765,26 +23712,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "packages/contentstack-audit/node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "packages/contentstack-audit/node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -23956,7 +23883,7 @@ "devDependencies": { "@fancy-test/nock": "^0.1.1", "@oclif/plugin-help": "^5.1.19", - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", @@ -23982,47 +23909,15 @@ "node": ">=14.0.0" } }, - "packages/contentstack-auth/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-auth/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "dev": true }, - "packages/contentstack-auth/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-bootstrap": { "name": "@contentstack/cli-cm-bootstrap", - "version": "1.7.1", + "version": "1.8.0", "license": "MIT", "dependencies": { "@contentstack/cli-cm-seed": "~1.7.0", @@ -24033,7 +23928,7 @@ "tar": "^6.1.13" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", "@types/node": "^14.14.32", @@ -24055,19 +23950,6 @@ "node": ">=14.0.0" } }, - "packages/contentstack-bootstrap/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-bootstrap/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", @@ -24083,25 +23965,6 @@ "node": ">=0.3.1" } }, - "packages/contentstack-bootstrap/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-bootstrap/node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -24166,7 +24029,7 @@ "@contentstack/cli-config": "~1.6.1", "@contentstack/cli-dev-dependencies": "~1.2.4", "@oclif/plugin-help": "^5.1.19", - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "@types/flat": "^5.0.2", "assert": "^2.0.0", "chai": "^4.2.0", @@ -24203,7 +24066,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "chai": "^4.2.0", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", @@ -24225,7 +24088,7 @@ }, "packages/contentstack-clone": { "name": "@contentstack/cli-cm-clone", - "version": "1.9.0", + "version": "1.10.0", "license": "MIT", "dependencies": { "@colors/colors": "^1.5.0", @@ -24238,13 +24101,15 @@ "child_process": "^1.0.2", "fancy-test": "^1.4.10", "inquirer": "8.2.4", + "lodash": "^4.17.20", + "merge": "^2.1.1", "ora": "^5.1.0", "prompt": "^1.3.0", "rimraf": "^3.0.2", "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^1.2.7", + "@oclif/test": "^2.5.6", "chai": "^4.2.0", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", @@ -24282,7 +24147,7 @@ "contentstack": "^3.10.1" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.2", @@ -24303,19 +24168,6 @@ "node": ">=14.0.0" } }, - "packages/contentstack-command/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-command/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", @@ -24331,25 +24183,6 @@ "node": ">=0.3.1" } }, - "packages/contentstack-command/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-command/node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -24387,7 +24220,7 @@ }, "packages/contentstack-config": { "name": "@contentstack/cli-config", - "version": "1.6.1", + "version": "1.6.2", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -24400,7 +24233,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", @@ -24425,51 +24258,19 @@ "node": ">=14.0.0" } }, - "packages/contentstack-config/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-config/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "dev": true }, - "packages/contentstack-config/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-dev-dependencies": { "name": "@contentstack/cli-dev-dependencies", "version": "1.2.4", "license": "MIT", "dependencies": { "@oclif/core": "^2.9.3", - "@oclif/test": "^2.0.3", + "@oclif/test": "^2.5.6", "fancy-test": "^2.0.0", "lodash": "^4.17.21" }, @@ -24531,18 +24332,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "packages/contentstack-dev-dependencies/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-dev-dependencies/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", @@ -24736,7 +24525,7 @@ }, "packages/contentstack-export": { "name": "@contentstack/cli-cm-export", - "version": "1.10.4", + "version": "1.10.5", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -24798,7 +24587,7 @@ "mkdirp": "^3.0.1" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.3.6", "@types/mocha": "^10.0.1", "chai": "^4.3.8", @@ -24864,19 +24653,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "packages/contentstack-export-to-csv/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-export-to-csv/node_modules/@types/mocha": { "version": "10.0.6", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", @@ -25050,25 +24826,6 @@ "node": ">=4" } }, - "packages/contentstack-export-to-csv/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-export-to-csv/node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -25234,44 +24991,12 @@ "node": ">=10" } }, - "packages/contentstack-export/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "packages/contentstack-export/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", "version": "1.13.3", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "^1.3.3", + "@contentstack/cli-audit": "^1.3.5", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.5.11", "@contentstack/management": "~1.13.0", @@ -25291,7 +25016,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "@types/big-json": "^3.2.0", "@types/bluebird": "^3.5.38", "@types/chai": "^4.2.18", @@ -25398,7 +25123,7 @@ }, "packages/contentstack-launch": { "name": "@contentstack/cli-launch", - "version": "1.0.15", + "version": "1.0.16", "license": "MIT", "dependencies": { "@apollo/client": "^3.7.9", @@ -25426,7 +25151,7 @@ "launch": "bin/run" }, "devDependencies": { - "@oclif/test": "^2.3.6", + "@oclif/test": "^2.5.6", "@types/adm-zip": "^0.5.0", "@types/chai": "^4", "@types/esm": "^3.2.0", @@ -25496,19 +25221,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "packages/contentstack-launch/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-launch/node_modules/@types/node": { "version": "16.18.71", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.71.tgz", @@ -25656,25 +25368,6 @@ "node": ">=4" } }, - "packages/contentstack-launch/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-launch/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -25721,7 +25414,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "chai": "^4.3.4", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", @@ -25735,38 +25428,6 @@ "node": ">=14.0.0" } }, - "packages/contentstack-migrate-rte/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "packages/contentstack-migrate-rte/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-migrate-rte/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -25790,13 +25451,13 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "chai": "^4.3.4", "eslint": "^8.18.0", "globby": "^10.0.2", "husky": "^8.0.3", "jsdoc": "^4.0.0", - "jsdoc-to-markdown": "^7.0.1", + "jsdoc-to-markdown": "^8.0.0", "mkdirp": "^1.0.4", "nock": "^13.1.1", "nyc": "^15.1.0", @@ -25806,38 +25467,6 @@ "node": ">=8.3.0" } }, - "packages/contentstack-migration/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "packages/contentstack-migration/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-seed": { "name": "@contentstack/cli-cm-seed", "version": "1.7.1", @@ -25957,7 +25586,7 @@ }, "devDependencies": { "@contentstack/cli-dev-dependencies": "^1.2.4", - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", @@ -25982,19 +25611,6 @@ "typescript": "^4.9.3" } }, - "packages/contentstack-utilities/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack-utilities/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", @@ -26026,31 +25642,23 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "packages/contentstack/node_modules/@contentstack/cli-cm-clone/node_modules/@contentstack/cli-cm-import": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@contentstack/cli-cm-import/-/cli-cm-import-1.10.0.tgz", - "integrity": "sha512-Jn9grDE2J1c4iGBcPv24Q8lj/ozgfD9QNbJcn+1a6oGjA6OE+a39agQwi04nByBw4xRtbLUmHa4nfFRaF7qkvQ==", + "packages/contentstack/node_modules/@contentstack/cli-cm-clone/node_modules/fancy-test": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-1.4.10.tgz", + "integrity": "sha512-AaUX6wKS7D5OP2YK2q5G7c8PGx2lgoyLUD7Bbg8z323sb9aebBqzb9UN6phzI73UgO/ViihmNfOxF3kdfZLhew==", "extraneous": true, "dependencies": { - "@contentstack/cli-command": "~1.2.14", - "@contentstack/cli-utilities": "~1.5.4", - "@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", - "promise-limit": "^2.7.0", - "tslib": "^2.4.1", - "winston": "^3.7.2" + "@types/chai": "*", + "@types/lodash": "*", + "@types/node": "*", + "@types/sinon": "*", + "lodash": "^4.17.13", + "mock-stdin": "^1.0.0", + "nock": "^13.0.0", + "stdout-stderr": "^0.1.9" }, "engines": { - "node": ">=14.0.0" + "node": ">=8.0.0" } }, "packages/contentstack/node_modules/@contentstack/cli-cm-clone/node_modules/rimraf": { @@ -26095,43 +25703,11 @@ "node": ">=14.0.0" } }, - "packages/contentstack/node_modules/@oclif/test": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-2.5.6.tgz", - "integrity": "sha512-AcusFApdU6/akXaofhBDrY4IM9uYzlOD9bYCCM0NwUXOv1m6320hSp2DT/wkj9H1gsvKbJXZHqgtXsNGZTWLFg==", - "dev": true, - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "packages/contentstack/node_modules/@types/node": { "version": "14.18.63", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "dev": true - }, - "packages/contentstack/node_modules/fancy-test": { - "version": "2.0.42", - "resolved": "https://registry.npmjs.org/fancy-test/-/fancy-test-2.0.42.tgz", - "integrity": "sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==", - "dev": true, - "dependencies": { - "@types/chai": "*", - "@types/lodash": "*", - "@types/node": "*", - "@types/sinon": "*", - "lodash": "^4.17.13", - "mock-stdin": "^1.0.0", - "nock": "^13.3.3", - "stdout-stderr": "^0.1.9" - }, - "engines": { - "node": ">=12.0.0" - } } } } diff --git a/packages/contentstack-audit/README.md b/packages/contentstack-audit/README.md index 65dddb78a5..5af1961475 100644 --- a/packages/contentstack-audit/README.md +++ b/packages/contentstack-audit/README.md @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli-audit/1.3.4 darwin-arm64 node-v18.12.1 +@contentstack/cli-audit/1.3.5 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index d7134c1f19..45c759d203 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-audit", - "version": "1.3.4", + "version": "1.3.5", "description": "Contentstack audit plugin", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli", @@ -31,7 +31,7 @@ }, "devDependencies": { "@contentstack/cli-dev-dependencies": "^1.2.4", - "@oclif/test": "^2.0.3", + "@oclif/test": "^2.5.6", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", "@types/mocha": "^10.0.6", diff --git a/packages/contentstack-audit/src/audit-base-command.ts b/packages/contentstack-audit/src/audit-base-command.ts index aa6c15815c..2674927a53 100644 --- a/packages/contentstack-audit/src/audit-base-command.ts +++ b/packages/contentstack-audit/src/audit-base-command.ts @@ -164,7 +164,6 @@ export abstract class AuditBaseCommand extends BaseCommand { const repo = GitHubClient.parsePath('contentstack/contentstack-nextjs-react-universal-demo'); const gClient = new GitHubClient(repo); - expect(gClient.gitTarBallUrl).to.be.equal('https://api.github.com/repos/contentstack/contentstack-nextjs-react-universal-demo/tarball/master') + expect(gClient.gitTarBallUrl).to.be.equal('https://api.github.com/repos/contentstack/contentstack-nextjs-react-universal-demo/tarball/cli-use') }) it('Clone the source repo', async function () { diff --git a/packages/contentstack-bootstrap/test/utils.test.js b/packages/contentstack-bootstrap/test/utils.test.js index 708b55ff18..b2deb439fb 100644 --- a/packages/contentstack-bootstrap/test/utils.test.js +++ b/packages/contentstack-bootstrap/test/utils.test.js @@ -33,18 +33,69 @@ function getFileContent(_path) { describe('Utils', () => { describe('#setupEnvironments', () => { - it('Create env file for a stack', async () => { + it('Create env file for a stack with live preview enabled', async () => { const environments = { items: [{ name: 'production' }, { name: 'development' }] }; const token = 'mock-delivery-token'; const api_key = 'mock-api-key'; const appConfig = { appConfigKey: 'reactjs', }; + const livePreviewEnabled= true; const clonedDirectory = await getDirectory(); const region = { name: 'NA', - cda: 'https://app.contentstack.com', + cda: 'https://cdn.contentstack.com', + cma: 'https://api.contentstack.com', + uiHost: 'https://app.contentstack.com' + }; + const managementAPIClient = { + stack: () => { + return { + environment: () => { + return { + query: () => { + return { + find: () => Promise.resolve(environments), + }; + }, + }; + }, + deliveryToken: () => { + return { + create: () => Promise.resolve({ token, preview_token: "mock_preview_token" }), + }; + }, + }; + }, + }; + await setupEnvironments(managementAPIClient, api_key, appConfig,clonedDirectory, region,livePreviewEnabled); + const files = await getDirFiles(clonedDirectory); + expect(files).to.have.length(2); + let devEnvFile = await getFileContent(path.join(clonedDirectory, '.env.development.local')); + devEnvFile = devEnvFile.replace(/\n/g, ','); + expect(devEnvFile).equal( + 'REACT_APP_CONTENTSTACK_API_KEY=mock-api-key,REACT_APP_CONTENTSTACK_DELIVERY_TOKEN=mock-delivery-token,REACT_APP_CONTENTSTACK_PREVIEW_TOKEN=mock_preview_token,REACT_APP_CONTENTSTACK_PREVIEW_HOST=rest-preview.contentstack.com,REACT_APP_CONTENTSTACK_APP_HOST=app.contentstack.com,,REACT_APP_CONTENTSTACK_ENVIRONMENT=development,,SKIP_PREFLIGHT_CHECK=true,REACT_APP_CONTENTSTACK_LIVE_PREVIEW=true', + ); + let prodEnvFile = await getFileContent(path.join(clonedDirectory, '.env.production.local')); + prodEnvFile = prodEnvFile.replace(/\n/g, ','); + expect(prodEnvFile).equal( + 'REACT_APP_CONTENTSTACK_API_KEY=mock-api-key,REACT_APP_CONTENTSTACK_DELIVERY_TOKEN=mock-delivery-token,REACT_APP_CONTENTSTACK_PREVIEW_TOKEN=mock_preview_token,REACT_APP_CONTENTSTACK_PREVIEW_HOST=rest-preview.contentstack.com,REACT_APP_CONTENTSTACK_APP_HOST=app.contentstack.com,,REACT_APP_CONTENTSTACK_ENVIRONMENT=production,,SKIP_PREFLIGHT_CHECK=true,REACT_APP_CONTENTSTACK_LIVE_PREVIEW=true', + ); + }); + it('Create env file for a stack with live preview disabled', async () => { + const environments = { items: [{ name: 'production' }, { name: 'development' }] }; + const token = 'mock-delivery-token'; + const api_key = 'mock-api-key'; + const appConfig = { + appConfigKey: 'reactjs', + }; + const livePreviewEnabled= false; + const clonedDirectory = await getDirectory(); + const region = { + name: 'NA', + cda: 'https://cdn.contentstack.com', cma: 'https://app.contentstack.com', + uiHost: 'https://app.contentstack.com' }; const managementAPIClient = { stack: () => { @@ -66,19 +117,18 @@ describe('Utils', () => { }; }, }; - - await setupEnvironments(managementAPIClient, api_key, appConfig, clonedDirectory, region); + await setupEnvironments(managementAPIClient, api_key, appConfig,clonedDirectory, region,livePreviewEnabled); const files = await getDirFiles(clonedDirectory); expect(files).to.have.length(2); let devEnvFile = await getFileContent(path.join(clonedDirectory, '.env.development.local')); devEnvFile = devEnvFile.replace(/\n/g, ','); expect(devEnvFile).equal( - 'REACT_APP_APIKEY=mock-api-key,REACT_APP_DELIVERY_TOKEN=mock-delivery-token,REACT_APP_ENVIRONMENT=development,REACT_APP_REGION=NA', + 'REACT_APP_CONTENTSTACK_API_KEY=mock-api-key,REACT_APP_CONTENTSTACK_DELIVERY_TOKEN=mock-delivery-token,,REACT_APP_CONTENTSTACK_ENVIRONMENT=development,,SKIP_PREFLIGHT_CHECK=true,REACT_APP_CONTENTSTACK_LIVE_PREVIEW=false' ); let prodEnvFile = await getFileContent(path.join(clonedDirectory, '.env.production.local')); prodEnvFile = prodEnvFile.replace(/\n/g, ','); expect(prodEnvFile).equal( - 'REACT_APP_APIKEY=mock-api-key,REACT_APP_DELIVERY_TOKEN=mock-delivery-token,REACT_APP_ENVIRONMENT=production,REACT_APP_REGION=NA', + 'REACT_APP_CONTENTSTACK_API_KEY=mock-api-key,REACT_APP_CONTENTSTACK_DELIVERY_TOKEN=mock-delivery-token,,REACT_APP_CONTENTSTACK_ENVIRONMENT=production,,SKIP_PREFLIGHT_CHECK=true,REACT_APP_CONTENTSTACK_LIVE_PREVIEW=false' ); }); it('Create env with invalid environments, should throw an error', async () => { @@ -92,7 +142,7 @@ describe('Utils', () => { const region = { name: 'NA', cda: 'https://app.contentstack.com', - cma: 'https://app.contentstack.com', + cma: 'https://api.contentstack.com', }; const managementAPIClient = { stack: () => ({ diff --git a/packages/contentstack-branches/README.md b/packages/contentstack-branches/README.md index d0ae021d5d..74abddd444 100755 --- a/packages/contentstack-branches/README.md +++ b/packages/contentstack-branches/README.md @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-branches/1.0.21 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-branches/1.0.22 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 89e597fc93..87de095bab 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -29,7 +29,7 @@ "@contentstack/cli-config": "~1.6.1", "@contentstack/cli-dev-dependencies": "~1.2.4", "@oclif/plugin-help": "^5.1.19", - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "@types/flat": "^5.0.2", "assert": "^2.0.0", "chai": "^4.2.0", diff --git a/packages/contentstack-bulk-publish/README.md b/packages/contentstack-bulk-publish/README.md index d7f25b559d..2518496f86 100644 --- a/packages/contentstack-bulk-publish/README.md +++ b/packages/contentstack-bulk-publish/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-bulk-publish/1.4.0 darwin-arm64 node-v20.10.0 +@contentstack/cli-cm-bulk-publish/1.4.0 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-bulk-publish/package.json b/packages/contentstack-bulk-publish/package.json index b1ac44fad5..cf241ebbe6 100644 --- a/packages/contentstack-bulk-publish/package.json +++ b/packages/contentstack-bulk-publish/package.json @@ -17,7 +17,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "chai": "^4.2.0", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", diff --git a/packages/contentstack-clone/README.md b/packages/contentstack-clone/README.md index df030887f0..85de4211c1 100644 --- a/packages/contentstack-clone/README.md +++ b/packages/contentstack-clone/README.md @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-clone/1.9.0 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-clone/1.10.0 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -51,6 +51,7 @@ USAGE [--destination-stack-api-key ] [--import-webhook-status disable|current] FLAGS + -c, --config= Path for the external configuration -n, --stack-name= Name for the new stack to store the cloned content. -y, --yes [Optional] Override marketplace prompts --destination-management-token-alias= Source API key of the target stack token alias. @@ -101,6 +102,7 @@ USAGE [--destination-stack-api-key ] [--import-webhook-status disable|current] FLAGS + -c, --config= Path for the external configuration -n, --stack-name= Name for the new stack to store the cloned content. -y, --yes [Optional] Override marketplace prompts --destination-management-token-alias= Source API key of the target stack token alias. diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index ba05673879..de90d23501 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-clone", "description": "Contentstack stack clone plugin", - "version": "1.9.0", + "version": "1.10.0", "author": "Contentstack", "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { @@ -18,10 +18,12 @@ "ora": "^5.1.0", "prompt": "^1.3.0", "rimraf": "^3.0.2", - "winston": "^3.7.2" + "winston": "^3.7.2", + "merge": "^2.1.1", + "lodash": "^4.17.20" }, "devDependencies": { - "@oclif/test": "^1.2.7", + "@oclif/test": "^2.5.6", "chai": "^4.2.0", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", diff --git a/packages/contentstack-clone/src/commands/cm/stacks/clone.js b/packages/contentstack-clone/src/commands/cm/stacks/clone.js index 6f0e1d8766..9f2e0bb919 100644 --- a/packages/contentstack-clone/src/commands/cm/stacks/clone.js +++ b/packages/contentstack-clone/src/commands/cm/stacks/clone.js @@ -3,8 +3,9 @@ const { configHandler, flags, isAuthenticated, managementSDKClient } = require(' const { CloneHandler } = require('../../../lib/util/clone-handler'); const path = require('path'); const rimraf = require('rimraf'); +const merge = require("merge") let pathdir = path.join(__dirname.split('src')[0], 'contents'); -const { readdirSync } = require('fs'); +const { readdirSync, readFileSync } = require('fs'); let config = {}; class StackCloneCommand extends Command { @@ -23,11 +24,17 @@ class StackCloneCommand extends Command { 'source-management-token-alias': sourceManagementTokenAlias, 'destination-management-token-alias': destinationManagementTokenAlias, 'import-webhook-status': importWebhookStatus, + 'config': externalConfigPath } = cloneCommandFlags; const handleClone = async () => { const listOfTokens = configHandler.get('tokens'); + if (externalConfigPath) { + let externalConfig = readFileSync(externalConfigPath, 'utf-8') + externalConfig = JSON.parse(externalConfig); + config = merge.recursive(config, externalConfig); + } config.forceStopMarketplaceAppsPrompt = yes; config.skipAudit = cloneCommandFlags['skip-audit']; @@ -249,6 +256,11 @@ b) Structure with content (all modules including entries & assets) 'skip-audit': flags.boolean({ description: 'Skips the audit fix.', }), + 'config': flags.string({ + char: 'c', + required: false, + description: 'Path for the external configuration', + }), }; StackCloneCommand.usage = diff --git a/packages/contentstack-clone/src/lib/util/clone-handler.js b/packages/contentstack-clone/src/lib/util/clone-handler.js index e471e29b26..adb0a10ffc 100644 --- a/packages/contentstack-clone/src/lib/util/clone-handler.js +++ b/packages/contentstack-clone/src/lib/util/clone-handler.js @@ -8,6 +8,7 @@ let { default: importCmd } = require('@contentstack/cli-cm-import'); const { CustomAbortController } = require('./abort-controller'); const prompt = require('prompt'); const colors = require('@colors/colors/safe'); +const cloneDeep = require("lodash/cloneDeep") const { HandleOrgCommand, @@ -616,23 +617,29 @@ class CloneHandler { async cmdExport() { return new Promise((resolve, reject) => { - const cmd = ['-k', config.source_stack, '-d', __dirname.split('src')[0] + 'contents']; - if (config.cloneType === 'a') { - config.filteredModules = ['stack'].concat(structureList); - cmd.push('-c'); - cmd.push(path.join(__dirname, 'dummyConfig.json')); + // Creating export specific config by merging external configurations + let exportConfig = Object.assign({}, cloneDeep(config), {...config?.export}); + delete exportConfig.import; + delete exportConfig.export; + + const cmd = ['-k', exportConfig.source_stack, '-d', __dirname.split('src')[0] + 'contents']; + if (exportConfig.cloneType === 'a') { + exportConfig.filteredModules = ['stack'].concat(structureList); } - if (config.source_alias) { - cmd.push('-a', config.source_alias); + if (exportConfig.source_alias) { + cmd.push('-a', exportConfig.source_alias); } - if (config.sourceStackBranch) { - cmd.push('--branch', config.sourceStackBranch); + if (exportConfig.sourceStackBranch) { + cmd.push('--branch', exportConfig.sourceStackBranch); } - if (config.forceStopMarketplaceAppsPrompt) cmd.push('-y'); + if (exportConfig.forceStopMarketplaceAppsPrompt) cmd.push('-y'); - fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify(config)); + cmd.push('-c'); + cmd.push(path.join(__dirname, 'dummyConfig.json')); + + fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify(exportConfig)); let exportData = exportCmd.run(cmd); exportData.then(() => resolve(true)).catch(reject); }); @@ -640,27 +647,33 @@ class CloneHandler { async cmdImport() { return new Promise(async (resolve, _reject) => { + // Creating export specific config by merging external configurations + let importConfig = Object.assign({}, cloneDeep(config), {...config?.import}); + delete importConfig.import; + delete importConfig.export; + const cmd = ['-c', path.join(__dirname, 'dummyConfig.json')]; - if (config.destination_alias) { - cmd.push('-a', config.destination_alias); + if (importConfig.destination_alias) { + cmd.push('-a', importConfig.destination_alias); } - if (!config.data && config.sourceStackBranch) { - cmd.push('-d', path.join(config.pathDir, config.sourceStackBranch)); + if (!importConfig.data && importConfig.sourceStackBranch) { + cmd.push('-d', path.join(importConfig.pathDir, importConfig.sourceStackBranch)); } - if (config.targetStackBranch) { - cmd.push('--branch', config.targetStackBranch); + if (importConfig.targetStackBranch) { + cmd.push('--branch', importConfig.targetStackBranch); } - if (config.importWebhookStatus) { - cmd.push('--import-webhook-status', config.importWebhookStatus); + if (importConfig.importWebhookStatus) { + cmd.push('--import-webhook-status', importConfig.importWebhookStatus); } - if (config.skipAudit) cmd.push('--skip-audit'); + if (importConfig.skipAudit) cmd.push('--skip-audit'); - if (config.forceStopMarketplaceAppsPrompt) cmd.push('-y'); + if (importConfig.forceStopMarketplaceAppsPrompt) cmd.push('-y'); - fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify(config)); + fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify(importConfig)); await importCmd.run(cmd); + fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify({})) return resolve(); }); } diff --git a/packages/contentstack-command/package.json b/packages/contentstack-command/package.json index 43f3d5e54c..a63adfb739 100644 --- a/packages/contentstack-command/package.json +++ b/packages/contentstack-command/package.json @@ -21,7 +21,7 @@ "contentstack": "^3.10.1" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.2", diff --git a/packages/contentstack-config/README.md b/packages/contentstack-config/README.md index bf4b65c8d6..8f354746ed 100644 --- a/packages/contentstack-config/README.md +++ b/packages/contentstack-config/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-config/1.5.1 darwin-arm64 node-v20.8.0 +@contentstack/cli-config/1.6.2 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index 2af9a9967d..c1f5c26894 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-config", "description": "Contentstack CLI plugin for configuration", - "version": "1.6.1", + "version": "1.6.2", "author": "Contentstack", "scripts": { "build": "npm run clean && npm run compile", @@ -31,7 +31,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", diff --git a/packages/contentstack-config/src/commands/config/set/region.ts b/packages/contentstack-config/src/commands/config/set/region.ts index 30151477d4..5a1e75aa51 100644 --- a/packages/contentstack-config/src/commands/config/set/region.ts +++ b/packages/contentstack-config/src/commands/config/set/region.ts @@ -46,6 +46,7 @@ export default class RegionSetCommand extends BaseCommand --cda --ui-host --name "India"', ]; diff --git a/packages/contentstack-config/test/unit/commands/base-branch.test.ts b/packages/contentstack-config/test/unit/commands/base-branch.test.ts index 638784ee2c..dd5cdc0a5c 100644 --- a/packages/contentstack-config/test/unit/commands/base-branch.test.ts +++ b/packages/contentstack-config/test/unit/commands/base-branch.test.ts @@ -51,5 +51,6 @@ describe('base-branch command', function () { const branchStub = stub(cliux, 'table').callsFake(() => {}); await BranchGetCommand.run([]); expect(branchStub.calledOnce).to.be.true; + branchStub.restore(); }); }); diff --git a/packages/contentstack-config/test/unit/commands/early-access-header.test.ts b/packages/contentstack-config/test/unit/commands/early-access-header.test.ts new file mode 100644 index 0000000000..c7d04c3b75 --- /dev/null +++ b/packages/contentstack-config/test/unit/commands/early-access-header.test.ts @@ -0,0 +1,99 @@ +import { expect, should } from 'chai'; +import { stub, spy } from 'sinon'; +import { configHandler } from '@contentstack/cli-utilities'; +import { cliux } from '@contentstack/cli-utilities'; +import Conf from 'conf'; +import { setEarlyAccessHeaderMockData } from '../mock/index'; +import { interactive } from '../../../src/utils/index'; + +import GetEarlyAccessHeaderCommand from '../../../src/commands/config/get/early-access-header'; +import SetEarlyAccessHeaderCommand from '../../../src/commands/config/set/early-access-header'; +import RemoveEarlyAccessHeaderCommand from '../../../src/commands/config/remove/early-access-header'; + + +const config = configHandler; +describe('Early access header command', function () { + let configSetStub; + let cliuxSuccessStub; + let configHandlerDeleteStub; + before(() => { + configSetStub = stub(configHandler, 'set').returns({} as Conf>); + cliuxSuccessStub = stub(cliux, 'success').callsFake(()=> {}); + configHandlerDeleteStub = stub(configHandler, 'delete').resolves(""); + }); + + after(() => { + // Restore the original method after each test + configSetStub.restore(); + cliuxSuccessStub.restore(); + configHandlerDeleteStub.restore(); + }); + + it('Set early access header: with all flags, should be successful', async function () { + const args = [ + '--header-alias', + setEarlyAccessHeaderMockData.flags.headerAlias, + '--header', + setEarlyAccessHeaderMockData.flags.header, + ]; + await SetEarlyAccessHeaderCommand.run(args); + expect(cliuxSuccessStub.calledOnce).to.be.true; + }); + + it('Set early access header: should prompt when header alias is not passed', async () => { + const askEarlyAccessHeaderAlias = stub(interactive, 'askEarlyAccessHeaderAlias').resolves(setEarlyAccessHeaderMockData.flags.headerAlias); + await SetEarlyAccessHeaderCommand.run(["--header", setEarlyAccessHeaderMockData.flags.header]); + expect(askEarlyAccessHeaderAlias.calledOnce).to.be.true; + askEarlyAccessHeaderAlias.restore(); + }); + + it('Set early access header: should prompt when header is not passed', async () => { + const askEarlyAccessHeaderAlias = stub(interactive, 'askEarlyAccessHeaderValue').resolves(setEarlyAccessHeaderMockData.flags.header); + await SetEarlyAccessHeaderCommand.run(["--header-alias", setEarlyAccessHeaderMockData.flags.headerAlias]); + expect(askEarlyAccessHeaderAlias.calledOnce).to.be.true; + askEarlyAccessHeaderAlias.restore(); + }); + + it('Get early access header: with all flags, should be successful', async function () { + const cliuxTableStub = stub(cliux, 'table'); + await GetEarlyAccessHeaderCommand.run([]); + expect(cliuxTableStub.calledOnce).to.be.true; + cliuxTableStub.restore(); + }); + + it('Remove early access header: with all flags, should be successful', async function () { + const configGetStub = stub(configHandler, 'get').resolves(setEarlyAccessHeaderMockData.flags.headerAlias); + const args = [ + '--header-alias', + setEarlyAccessHeaderMockData.flags.headerAlias, + '--yes' + ]; + await RemoveEarlyAccessHeaderCommand.run(args); + expect(configHandlerDeleteStub.calledOnce).to.be.true; + configGetStub.restore(); + }); + + it('Remove early access header: with only alias flag should prompt for confirmation', async function () { + const configGetStub = stub(configHandler, 'get').resolves(setEarlyAccessHeaderMockData.flags.headerAlias); + const confirmationStub = stub(interactive, 'askConfirmation').resolves(true); + const args = [ + '--header-alias', + setEarlyAccessHeaderMockData.flags.headerAlias, + ]; + await RemoveEarlyAccessHeaderCommand.run(args); + expect(confirmationStub.calledOnce).to.be.true; + configGetStub.restore(); + confirmationStub.restore() + }); + + it('Remove early access header: without alias flag should prompt', async function () { + const configGetStub = stub(configHandler, 'get').resolves(setEarlyAccessHeaderMockData.flags.headerAlias); + const askHeaderAliasStub = stub(interactive, 'askEarlyAccessHeaderAlias').resolves(setEarlyAccessHeaderMockData.flags.headerAlias); + const args = [ + "--yes" + ]; + await RemoveEarlyAccessHeaderCommand.run(args); + expect(askHeaderAliasStub.calledOnce).to.be.true; + configGetStub.restore(); + }); +}); diff --git a/packages/contentstack-config/test/unit/commands/region.test.ts b/packages/contentstack-config/test/unit/commands/region.test.ts index 6713255ed3..410a0cd263 100644 --- a/packages/contentstack-config/test/unit/commands/region.test.ts +++ b/packages/contentstack-config/test/unit/commands/region.test.ts @@ -12,6 +12,7 @@ describe('Region command', function () { name: 'test', cma: 'https://api.contentstack.com', cda: 'https://cda.contentstack.com', + uiHost: '', }; let cliuxPrintStub; beforeEach(function () { diff --git a/packages/contentstack-config/test/unit/commands/remove-base-branch.test.ts b/packages/contentstack-config/test/unit/commands/remove-base-branch.test.ts index 87fddd4d5c..13653d3dd9 100644 --- a/packages/contentstack-config/test/unit/commands/remove-base-branch.test.ts +++ b/packages/contentstack-config/test/unit/commands/remove-base-branch.test.ts @@ -41,9 +41,10 @@ describe('Delete config', () => { const config = configHandler; const getConfig = config.get(`baseBranch.${removeConfigMockData.flags.apiKey}`); - const askConfirmation = stub(interactive, 'askConfirmation').calledOnce; + const askConfirmation = stub(interactive, 'askConfirmation'); const showSuccess = stub(cliux, 'success'); await RemoveBranchConfigCommand.run(['--stack-api-key', removeConfigMockData.flags.apiKey]); - if (getConfig && askConfirmation) expect(showSuccess.calledOnce).to.be.true; + if (getConfig && askConfirmation.calledOnce) expect(showSuccess.calledOnce).to.be.true; + askConfirmation.restore(); }); }); diff --git a/packages/contentstack-config/test/unit/mock/index.ts b/packages/contentstack-config/test/unit/mock/index.ts index b49cbfd01c..fe9eb7eba4 100644 --- a/packages/contentstack-config/test/unit/mock/index.ts +++ b/packages/contentstack-config/test/unit/mock/index.ts @@ -5,6 +5,13 @@ export const setConfigMockData = { }, }; +export const setEarlyAccessHeaderMockData = { + flags: { + headerAlias: 'taxonomy', + header: 'taxonomytestorg', + }, +}; + export const removeConfigMockData = { flags: { apiKey: 'abcd', diff --git a/packages/contentstack-dev-dependencies/package.json b/packages/contentstack-dev-dependencies/package.json index 4b302c79e1..5495562bcc 100644 --- a/packages/contentstack-dev-dependencies/package.json +++ b/packages/contentstack-dev-dependencies/package.json @@ -24,7 +24,7 @@ "@oclif/core": "^2.9.3", "lodash": "^4.17.21", "fancy-test": "^2.0.0", - "@oclif/test":"^2.0.3" + "@oclif/test": "^2.5.6" }, "devDependencies": { "@types/node": "^14.14.32", diff --git a/packages/contentstack-export-to-csv/package.json b/packages/contentstack-export-to-csv/package.json index b36bd90a42..c9c6430837 100644 --- a/packages/contentstack-export-to-csv/package.json +++ b/packages/contentstack-export-to-csv/package.json @@ -14,7 +14,7 @@ "mkdirp": "^3.0.1" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.3.6", "@types/mocha": "^10.0.1", "chai": "^4.3.8", diff --git a/packages/contentstack-export/README.md b/packages/contentstack-export/README.md index 8642692eee..ae1378c585 100755 --- a/packages/contentstack-export/README.md +++ b/packages/contentstack-export/README.md @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-export/1.10.3 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-export/1.10.5 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-export/package.json b/packages/contentstack-export/package.json index 2b54eea5f8..a2bde1bc8a 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.10.4", + "version": "1.10.5", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack-export/src/commands/cm/stacks/export.ts b/packages/contentstack-export/src/commands/cm/stacks/export.ts index eb6e3a51d9..805a420f16 100644 --- a/packages/contentstack-export/src/commands/cm/stacks/export.ts +++ b/packages/contentstack-export/src/commands/cm/stacks/export.ts @@ -71,14 +71,12 @@ export default class ExportCommand extends Command { module: flags.string({ char: 'm', description: '[optional] specific module name', - exclusive: ['content-types'], parse: printFlagDeprecation(['-m'], ['--module']), }), 'content-types': flags.string({ char: 't', description: '[optional] content type', multiple: true, - exclusive: ['module'], parse: printFlagDeprecation(['-t'], ['--content-types']), }), branch: flags.string({ diff --git a/packages/contentstack-export/src/export/modules-js/content-types.js b/packages/contentstack-export/src/export/modules-js/content-types.js index 72affabb9f..058525a5bf 100644 --- a/packages/contentstack-export/src/export/modules-js/content-types.js +++ b/packages/contentstack-export/src/export/modules-js/content-types.js @@ -14,7 +14,7 @@ class ContentTypesExport { include_global_field_schema: true, }; // If content type id is provided then use it as part of query - if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.length > 0) { + if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.contentTypes.length > 0) { this.qs.uid = { $in: this.exportConfig.contentTypes }; } this.contentTypesPath = path.resolve( diff --git a/packages/contentstack-export/src/export/modules/content-types.ts b/packages/contentstack-export/src/export/modules/content-types.ts index 7b2ba3fbf9..54ccdbd8c1 100644 --- a/packages/contentstack-export/src/export/modules/content-types.ts +++ b/packages/contentstack-export/src/export/modules/content-types.ts @@ -13,6 +13,7 @@ export default class ContentTypesExport extends BaseClass { skip?: number; limit?: number; include_global_field_schema: boolean; + uid?: Record }; private contentTypesConfig: { dirName?: string; @@ -35,6 +36,12 @@ export default class ContentTypesExport extends BaseClass { limit: this.contentTypesConfig.limit, include_global_field_schema: true, }; + + // If content type id is provided then use it as part of query + if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.contentTypes.length > 0) { + this.qs.uid = { $in: this.exportConfig.contentTypes }; + } + this.contentTypesDirPath = path.resolve( exportConfig.data, exportConfig.branchName || '', diff --git a/packages/contentstack-import/README.md b/packages/contentstack-import/README.md index 668ba8bb24..ca6fe2c3ff 100644 --- a/packages/contentstack-import/README.md +++ b/packages/contentstack-import/README.md @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-import/1.13.0 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-import/1.13.3 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 517df7977f..dc5c4aa3cb 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -5,7 +5,7 @@ "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-audit": "^1.3.3", + "@contentstack/cli-audit": "^1.3.5", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.5.11", "@contentstack/management": "~1.13.0", @@ -25,7 +25,7 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^1.2.6", + "@oclif/test": "^2.5.6", "@types/big-json": "^3.2.0", "@types/bluebird": "^3.5.38", "@types/chai": "^4.2.18", diff --git a/packages/contentstack-launch/README.md b/packages/contentstack-launch/README.md index 3b86d121f0..dbef306de9 100755 --- a/packages/contentstack-launch/README.md +++ b/packages/contentstack-launch/README.md @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-launch $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli-launch/1.0.15 darwin-arm64 node-v20.8.0 +@contentstack/cli-launch/1.0.16 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-launch/package.json b/packages/contentstack-launch/package.json index de9507fa4d..f2f7e35f20 100755 --- a/packages/contentstack-launch/package.json +++ b/packages/contentstack-launch/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-launch", - "version": "1.0.15", + "version": "1.0.16", "description": "Launch related operations", "author": "Contentstack CLI", "bin": { @@ -39,7 +39,7 @@ "winston": "^3.8.2" }, "devDependencies": { - "@oclif/test": "^2.3.6", + "@oclif/test": "^2.5.6", "@types/adm-zip": "^0.5.0", "@types/chai": "^4", "@types/esm": "^3.2.0", diff --git a/packages/contentstack-launch/src/adapters/github.ts b/packages/contentstack-launch/src/adapters/github.ts index d140932e2f..e6b049cf34 100755 --- a/packages/contentstack-launch/src/adapters/github.ts +++ b/packages/contentstack-launch/src/adapters/github.ts @@ -60,7 +60,6 @@ export default class GitHub extends BaseClass { async createNewProject(): Promise { const { branch, - provider, framework, repository, projectName, @@ -68,8 +67,9 @@ export default class GitHub extends BaseClass { selectedStack, outputDirectory, environmentName, + provider: gitProvider, } = this.config; - const username = split(repository?.fullName, "/")[0]; + const username = split(repository?.fullName, '/')[0]; await this.apolloClient .mutate({ @@ -80,9 +80,9 @@ export default class GitHub extends BaseClass { cmsStackApiKey: selectedStack?.api_key || '', repository: { username, - gitProvider: provider, repositoryUrl: repository?.url, repositoryName: repository?.fullName, + gitProviderMetadata: { gitProvider }, }, environment: { gitBranch: branch, diff --git a/packages/contentstack-launch/src/commands/launch/base-command.ts b/packages/contentstack-launch/src/base-command.ts similarity index 95% rename from packages/contentstack-launch/src/commands/launch/base-command.ts rename to packages/contentstack-launch/src/base-command.ts index 4fdb5551cb..018ef3ecde 100755 --- a/packages/contentstack-launch/src/commands/launch/base-command.ts +++ b/packages/contentstack-launch/src/base-command.ts @@ -17,9 +17,9 @@ import { managementSDKInitiator, } from '@contentstack/cli-utilities'; -import config from '../../config'; -import { GraphqlApiClient, Logger } from '../../util'; -import { ConfigType, LogFn, Providers } from '../../types'; +import config from './config'; +import { GraphqlApiClient, Logger } from './util'; +import { ConfigType, LogFn, Providers } from './types'; export type Flags = Interfaces.InferredFlags<(typeof BaseCommand)['baseFlags'] & T['flags']>; export type Args = Interfaces.InferredArgs; @@ -36,8 +36,6 @@ export abstract class BaseCommand extends Command { protected flags!: Flags; protected args!: Args; - static hidden = true; - // define flags that can be inherited by any command that extends BaseCommand static baseFlags: FlagInput = { 'data-dir': Flags.string({ @@ -107,9 +105,9 @@ export abstract class BaseCommand extends Command { this.flags['data-dir'] || this.flags.config ? this.flags.config || resolve(this.flags['data-dir'], config.configName) : resolve(process.cwd(), config.configName); - const baseUrl = (config.launchHubUrls as Record)[this.cmaAPIUrl]; + const baseUrl = config.launchBaseUrl || (config.launchHubUrls as Record)[this.cmaAPIUrl]; this.sharedConfig = { - ...require('../../config').default, + ...require('./config').default, currentConfig: {}, ...this.flags, flags: this.flags, diff --git a/packages/contentstack-launch/src/commands/launch/deployments.ts b/packages/contentstack-launch/src/commands/launch/deployments.ts index ef22181647..07b85ecfb4 100755 --- a/packages/contentstack-launch/src/commands/launch/deployments.ts +++ b/packages/contentstack-launch/src/commands/launch/deployments.ts @@ -4,12 +4,11 @@ import find from 'lodash/find'; import isEmpty from 'lodash/isEmpty'; import { FlagInput, Flags, cliux as ux } from '@contentstack/cli-utilities'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import { environmentsQuery } from '../../graphql'; import { Logger, selectOrg, selectProject } from '../../util'; export default class Deployments extends BaseCommand { - static hidden = false; static description = 'Show list of deployments for an environment'; static examples = [ diff --git a/packages/contentstack-launch/src/commands/launch/environments.ts b/packages/contentstack-launch/src/commands/launch/environments.ts index 45473d76ca..bbab7c9fdc 100755 --- a/packages/contentstack-launch/src/commands/launch/environments.ts +++ b/packages/contentstack-launch/src/commands/launch/environments.ts @@ -4,12 +4,11 @@ import find from 'lodash/find'; import isEmpty from 'lodash/isEmpty'; import { FlagInput, Flags, cliux as ux } from '@contentstack/cli-utilities'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import { Logger, selectOrg, selectProject } from '../../util'; import { environmentsQuery, projectsQuery } from '../../graphql'; export default class Environments extends BaseCommand { - static hidden = false; static description = 'Show list of environments for a project'; static examples = [ diff --git a/packages/contentstack-launch/src/commands/launch/functions.ts b/packages/contentstack-launch/src/commands/launch/functions.ts index 76816b7f33..c5e3b78605 100755 --- a/packages/contentstack-launch/src/commands/launch/functions.ts +++ b/packages/contentstack-launch/src/commands/launch/functions.ts @@ -1,10 +1,9 @@ import { FlagInput, Flags } from '@contentstack/cli-utilities'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import Contentfly from '../../util/cloud-function'; export default class Functions extends BaseCommand { - static hidden = false; static description = 'Serve cloud functions'; static examples = [ diff --git a/packages/contentstack-launch/src/commands/launch/index.ts b/packages/contentstack-launch/src/commands/launch/index.ts index 8fd4cd1e76..06abde2cd4 100755 --- a/packages/contentstack-launch/src/commands/launch/index.ts +++ b/packages/contentstack-launch/src/commands/launch/index.ts @@ -2,15 +2,13 @@ import map from 'lodash/map'; import { FlagInput, Flags } from '@contentstack/cli-utilities'; import config from '../../config'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import { AdapterConstructorInputs } from '../../types'; import { FileUpload, GitHub, PreCheck } from '../../adapters'; export default class Launch extends BaseCommand { public preCheck!: PreCheck; - static hidden = false; - static description = 'Launch related operations'; static examples = [ @@ -58,6 +56,7 @@ export default class Launch extends BaseCommand { description: '[Optional, Hidden] Show variable values on the UI', }), init: Flags.boolean({ + hidden: true, description: '[Optional, Hidden] Reinitialize the project if it is an existing launch project.', }), }; diff --git a/packages/contentstack-launch/src/commands/launch/logs.ts b/packages/contentstack-launch/src/commands/launch/logs.ts index 2be2025ea5..581d56ce66 100755 --- a/packages/contentstack-launch/src/commands/launch/logs.ts +++ b/packages/contentstack-launch/src/commands/launch/logs.ts @@ -5,13 +5,12 @@ import isArray from 'lodash/isArray'; import includes from 'lodash/includes'; import { Flags, FlagInput, cliux as ux } from '@contentstack/cli-utilities'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import { environmentsQuery } from '../../graphql'; import { Logger, LogPolling, selectOrg, selectProject } from '../../util'; import { EmitMessage, DeploymentLogResp, ServerLogResp } from '../../types'; export default class Logs extends BaseCommand { - static hidden = false; static description = 'Show deployment or server logs'; static examples = [ diff --git a/packages/contentstack-launch/src/commands/launch/open.ts b/packages/contentstack-launch/src/commands/launch/open.ts index b68b8ab83a..76a6c24464 100755 --- a/packages/contentstack-launch/src/commands/launch/open.ts +++ b/packages/contentstack-launch/src/commands/launch/open.ts @@ -4,12 +4,11 @@ import find from 'lodash/find'; import isEmpty from 'lodash/isEmpty'; import { FlagInput, Flags, cliux as ux } from '@contentstack/cli-utilities'; -import { BaseCommand } from './base-command'; +import { BaseCommand } from '../../base-command'; import { environmentsQuery } from '../../graphql'; import { print, Logger, selectOrg, selectProject } from '../../util'; export default class Open extends BaseCommand { - static hidden = false; static description = 'Open a website for an environment'; static examples = [ diff --git a/packages/contentstack-launch/src/config/index.ts b/packages/contentstack-launch/src/config/index.ts index 7aab1b2fce..578444da76 100755 --- a/packages/contentstack-launch/src/config/index.ts +++ b/packages/contentstack-launch/src/config/index.ts @@ -28,6 +28,7 @@ const config = { 'https://azure-na-api.contentstack.com': '', 'https://azure-eu-api.contentstack.com': '', }, + launchBaseUrl: '', supportedAdapters: ['GitHub'], deploymentStatus: ['LIVE', 'FAILED', 'SKIPPED', 'DEPLOYED'], pollingInterval: 1000, diff --git a/packages/contentstack-launch/src/graphql/mutation.ts b/packages/contentstack-launch/src/graphql/mutation.ts index 46c779fc5e..3edc731f62 100755 --- a/packages/contentstack-launch/src/graphql/mutation.ts +++ b/packages/contentstack-launch/src/graphql/mutation.ts @@ -33,10 +33,7 @@ const createSignedUploadUrlMutation: DocumentNode = gql` `; const importProjectMutation: DocumentNode = gql` - mutation importProject( - $project: ImportProjectInput! - $skipGitData: Boolean = false - ) { + mutation importProject($project: ImportProjectInput!, $skipGitData: Boolean = false) { project: importProject(project: $project) { uid name @@ -63,8 +60,12 @@ const importProjectMutation: DocumentNode = gql` } repository @skip(if: $skipGitData) { username - gitProvider repositoryName + gitProviderMetadata { + ... on GitHubMetadata { + gitProvider + } + } } } } diff --git a/packages/contentstack-launch/src/graphql/queries.ts b/packages/contentstack-launch/src/graphql/queries.ts index a5037b6c3a..6f3cfc3319 100755 --- a/packages/contentstack-launch/src/graphql/queries.ts +++ b/packages/contentstack-launch/src/graphql/queries.ts @@ -90,11 +90,15 @@ const projectsQuery: DocumentNode = gql` cmsStackApiKey organizationUid repository { - gitProvider - gitProviderConnectionUid repositoryName repositoryUrl username + gitProviderMetadata { + ... on GitHubMetadata { + connectionUid + gitProvider + } + } } } } diff --git a/packages/contentstack-migrate-rte/package.json b/packages/contentstack-migrate-rte/package.json index 38e2e05e24..4be2853e31 100644 --- a/packages/contentstack-migrate-rte/package.json +++ b/packages/contentstack-migrate-rte/package.json @@ -19,7 +19,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "chai": "^4.3.4", "eslint": "^8.18.0", "eslint-config-oclif": "^4.0.0", diff --git a/packages/contentstack-migration/package.json b/packages/contentstack-migration/package.json index 50bc53b9b5..1971b87df1 100644 --- a/packages/contentstack-migration/package.json +++ b/packages/contentstack-migration/package.json @@ -16,13 +16,13 @@ "winston": "^3.7.2" }, "devDependencies": { - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "chai": "^4.3.4", "eslint": "^8.18.0", "globby": "^10.0.2", "husky": "^8.0.3", "jsdoc": "^4.0.0", - "jsdoc-to-markdown": "^7.0.1", + "jsdoc-to-markdown": "^8.0.0", "mkdirp": "^1.0.4", "nock": "^13.1.1", "nyc": "^15.1.0", diff --git a/packages/contentstack-utilities/package.json b/packages/contentstack-utilities/package.json index 4434b06712..379f17ee27 100644 --- a/packages/contentstack-utilities/package.json +++ b/packages/contentstack-utilities/package.json @@ -59,7 +59,7 @@ }, "devDependencies": { "@contentstack/cli-dev-dependencies": "^1.2.4", - "@oclif/test": "^2.2.10", + "@oclif/test": "^2.5.6", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", "@types/mkdirp": "^1.0.1", diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index 05d029fec7..092ad93fcf 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/1.13.0 darwin-arm64 node-v20.8.0 +@contentstack/cli/1.13.3 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -2332,6 +2332,7 @@ USAGE [--destination-stack-api-key ] [--import-webhook-status disable|current] FLAGS + -c, --config= Path for the external configuration -n, --stack-name= Name for the new stack to store the cloned content. -y, --yes [Optional] Override marketplace prompts --destination-management-token-alias= Source API key of the target stack token alias. @@ -2483,6 +2484,7 @@ USAGE [--destination-stack-api-key ] [--import-webhook-status disable|current] FLAGS + -c, --config= Path for the external configuration -n, --stack-name= Name for the new stack to store the cloned content. -y, --yes [Optional] Override marketplace prompts --destination-management-token-alias= Source API key of the target stack token alias. @@ -3226,7 +3228,7 @@ Launch related operations ``` USAGE $ csdx launch [-d ] [-c ] [--type GitHub|FileUpload] [--framework Gatsby|NextJs|Other] - [--org ] [-n ] [-e ] [--branch ] [--build-command ] [--out-dir ] [--init] + [--org ] [-n ] [-e ] [--branch ] [--build-command ] [--out-dir ] FLAGS -c, --config= Path to the local '.cs-launch.json' file @@ -3237,7 +3239,6 @@ FLAGS --build-command= [Optional] Build Command --framework=