diff --git a/package-lock.json b/package-lock.json index e8dc796016..27ece7d6b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,9 +41,9 @@ } }, "node_modules/@apollo/client": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.9.6.tgz", - "integrity": "sha512-+zpddcnZ4G2VZ0xIEnvIHFsLqeopNOnWuE2ZVbRuetLLpj/biLPNN719B/iofdd1/iHRclKfv0XaAmX6PBhYKA==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.9.7.tgz", + "integrity": "sha512-OEEwt55bkFhqihCT5d75KUxZt50JZ9MuIYwG7VZlyPPIAb9K+qzVWlXWlf3tB5DaV43yXkUSLQfNpdIBFOB55Q==", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/caches": "^1.0.0", @@ -2073,7 +2073,7 @@ "integrity": "sha512-XRwm2mnbOHPmin5bI4bzjD9imGy+HpCN7eQlTM+akcAHPHcMueyo8O/BHzCeeiS+mNMFYxvc5/6p/YH5A7/94w==", "hasShrinkwrap": true, "dependencies": { - "@oclif/core": "^3.21.0", + "@oclif/core": "^3.23.0", "chalk": "^5.3.0", "debug": "^4.3.4", "npm": "10.5.0", @@ -2123,9 +2123,9 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/@oclif/core": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.21.0.tgz", - "integrity": "sha512-xR7qGPOWtOnYmdYocSn6oEh2oTQLsPOXoj3HYGpb26V3WulwF8Cm33WPnMsSISv4ben3Rtc5i59u9O5NnuG42g==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.23.0.tgz", + "integrity": "sha512-giQ/8Ft8yXWg4IyPVtynPb7ihoQsa3A/1Q53UIJIhh+8k+EedE3lJ01yn6sq6Ha35IGqsG1WhkeHzlJIuldEaw==", "license": "MIT", "dependencies": { "@types/cli-progress": "^3.11.5", @@ -2144,6 +2144,7 @@ "indent-string": "^4.0.0", "is-wsl": "^2.2.0", "js-yaml": "^3.14.1", + "minimatch": "^9.0.3", "natural-orderby": "^2.0.3", "object-treeify": "^1.1.33", "password-prompt": "^1.1.3", @@ -2210,6 +2211,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@oclif/plugin-plugins/node_modules/@oclif/core/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, "node_modules/@oclif/plugin-plugins/node_modules/@oclif/core/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -2235,20 +2242,14 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/@types/cli-progress/node_modules/@types/node": { - "version": "20.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", - "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", + "version": "20.11.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", + "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", "license": "MIT", "dependencies": { - "undici-types": "~5.25.1" + "undici-types": "~5.26.4" } }, - "node_modules/@oclif/plugin-plugins/node_modules/@types/cli-progress/node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", - "license": "MIT" - }, "node_modules/@oclif/plugin-plugins/node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -2313,9 +2314,9 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "license": "MIT" }, "node_modules/@oclif/plugin-plugins/node_modules/balanced-match": { @@ -2564,9 +2565,9 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -2580,9 +2581,9 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -2627,6 +2628,15 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, + "node_modules/@oclif/plugin-plugins/node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -2668,15 +2678,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@oclif/plugin-plugins/node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/@oclif/plugin-plugins/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2686,6 +2687,18 @@ "node": ">=8" } }, + "node_modules/@oclif/plugin-plugins/node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/hyperlinker": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", @@ -2696,9 +2709,9 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "license": "MIT", "engines": { "node": ">= 4" @@ -2739,12 +2752,12 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "license": "MIT", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2840,6 +2853,16 @@ "node": ">=10" } }, + "node_modules/@oclif/plugin-plugins/node_modules/jake/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/jake/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2856,6 +2879,18 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/@oclif/plugin-plugins/node_modules/jake/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2879,25 +2914,18 @@ } }, "node_modules/@oclif/plugin-plugins/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" - } - }, - "node_modules/@oclif/plugin-plugins/node_modules/minimatch/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@oclif/plugin-plugins/node_modules/natural-orderby": { @@ -5702,6 +5730,16 @@ "node": ">=4" } }, + "node_modules/@oclif/plugin-plugins/node_modules/shelljs/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/shelljs/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5722,6 +5760,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@oclif/plugin-plugins/node_modules/shelljs/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@oclif/plugin-plugins/node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -5763,12 +5813,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/@oclif/plugin-plugins/node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" - }, "node_modules/@oclif/plugin-plugins/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5856,6 +5900,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@oclif/plugin-plugins/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, "node_modules/@oclif/plugin-plugins/node_modules/validate-npm-package-name": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", @@ -5916,9 +5966,9 @@ "license": "ISC" }, "node_modules/@oclif/plugin-plugins/node_modules/yarn": { - "version": "1.22.21", - "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.21.tgz", - "integrity": "sha512-ynXaJsADJ9JiZ84zU25XkPGOvVMmZ5b7tmTSpKURYwgELdjucAOydqIOrOfTxVYcNXe91xvLZwcRh68SR3liCg==", + "version": "1.22.22", + "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz", + "integrity": "sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==", "hasInstallScript": true, "license": "BSD-2-Clause", "bin": { @@ -6563,9 +6613,9 @@ } }, "node_modules/@slack/logger/node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "20.11.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz", + "integrity": "sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg==", "dependencies": { "undici-types": "~5.26.4" } @@ -7096,9 +7146,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==" + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", + "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==" }, "node_modules/@types/markdown-it": { "version": "12.2.3", @@ -7663,9 +7713,9 @@ } }, "node_modules/adm-zip": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", - "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.11.tgz", + "integrity": "sha512-bSG/kcTQRVyCZ3aOWt3nu/KGIxkfSNi7MXzgKr/MHfKbqPakFESQvaujpUaAG8OQuSroxYMY5vLMpdE6+oND2Q==", "engines": { "node": ">=6.0" } @@ -10480,9 +10530,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.1.tgz", - "integrity": "sha512-3d3JRbwsCLJsYgvb6NuWEG44jjPSOMuS73L/6+7BZuoKm3W+qXnSoIYVHi8dG7Qcg4inAY4jbzkZ7MnskePeDg==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -25430,7 +25480,7 @@ "version": "1.17.0", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.0", + "@contentstack/cli-audit": "~1.5.1", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.23", @@ -25495,7 +25545,7 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.5.0", + "version": "1.5.1", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", @@ -25554,9 +25604,9 @@ "dev": true }, "packages/contentstack-audit/node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "20.11.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz", + "integrity": "sha512-qyUZfMnCg1KEz57r7pzFtSGt49f6RPkPBis3Vo4PbS7roQEDn22hiHzl/Lo1q4i4hDEgBJmBF/NTNg2XR0HbFg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -26943,7 +26993,7 @@ "version": "1.15.0", "license": "MIT", "dependencies": { - "@contentstack/cli-audit": "~1.5.0", + "@contentstack/cli-audit": "~1.5.1", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.6.0", "@contentstack/management": "~1.15.3", @@ -27163,9 +27213,9 @@ "dev": true }, "packages/contentstack-launch/node_modules/@types/node": { - "version": "16.18.87", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.87.tgz", - "integrity": "sha512-+IzfhNirR/MDbXz6Om5eHV54D9mQlEMGag6AgEzlju0xH3M8baCXYwqQ6RKgGMpn9wSTx6Ltya/0y4Z8eSfdLw==", + "version": "16.18.89", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.89.tgz", + "integrity": "sha512-QlrE8QI5z62nfnkiUZysUsAaxWaTMoGqFVcB3PvK1WxJ0c699bacErV4Fabe9Hki6ZnaHalgzihLbTl2d34XfQ==", "dev": true }, "packages/contentstack-launch/node_modules/acorn": { @@ -27572,4 +27622,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 7a49de850a..78df337130 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-audit", - "version": "1.5.0", + "version": "1.5.1", "description": "Contentstack audit plugin", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli", @@ -86,4 +86,4 @@ "keywords": [ "oclif" ] -} +} \ No newline at end of file diff --git a/packages/contentstack-audit/src/audit-base-command.ts b/packages/contentstack-audit/src/audit-base-command.ts index b49eb60d6e..4fefdf67fb 100644 --- a/packages/contentstack-audit/src/audit-base-command.ts +++ b/packages/contentstack-audit/src/audit-base-command.ts @@ -13,7 +13,13 @@ import { print } from './util/log'; import { auditMsg } from './messages'; import { BaseCommand } from './base-command'; import { Entries, GlobalField, ContentType, Extensions, Workflows } from './modules'; -import { CommandNames, ContentTypeStruct, OutputColumn, RefErrorReturnType } from './types'; +import { + CommandNames, + ContentTypeStruct, + OutputColumn, + RefErrorReturnType, + WorkflowExtensionsRefErrorReturnType, +} from './types'; export abstract class AuditBaseCommand extends BaseCommand { private currentCommand!: CommandNames; @@ -113,7 +119,6 @@ export abstract class AuditBaseCommand extends BaseCommand { - if (['title', 'name', 'uid', 'content_types', 'fixStatus'].includes(key)) { + if (['title', 'name', 'uid', 'content_types', 'branches', 'fixStatus'].includes(key)) { return { [key]: { minWidth: 7, @@ -311,7 +316,7 @@ export abstract class AuditBaseCommand extends BaseCommand) => { if (key === 'fixStatus') { return chalk.green(typeof row[key] === 'object' ? JSON.stringify(row[key]) : row[key]); - } else if (key === 'content_types') { + } else if (key === 'content_types' || key === 'branches') { return chalk.red(typeof row[key] === 'object' ? JSON.stringify(row[key]) : row[key]); } else { return chalk.white(typeof row[key] === 'object' ? JSON.stringify(row[key]) : row[key]); @@ -371,14 +376,22 @@ export abstract class AuditBaseCommand extends BaseCommand !userDefinedColumns.includes(val))] : defaultColumns; if (this.sharedConfig.flags.filter) { const [column, value]: [keyof typeof OutputColumn, string] = this.sharedConfig.flags.filter.split('='); - missingRefs = missingRefs.filter((row: RefErrorReturnType) => row[OutputColumn[column]] === value); + // Filter the missingRefs array + missingRefs = missingRefs.filter((row) => { + if (OutputColumn[column] in row) { + const rowKey = OutputColumn[column] as keyof (RefErrorReturnType | WorkflowExtensionsRefErrorReturnType); + return row[rowKey] === value; + } + return false; + }); } const rowData: Record[] = []; @@ -387,7 +400,8 @@ export abstract class AuditBaseCommand extends BaseCommand; public workflowPath: string; + public isBranchFixDone: boolean; constructor({ log, @@ -41,6 +42,7 @@ export default class Workflows { this.missingCtInWorkflows = []; this.missingCts = new Set(); this.workflowPath = ''; + this.isBranchFixDone = false; } /** * Check whether the given path for the workflow exists or not @@ -54,69 +56,97 @@ export default class Workflows { this.log($t(auditMsg.NOT_VALID_PATH, { path: this.folderPath }), { color: 'yellow' }); return {}; } - + this.workflowPath = join(this.folderPath, this.fileName); - this.workflowSchema = existsSync(this.workflowPath) ? values(JSON.parse(readFileSync(this.workflowPath, 'utf8')) as Workflow[]) : []; - + this.workflowSchema = existsSync(this.workflowPath) + ? values(JSON.parse(readFileSync(this.workflowPath, 'utf8')) as Workflow[]) + : []; + this.ctSchema.forEach((ct) => this.ctUidSet.add(ct.uid)); - + for (const workflow of this.workflowSchema) { const ctNotPresent = workflow.content_types.filter((ct) => !this.ctUidSet.has(ct)); - if (ctNotPresent.length) { + const branch = workflow?.branches?.filter((branch) => branch !== this.config?.branch); + + if (ctNotPresent.length || branch?.length) { const tempwf = cloneDeep(workflow); - tempwf.content_types = ctNotPresent; + tempwf.content_types = ctNotPresent || []; + + if (workflow?.branches) { + tempwf.branches = branch; + } + + if (branch?.length) { + this.isBranchFixDone = true; + } + ctNotPresent.forEach((ct) => this.missingCts.add(ct)); this.missingCtInWorkflows.push(tempwf); } - + this.log( $t(auditMsg.SCAN_WF_SUCCESS_MSG, { name: workflow.name, module: this.config.moduleConfig[this.moduleName].name, }), - 'info' + 'info', ); } - - if (this.fix && this.missingCtInWorkflows.length) { + + if (this.fix && (this.missingCtInWorkflows.length || this.isBranchFixDone)) { await this.fixWorkflowSchema(); this.missingCtInWorkflows.forEach((wf) => (wf.fixStatus = 'Fixed')); } - + return this.missingCtInWorkflows; } - async fixWorkflowSchema() { + async fixWorkflowSchema() { const newWorkflowSchema: Record = existsSync(this.workflowPath) ? JSON.parse(readFileSync(this.workflowPath, 'utf8')) : {}; - + if (Object.keys(newWorkflowSchema).length !== 0) { - for (const workflow of this.workflowSchema) { + for (const workflow of this.workflowSchema) { const fixedCts = workflow.content_types.filter((ct) => !this.missingCts.has(ct)); + const fixedBranches: string[] = []; + + workflow?.branches?.forEach((branch) => { + if (branch !== this.config?.branch) { + const { uid, name } = workflow; + this.log($t(commonMsg.WF_BRANCH_REMOVAL, { uid, name, branch }), { color: 'yellow' }); + } else { + fixedBranches.push(branch); + } + }); + + if (fixedBranches.length > 0) { + newWorkflowSchema[workflow.uid].branches = fixedBranches; + } + if (fixedCts.length) { newWorkflowSchema[workflow.uid].content_types = fixedCts; } else { const { name, uid } = workflow; const warningMessage = $t(commonMsg.WORKFLOW_FIX_WARN, { name, uid }); - + this.log(warningMessage, { color: 'yellow' }); - + if (this.config.flags.yes || (await ux.confirm(commonMsg.WORKFLOW_FIX_CONFIRMATION))) { delete newWorkflowSchema[workflow.uid]; } } } } - + await this.writeFixContent(newWorkflowSchema); } async writeFixContent(newWorkflowSchema: Record) { if ( this.fix || - !(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) && - (this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION))) + (!(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) && + (this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)))) ) { writeFileSync( join(this.folderPath, this.config.moduleConfig[this.moduleName].fileName), diff --git a/packages/contentstack-audit/src/types/content-types.ts b/packages/contentstack-audit/src/types/content-types.ts index 8f4d614eef..b9e23931b9 100644 --- a/packages/contentstack-audit/src/types/content-types.ts +++ b/packages/contentstack-audit/src/types/content-types.ts @@ -53,6 +53,8 @@ type RefErrorReturnType = { title?: string; }; +type WorkflowExtensionsRefErrorReturnType = RefErrorReturnType & { branches?: string[] }; + // NOTE Type 1 type ReferenceFieldDataType = CommonDataTypeStruct & { reference_to: string[]; @@ -119,6 +121,7 @@ enum OutputColumn { title = 'title', 'uid' = 'uid', 'missingCts' = 'content_types', + 'Missing Branches' = 'branches', } export { @@ -137,4 +140,5 @@ export { OutputColumn, ContentTypeSchemaType, GlobalFieldSchemaTypes, + WorkflowExtensionsRefErrorReturnType, }; diff --git a/packages/contentstack-audit/src/types/workflow.ts b/packages/contentstack-audit/src/types/workflow.ts index 9f8346b4d0..e180e2cc91 100644 --- a/packages/contentstack-audit/src/types/workflow.ts +++ b/packages/contentstack-audit/src/types/workflow.ts @@ -9,5 +9,6 @@ export interface Workflow { enabled?: boolean; deleted_at?: any; missingRefs?: any; - fixStatus?:string + fixStatus?: string; + branches?: string[]; } diff --git a/packages/contentstack-audit/test/unit/mock/contents/workflows/workflows.json b/packages/contentstack-audit/test/unit/mock/contents/workflows/workflows.json index f6f013f417..1efcdb8ee9 100644 --- a/packages/contentstack-audit/test/unit/mock/contents/workflows/workflows.json +++ b/packages/contentstack-audit/test/unit/mock/contents/workflows/workflows.json @@ -5,7 +5,9 @@ "org_uid": "org1", "api_key": "apiKey", "content_types": [ - "ct1" + "ct1", + "ct45", + "ct14" ], "enabled": false, "deleted_at": false @@ -16,7 +18,8 @@ "org_uid": "org1", "api_key": "apiKey", "content_types": [ - "ct2" + "ct2", + "ct6" ], "enabled": false, "deleted_at": false @@ -43,5 +46,21 @@ ], "enabled": false, "deleted_at": false + }, + "wf5": { + "name": "wf5", + "uid": "wf5", + "org_uid": "org1", + "api_key": "apiKey", + "content_types": [ + "ct4" + ], + "branches": [ + "main", + "development", + "stage" + ], + "enabled": false, + "deleted_at": false } } \ No newline at end of file diff --git a/packages/contentstack-audit/test/unit/modules/workflow.test.ts b/packages/contentstack-audit/test/unit/modules/workflow.test.ts index 2dc92f2d13..6d576365a1 100644 --- a/packages/contentstack-audit/test/unit/modules/workflow.test.ts +++ b/packages/contentstack-audit/test/unit/modules/workflow.test.ts @@ -46,6 +46,7 @@ describe('Workflows', () => { .it( 'should expect missingRefs equal to workflow which has missing refs, missingCts equal to missing Cts', async () => { + wf.config.branch = 'development'; const missingRefs = await wf.run(); expect(wf.workflowSchema).eql(values(JSON.parse(fs.readFileSync(wf.workflowPath, 'utf8')))); expect(missingRefs).eql([ @@ -67,33 +68,22 @@ describe('Workflows', () => { enabled: false, deleted_at: false, }, + { + api_key: 'apiKey', + branches: ['main', 'stage'], + content_types: [], + deleted_at: false, + enabled: false, + name: 'wf5', + org_uid: 'org1', + uid: 'wf5', + }, ]); expect(wf.missingCts).eql(new Set(['ct45', 'ct14', 'ct6'])); }, ); }); - describe('run method with valid path and empty ctSchema to check the missing references', () => { - const wf = new Workflows({ - log: () => {}, - moduleName: 'workflows', - ctSchema: [], - config: Object.assign(config, { - basePath: resolve(`./test/unit/mock/contents/`), - flags: {}, - }), - }); - - fancy - .stdout({ print: process.env.PRINT === 'true' || true }) - .stub(ux, 'confirm', async () => true) - .it('should expect missingRefs equal to all workflows', async () => { - const missingRefs = await wf.run(); - wf.workflowSchema.pop(); - expect(missingRefs).eql(wf.workflowSchema); - }); - }); - describe('run method with audit fix for workflows with valid path and empty ctSchema', () => { const wf = new Workflows({ log: () => {}, @@ -111,6 +101,7 @@ describe('Workflows', () => { .stub(wf, 'log', async () => {}) .stub(ux, 'confirm', async () => true) .stub(wf, 'WriteFileSync', () => {}) + .stub(wf, 'writeFixContent', () => {}) .it('the run function should run and flow should go till fixWorkflowSchema', async () => { const fixedReference = await wf.run(); expect(fixedReference).eql([ @@ -136,13 +127,14 @@ describe('Workflows', () => { }, { api_key: 'apiKey', - content_types: ['ct88'], + branches: ['main', 'stage'], + content_types: [], deleted_at: false, enabled: false, fixStatus: 'Fixed', - name: 'wf6', + name: 'wf5', org_uid: 'org1', - uid: 'wf6', + uid: 'wf5', }, ]); }); diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index d1185d673f..722ff6c208 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.5.0", + "@contentstack/cli-audit": "~1.5.1", "@contentstack/cli-command": "~1.2.16", "@contentstack/cli-utilities": "~1.6.0", "@contentstack/management": "~1.15.3", @@ -99,4 +99,4 @@ } }, "repository": "https://github.com/contentstack/cli" -} +} \ No newline at end of file diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index bcdd538e48..6e1deec080 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -117,7 +117,7 @@ class ModuleImporter { const basePath = resolve(this.importConfig.backupDir, 'logs', 'audit'); const auditConfig = this.importConfig.auditConfig; auditConfig.config.basePath = basePath; - + auditConfig.config.branch = this.importConfig.branchName; try { const args = [ '--data-dir', diff --git a/packages/contentstack-import/src/types/default-config.ts b/packages/contentstack-import/src/types/default-config.ts index 17a7168a23..4700b2aa1c 100644 --- a/packages/contentstack-import/src/types/default-config.ts +++ b/packages/contentstack-import/src/types/default-config.ts @@ -153,7 +153,8 @@ export default interface DefaultConfig { returnResponse?: boolean; // On process completion should return config used in the command noTerminalOutput?: boolean; // Skip final audit table output on terminal config?: { - basePath?: string + basePath?: string; + branch?: string; } & Record; // To overwrite any build-in config. And this config is equal to --config flag. }; } diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 86d0ea7e33..5f08ac8688 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -22,7 +22,7 @@ "prepack": "pnpm compile && oclif manifest && oclif readme" }, "dependencies": { - "@contentstack/cli-audit": "~1.5.0", + "@contentstack/cli-audit": "~1.5.1", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.23", @@ -160,4 +160,4 @@ } }, "repository": "https://github.com/contentstack/cli" -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d0e9f8dd9..e4234954c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: packages/contentstack: specifiers: - '@contentstack/cli-audit': ~1.5.0 + '@contentstack/cli-audit': ~1.5.1 '@contentstack/cli-auth': ~1.3.17 '@contentstack/cli-cm-bootstrap': ~1.9.0 '@contentstack/cli-cm-branches': ~1.0.23 @@ -730,7 +730,7 @@ importers: packages/contentstack-import: specifiers: - '@contentstack/cli-audit': ~1.5.0 + '@contentstack/cli-audit': ~1.5.1 '@contentstack/cli-command': ~1.2.16 '@contentstack/cli-utilities': ~1.6.0 '@contentstack/management': ~1.15.3