From 6e8acb8521f6bef4f6d4e56994d19aa62333999e Mon Sep 17 00:00:00 2001 From: Antony Date: Mon, 6 Nov 2023 22:48:38 +0530 Subject: [PATCH 01/27] Test: Unit test cases added for utility and content-types audit command --- package-lock.json | 1814 ++++++++++------- packages/contentstack-audit/package.json | 5 + .../src/audit-base-command.ts | 9 +- .../contentstack-audit/src/base-command.ts | 6 +- .../src/commands/cm/stacks/audit/index.ts | 1 - packages/contentstack-audit/src/util/index.ts | 2 +- packages/contentstack-audit/src/util/log.ts | 50 +- .../test/unit/audit-base-command.test.ts | 361 ++++ .../test/unit/base-command.test.ts | 82 + .../test/unit/commands/fix.test.ts | 0 .../test/unit/commands/index.test.ts | 66 + .../test/unit/messages/index.test.ts | 24 + .../test/unit/mock/config.json | 1 + .../test/unit/mock/contents/.DS_Store | Bin 0 -> 6148 bytes .../mock/contents/content_types/schema.json | 378 ++++ .../test/unit/mock/contents/entries/.DS_Store | Bin 0 -> 6148 bytes ...c-64ca-4226-afb3-7794242ae5f5-entries.json | 94 + .../contents/entries/page_1/en-us/index.json | 1 + .../contents/global_fields/globalfields.json | 135 ++ .../unit/mock/contents/locales/locales.json | 1 + .../mock/contents/locales/master-locale.json | 8 + .../test/unit/mock/invalid-config.json | 3 + .../test/unit/modules/content-types.test.ts | 248 +++ .../test/unit/util/log.test.ts | 112 + .../contentstack-import/src/utils/logger.ts | 2 +- 25 files changed, 2580 insertions(+), 823 deletions(-) create mode 100644 packages/contentstack-audit/test/unit/audit-base-command.test.ts create mode 100644 packages/contentstack-audit/test/unit/base-command.test.ts create mode 100644 packages/contentstack-audit/test/unit/commands/fix.test.ts create mode 100644 packages/contentstack-audit/test/unit/commands/index.test.ts create mode 100644 packages/contentstack-audit/test/unit/messages/index.test.ts create mode 100644 packages/contentstack-audit/test/unit/mock/config.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/.DS_Store create mode 100644 packages/contentstack-audit/test/unit/mock/contents/content_types/schema.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/entries/.DS_Store create mode 100644 packages/contentstack-audit/test/unit/mock/contents/entries/page_1/en-us/e7f6e3cc-64ca-4226-afb3-7794242ae5f5-entries.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/entries/page_1/en-us/index.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/global_fields/globalfields.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/locales/locales.json create mode 100644 packages/contentstack-audit/test/unit/mock/contents/locales/master-locale.json create mode 100644 packages/contentstack-audit/test/unit/mock/invalid-config.json create mode 100644 packages/contentstack-audit/test/unit/modules/content-types.test.ts create mode 100644 packages/contentstack-audit/test/unit/util/log.test.ts diff --git a/package-lock.json b/package-lock.json index d5245b8982..3e2919414f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1335,16 +1335,16 @@ } }, "node_modules/@jest/console": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.1.tgz", - "integrity": "sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -1352,37 +1352,37 @@ } }, "node_modules/@jest/core": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.1.tgz", - "integrity": "sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "@jest/console": "^29.6.1", - "@jest/reporters": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.5.0", - "jest-config": "^29.6.1", - "jest-haste-map": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-resolve-dependencies": "^29.6.1", - "jest-runner": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", - "jest-watcher": "^29.6.1", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -1411,12 +1411,12 @@ } }, "node_modules/@jest/core/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -1431,88 +1431,88 @@ "dev": true }, "node_modules/@jest/environment": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.1.tgz", - "integrity": "sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.1" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.1.tgz", - "integrity": "sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "dependencies": { - "expect": "^29.6.1", - "jest-snapshot": "^29.6.1" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.1.tgz", - "integrity": "sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3" + "jest-get-type": "^29.6.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.1.tgz", - "integrity": "sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.1", - "jest-mock": "^29.6.1", - "jest-util": "^29.6.1" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.1.tgz", - "integrity": "sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.1", - "@jest/expect": "^29.6.1", - "@jest/types": "^29.6.1", - "jest-mock": "^29.6.1" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.1.tgz", - "integrity": "sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", @@ -1521,13 +1521,13 @@ "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -1545,10 +1545,26 @@ } } }, + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jest/schemas": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", - "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -1558,9 +1574,9 @@ } }, "node_modules/@jest/source-map": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", - "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", @@ -1572,13 +1588,13 @@ } }, "node_modules/@jest/test-result": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.1.tgz", - "integrity": "sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@jest/console": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -1587,14 +1603,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz", - "integrity": "sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@jest/test-result": "^29.6.1", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -1602,22 +1618,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.1.tgz", - "integrity": "sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.1", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -1634,12 +1650,12 @@ "dev": true }, "node_modules/@jest/types": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", - "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -2524,9 +2540,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", - "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", + "integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -2537,18 +2553,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.6", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", + "integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", + "integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -2556,9 +2572,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", - "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz", + "integrity": "sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" @@ -2691,9 +2707,9 @@ } }, "node_modules/@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.8.tgz", + "integrity": "sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==", "dev": true, "dependencies": { "@types/node": "*" @@ -2867,12 +2883,6 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "node_modules/@types/prettier": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", - "dev": true - }, "node_modules/@types/progress-stream": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/progress-stream/-/progress-stream-2.0.2.tgz", @@ -2940,9 +2950,9 @@ "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==" }, "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", + "integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", "dev": true }, "node_modules/@types/tar": { @@ -3862,15 +3872,15 @@ } }, "node_modules/babel-jest": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.1.tgz", - "integrity": "sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "@jest/transform": "^29.6.1", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.5.0", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -3899,9 +3909,9 @@ } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", - "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", @@ -3937,12 +3947,12 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", - "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^29.5.0", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { @@ -5316,6 +5326,27 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -5498,10 +5529,18 @@ } }, "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } }, "node_modules/deep-eql": { "version": "4.1.3", @@ -7594,17 +7633,16 @@ } }, "node_modules/expect": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.1.tgz", - "integrity": "sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.6.1", - "@types/node": "*", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10390,15 +10428,15 @@ } }, "node_modules/jest": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz", - "integrity": "sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "@jest/core": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.6.1" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" @@ -10416,12 +10454,13 @@ } }, "node_modules/jest-changed-files": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", - "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { "execa": "^5.0.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" }, "engines": { @@ -10429,28 +10468,28 @@ } }, "node_modules/jest-circus": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.1.tgz", - "integrity": "sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.1", - "@jest/expect": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.1", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -10472,12 +10511,12 @@ } }, "node_modules/jest-circus/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10492,22 +10531,21 @@ "dev": true }, "node_modules/jest-cli": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.1.tgz", - "integrity": "sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "@jest/core": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", - "prompts": "^2.0.1", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "yargs": "^17.3.1" }, "bin": { @@ -10526,31 +10564,31 @@ } }, "node_modules/jest-config": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.1.tgz", - "integrity": "sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.6.1", - "@jest/types": "^29.6.1", - "babel-jest": "^29.6.1", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.6.1", - "jest-environment-node": "^29.6.1", - "jest-get-type": "^29.4.3", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-runner": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -10601,12 +10639,12 @@ } }, "node_modules/jest-config/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10645,9 +10683,9 @@ } }, "node_modules/jest-docblock": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", - "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { "detect-newline": "^3.0.0" @@ -10657,16 +10695,16 @@ } }, "node_modules/jest-each": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.1.tgz", - "integrity": "sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "jest-util": "^29.6.1", - "pretty-format": "^29.6.1" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10685,12 +10723,12 @@ } }, "node_modules/jest-each/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10705,46 +10743,46 @@ "dev": true }, "node_modules/jest-environment-node": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.1.tgz", - "integrity": "sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.1", - "@jest/fake-timers": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.1", - "jest-util": "^29.6.1" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.1.tgz", - "integrity": "sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -10756,13 +10794,13 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz", - "integrity": "sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10781,12 +10819,12 @@ } }, "node_modules/jest-leak-detector/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10801,15 +10839,15 @@ "dev": true }, "node_modules/jest-matcher-utils": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz", - "integrity": "sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.6.1", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10828,36 +10866,36 @@ } }, "node_modules/jest-matcher-utils/node_modules/diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils/node_modules/jest-diff": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", - "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10872,18 +10910,18 @@ "dev": true }, "node_modules/jest-message-util": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.1.tgz", - "integrity": "sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -10904,12 +10942,12 @@ } }, "node_modules/jest-message-util/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -10924,14 +10962,14 @@ "dev": true }, "node_modules/jest-mock": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.1.tgz", - "integrity": "sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.1" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10955,26 +10993,26 @@ } }, "node_modules/jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.1.tgz", - "integrity": "sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" @@ -10984,43 +11022,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz", - "integrity": "sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "dependencies": { - "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.6.1" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.1.tgz", - "integrity": "sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { - "@jest/console": "^29.6.1", - "@jest/environment": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.6.1", - "jest-haste-map": "^29.6.1", - "jest-leak-detector": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-resolve": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-util": "^29.6.1", - "jest-watcher": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -11029,31 +11067,31 @@ } }, "node_modules/jest-runtime": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.1.tgz", - "integrity": "sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.6.1", - "@jest/fake-timers": "^29.6.1", - "@jest/globals": "^29.6.1", - "@jest/source-map": "^29.6.0", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-mock": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -11062,9 +11100,9 @@ } }, "node_modules/jest-snapshot": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.1.tgz", - "integrity": "sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", @@ -11072,21 +11110,20 @@ "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", - "@types/prettier": "^2.1.5", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.1", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.1", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "engines": { @@ -11106,36 +11143,36 @@ } }, "node_modules/jest-snapshot/node_modules/diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-snapshot/node_modules/jest-diff": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", - "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-snapshot/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -11150,12 +11187,12 @@ "dev": true }, "node_modules/jest-util": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz", - "integrity": "sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -11167,17 +11204,17 @@ } }, "node_modules/jest-validate": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.1.tgz", - "integrity": "sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.6.1" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -11208,12 +11245,12 @@ } }, "node_modules/jest-validate/node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -11228,18 +11265,18 @@ "dev": true }, "node_modules/jest-watcher": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.1.tgz", - "integrity": "sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.6.1", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "engines": { @@ -11247,13 +11284,13 @@ } }, "node_modules/jest-worker": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.1.tgz", - "integrity": "sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.6.1", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -13287,9 +13324,9 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node_modules/nise": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.4.tgz", - "integrity": "sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", + "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", "dependencies": { "@sinonjs/commons": "^2.0.0", "@sinonjs/fake-timers": "^10.0.2", @@ -18309,9 +18346,9 @@ } }, "node_modules/pure-rand": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", - "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "dev": true, "funding": [ { @@ -21310,19 +21347,25 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" }, "node_modules/v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", + "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" + "convert-source-map": "^2.0.0" }, "engines": { "node": ">=10.12.0" } }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -22944,19 +22987,24 @@ "audit": "bin/run" }, "devDependencies": { + "@jest/globals": "^29.7.0", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", + "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", "eslint-config-oclif-typescript": "^1.0.3", + "jest": "^29.7.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "oclif": "^3.10.0", "shx": "^0.3.4", + "sinon": "^17.0.0", + "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "tslib": "^2.5.3", "typescript": "^5.1.3" @@ -23021,6 +23069,25 @@ "node": ">=10.10.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", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "packages/contentstack-audit/node_modules/@types/jest": { + "version": "29.5.6", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", + "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "packages/contentstack-audit/node_modules/@types/node": { "version": "20.5.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", @@ -23131,6 +23198,18 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "packages/contentstack-audit/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "packages/contentstack-audit/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -23542,6 +23621,65 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "packages/contentstack-audit/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/contentstack-audit/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "packages/contentstack-audit/node_modules/sinon": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.0.tgz", + "integrity": "sha512-p4lJiYKBoOEVUxxVIC9H1MM2znG1/c8gud++I2BauJA5hsz7hHsst35eurNWXTusBsIq66FzOQbZ/uMdpvbPIQ==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.1.0", + "nise": "^5.1.5", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "packages/contentstack-audit/node_modules/sinon/node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "packages/contentstack-audit/node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "packages/contentstack-audit/node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -27207,6 +27345,7 @@ "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", + "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", @@ -27216,11 +27355,14 @@ "eslint-config-oclif-typescript": "^1.0.3", "fast-csv": "^4.3.6", "fs-extra": "^11.1.1", + "jest": "^29.7.0", "lodash": "^4.17.21", "mocha": "^10.2.0", "nyc": "^15.1.0", "oclif": "^3.10.0", "shx": "^0.3.4", + "sinon": "^17.0.0", + "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "tslib": "^2.5.3", "typescript": "^5.1.3", @@ -27277,6 +27419,25 @@ "minimatch": "^3.0.4" } }, + "@sinonjs/fake-timers": { + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.0" + } + }, + "@types/jest": { + "version": "29.5.6", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", + "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "20.5.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", @@ -27344,6 +27505,12 @@ "uri-js": "^4.2.2" } }, + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -27645,6 +27812,54 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + } + }, + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "sinon": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.0.tgz", + "integrity": "sha512-p4lJiYKBoOEVUxxVIC9H1MM2znG1/c8gud++I2BauJA5hsz7hHsst35eurNWXTusBsIq66FzOQbZ/uMdpvbPIQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.1.0", + "nise": "^5.1.5", + "supports-color": "^7.2.0" + }, + "dependencies": { + "diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -30364,51 +30579,51 @@ "dev": true }, "@jest/console": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.1.tgz", - "integrity": "sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" } }, "@jest/core": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.1.tgz", - "integrity": "sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "requires": { - "@jest/console": "^29.6.1", - "@jest/reporters": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.5.0", - "jest-config": "^29.6.1", - "jest-haste-map": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-resolve-dependencies": "^29.6.1", - "jest-runner": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", - "jest-watcher": "^29.6.1", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -30420,12 +30635,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -30439,73 +30654,73 @@ } }, "@jest/environment": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.1.tgz", - "integrity": "sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "requires": { - "@jest/fake-timers": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.1" + "jest-mock": "^29.7.0" } }, "@jest/expect": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.1.tgz", - "integrity": "sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "requires": { - "expect": "^29.6.1", - "jest-snapshot": "^29.6.1" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" } }, "@jest/expect-utils": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.1.tgz", - "integrity": "sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "requires": { - "jest-get-type": "^29.4.3" + "jest-get-type": "^29.6.3" } }, "@jest/fake-timers": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.1.tgz", - "integrity": "sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.1", - "jest-mock": "^29.6.1", - "jest-util": "^29.6.1" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "@jest/globals": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.1.tgz", - "integrity": "sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "requires": { - "@jest/environment": "^29.6.1", - "@jest/expect": "^29.6.1", - "@jest/types": "^29.6.1", - "jest-mock": "^29.6.1" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" } }, "@jest/reporters": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.1.tgz", - "integrity": "sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", @@ -30514,32 +30729,47 @@ "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", "v8-to-istanbul": "^9.0.1" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + } } }, "@jest/schemas": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", - "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "requires": { "@sinclair/typebox": "^0.27.8" } }, "@jest/source-map": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", - "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.18", @@ -30548,46 +30778,46 @@ } }, "@jest/test-result": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.1.tgz", - "integrity": "sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "requires": { - "@jest/console": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz", - "integrity": "sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "requires": { - "@jest/test-result": "^29.6.1", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" } }, "@jest/transform": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.1.tgz", - "integrity": "sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.1", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -30603,12 +30833,12 @@ } }, "@jest/types": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", - "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -31361,9 +31591,9 @@ } }, "@types/babel__core": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", - "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", + "integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", "dev": true, "requires": { "@babel/parser": "^7.20.7", @@ -31374,18 +31604,18 @@ } }, "@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.6", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", + "integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", + "integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -31393,9 +31623,9 @@ } }, "@types/babel__traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", - "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz", + "integrity": "sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==", "dev": true, "requires": { "@babel/types": "^7.20.7" @@ -31528,9 +31758,9 @@ } }, "@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.8.tgz", + "integrity": "sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==", "dev": true, "requires": { "@types/node": "*" @@ -31705,12 +31935,6 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "@types/prettier": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", - "dev": true - }, "@types/progress-stream": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/progress-stream/-/progress-stream-2.0.2.tgz", @@ -31778,9 +32002,9 @@ "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==" }, "@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", + "integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", "dev": true }, "@types/tar": { @@ -32434,15 +32658,15 @@ } }, "babel-jest": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.1.tgz", - "integrity": "sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "requires": { - "@jest/transform": "^29.6.1", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.5.0", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -32462,9 +32686,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", - "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -32494,12 +32718,12 @@ } }, "babel-preset-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", - "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^29.5.0", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" } }, @@ -33539,6 +33763,21 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + } + }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -33671,10 +33910,11 @@ } }, "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} }, "deep-eql": { "version": "4.1.3", @@ -35221,17 +35461,16 @@ "dev": true }, "expect": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.1.tgz", - "integrity": "sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "requires": { - "@jest/expect-utils": "^29.6.1", - "@types/node": "*", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" } }, "exponential-backoff": { @@ -37330,50 +37569,51 @@ } }, "jest": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz", - "integrity": "sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "requires": { - "@jest/core": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.6.1" + "jest-cli": "^29.7.0" } }, "jest-changed-files": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", - "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "requires": { "execa": "^5.0.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" } }, "jest-circus": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.1.tgz", - "integrity": "sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "requires": { - "@jest/environment": "^29.6.1", - "@jest/expect": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.1", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -37386,12 +37626,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37405,51 +37645,50 @@ } }, "jest-cli": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.1.tgz", - "integrity": "sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "requires": { - "@jest/core": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", - "prompts": "^2.0.1", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "yargs": "^17.3.1" } }, "jest-config": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.1.tgz", - "integrity": "sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.6.1", - "@jest/types": "^29.6.1", - "babel-jest": "^29.6.1", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.6.1", - "jest-environment-node": "^29.6.1", - "jest-get-type": "^29.4.3", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-runner": "^29.6.1", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -37473,12 +37712,12 @@ } }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37512,25 +37751,25 @@ } }, "jest-docblock": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", - "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "requires": { "detect-newline": "^3.0.0" } }, "jest-each": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.1.tgz", - "integrity": "sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "jest-util": "^29.6.1", - "pretty-format": "^29.6.1" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -37540,12 +37779,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37559,53 +37798,53 @@ } }, "jest-environment-node": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.1.tgz", - "integrity": "sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "requires": { - "@jest/environment": "^29.6.1", - "@jest/fake-timers": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.1", - "jest-util": "^29.6.1" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true }, "jest-haste-map": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.1.tgz", - "integrity": "sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "fsevents": "^2.3.2", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" } }, "jest-leak-detector": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz", - "integrity": "sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "requires": { - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -37615,12 +37854,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37634,15 +37873,15 @@ } }, "jest-matcher-utils": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz", - "integrity": "sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^29.6.1", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -37652,30 +37891,30 @@ "dev": true }, "diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "jest-diff": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", - "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" } }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37689,18 +37928,18 @@ } }, "jest-message-util": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.1.tgz", - "integrity": "sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -37712,12 +37951,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37731,14 +37970,14 @@ } }, "jest-mock": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.1.tgz", - "integrity": "sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.1" + "jest-util": "^29.7.0" } }, "jest-pnp-resolver": { @@ -37749,101 +37988,101 @@ "requires": {} }, "jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true }, "jest-resolve": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.1.tgz", - "integrity": "sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "requires": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.6.1", - "jest-validate": "^29.6.1", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" } }, "jest-resolve-dependencies": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz", - "integrity": "sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "requires": { - "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.6.1" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" } }, "jest-runner": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.1.tgz", - "integrity": "sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "requires": { - "@jest/console": "^29.6.1", - "@jest/environment": "^29.6.1", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.6.1", - "jest-haste-map": "^29.6.1", - "jest-leak-detector": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-resolve": "^29.6.1", - "jest-runtime": "^29.6.1", - "jest-util": "^29.6.1", - "jest-watcher": "^29.6.1", - "jest-worker": "^29.6.1", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" } }, "jest-runtime": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.1.tgz", - "integrity": "sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.1", - "@jest/fake-timers": "^29.6.1", - "@jest/globals": "^29.6.1", - "@jest/source-map": "^29.6.0", - "@jest/test-result": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-mock": "^29.6.1", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.1", - "jest-snapshot": "^29.6.1", - "jest-util": "^29.6.1", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" } }, "jest-snapshot": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.1.tgz", - "integrity": "sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "requires": { "@babel/core": "^7.11.6", @@ -37851,21 +38090,20 @@ "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.1", - "@jest/transform": "^29.6.1", - "@jest/types": "^29.6.1", - "@types/prettier": "^2.1.5", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.1", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.1", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.1", - "jest-message-util": "^29.6.1", - "jest-util": "^29.6.1", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.1", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "dependencies": { @@ -37876,30 +38114,30 @@ "dev": true }, "diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "jest-diff": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", - "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" } }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37913,12 +38151,12 @@ } }, "jest-util": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz", - "integrity": "sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -37927,17 +38165,17 @@ } }, "jest-validate": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.1.tgz", - "integrity": "sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "requires": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.6.1" + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -37953,12 +38191,12 @@ "dev": true }, "pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } @@ -37972,29 +38210,29 @@ } }, "jest-watcher": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.1.tgz", - "integrity": "sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "requires": { - "@jest/test-result": "^29.6.1", - "@jest/types": "^29.6.1", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.6.1", + "jest-util": "^29.7.0", "string-length": "^4.0.1" } }, "jest-worker": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.1.tgz", - "integrity": "sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "requires": { "@types/node": "*", - "jest-util": "^29.6.1", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } @@ -39627,9 +39865,9 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "nise": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.4.tgz", - "integrity": "sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", + "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", "requires": { "@sinonjs/commons": "^2.0.0", "@sinonjs/fake-timers": "^10.0.2", @@ -43141,9 +43379,9 @@ "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==" }, "pure-rand": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", - "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "dev": true }, "qs": { @@ -45385,14 +45623,22 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" }, "v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", + "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" + "convert-source-map": "^2.0.0" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + } } }, "validate-npm-package-license": { diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 57303f7a28..03b312b74a 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -30,19 +30,24 @@ "winston": "^3.10.0" }, "devDependencies": { + "@jest/globals": "^29.7.0", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", + "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", "eslint-config-oclif-typescript": "^1.0.3", + "jest": "^29.7.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "oclif": "^3.10.0", "shx": "^0.3.4", + "sinon": "^17.0.0", + "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "tslib": "^2.5.3", "typescript": "^5.1.3" diff --git a/packages/contentstack-audit/src/audit-base-command.ts b/packages/contentstack-audit/src/audit-base-command.ts index bb3f2262bb..248f79e9ac 100644 --- a/packages/contentstack-audit/src/audit-base-command.ts +++ b/packages/contentstack-audit/src/audit-base-command.ts @@ -280,11 +280,9 @@ export abstract class AuditBaseCommand extends BaseCommand { - throw error; - }); - + return new Promise((resolve, reject) => { + assetFileStream.on('error', reject); csvStream.pipe(assetFileStream).on('close', resolve).on('error', reject); const defaultColumns = Object.keys(OutputColumn); const userDefinedColumns = this.sharedConfig.flags.columns ? this.sharedConfig.flags.columns.split(',') : null; @@ -310,10 +308,11 @@ export abstract class AuditBaseCommand extends BaseCommand extends Command { registerConfig() { if (this.flags.config && existsSync(this.flags.config)) { try { - this.sharedConfig = JSON.parse(readFileSync(this.flags.config, { encoding: 'utf-8' })); + this.sharedConfig = merge( + this.sharedConfig, + JSON.parse(readFileSync(this.flags.config, { encoding: 'utf-8' })), + ); } catch (error) { this.log(error, 'error'); } diff --git a/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts b/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts index 065d1e91d1..ab23b96cad 100644 --- a/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts +++ b/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts @@ -44,7 +44,6 @@ export default class Audit extends AuditBaseCommand { await this.start('cm:stacks:audit'); } catch (error) { this.log(error instanceof Error ? error.message : error, 'error'); - console.trace(error); ux.action.stop('Process failed.!'); this.exit(1); } diff --git a/packages/contentstack-audit/src/util/index.ts b/packages/contentstack-audit/src/util/index.ts index 9666ec40d6..fbc476d9cf 100644 --- a/packages/contentstack-audit/src/util/index.ts +++ b/packages/contentstack-audit/src/util/index.ts @@ -1 +1 @@ -export { default as Logger } from "./log"; +export { default as Logger, print } from './log'; diff --git a/packages/contentstack-audit/src/util/log.ts b/packages/contentstack-audit/src/util/log.ts index 011be1ffa1..6414297788 100755 --- a/packages/contentstack-audit/src/util/log.ts +++ b/packages/contentstack-audit/src/util/log.ts @@ -1,6 +1,5 @@ import map from 'lodash/map'; import winston from 'winston'; -import { existsSync } from 'fs'; import chalk, { Chalk } from 'chalk'; import replace from 'lodash/replace'; import isObject from 'lodash/isObject'; @@ -61,36 +60,27 @@ export default class Logger { consoleOptions.level = logType; } - if (existsSync(this.config.basePath)) { - const filename = normalize(resolve(this.config.basePath, 'logs', `${logType}.log`)).replace( - /^(\.\.(\/|\\|$))+/, - '', - ); - const loggerOptions: winston.LoggerOptions = { - transports: [ - new winston.transports.File({ - ...this.loggerOptions, - level: logType, - filename, - }), - new winston.transports.Console(consoleOptions), - ], - levels: customLevels.levels, - }; - - if (logType === 'error') { - loggerOptions.levels = { error: 0 }; - } - - return winston.createLogger(loggerOptions); + const filename = normalize(resolve(this.config.basePath, 'logs', `${logType}.log`)).replace( + /^(\.\.(\/|\\|$))+/, + '', + ); + const loggerOptions: winston.LoggerOptions = { + transports: [ + new winston.transports.File({ + ...this.loggerOptions, + level: logType, + filename, + }), + new winston.transports.Console(consoleOptions), + ], + levels: customLevels.levels, + }; + + if (logType === 'error') { + loggerOptions.levels = { error: 0 }; } - winston - .createLogger({ - transports: [new winston.transports.Console(consoleOptions)], - }) - .error('Provided base path is not valid'); - throw new Error('Provided base path is not valid'); + return winston.createLogger(loggerOptions); } /** @@ -131,7 +121,7 @@ export default class Logger { const replaceCredentials = (item: any) => { try { - return JSON.stringify(item).replace(/authtoken":"abc................/g, 'authtoken":"abc....'); + return JSON.stringify(item).replace(/"authtoken":\s*".*?"/, '"authtoken": "..."'); } catch (error) {} return item; diff --git a/packages/contentstack-audit/test/unit/audit-base-command.test.ts b/packages/contentstack-audit/test/unit/audit-base-command.test.ts new file mode 100644 index 0000000000..a7f58feba0 --- /dev/null +++ b/packages/contentstack-audit/test/unit/audit-base-command.test.ts @@ -0,0 +1,361 @@ +import fs from 'fs'; +import winston from 'winston'; +import { resolve } from 'path'; +import { fancy } from 'fancy-test'; +import { PassThrough } from 'stream'; +import { expect } from '@oclif/test'; +import { ux, cliux } from '@contentstack/cli-utilities'; + +import { AuditBaseCommand } from '../../src/audit-base-command'; +import { ContentType, Entries, GlobalField } from '../../src/modules'; +import { FileTransportInstance } from 'winston/lib/winston/transports'; +import { $t, auditMsg } from '../../src/messages'; + +describe('AuditBaseCommand class', () => { + class AuditCMD extends AuditBaseCommand { + async run() { + await this.start('cm:stacks:audit'); + } + } + + class AuditFixCMD extends AuditBaseCommand { + async run() { + await this.start('cm:stacks:audit:fix'); + } + } + + describe('Audit command flow', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(fs, 'mkdirSync', () => {}) + .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'table', () => {}) + .stub(ux.action, 'stop', () => {}) + .stub(ux.action, 'start', () => {}) + .stub(Entries.prototype, 'run', () => ({ entry_1: {} })) + .stub(ContentType.prototype, 'run', () => ({ ct_1: {} })) + .stub(GlobalField.prototype, 'run', () => ({ gf_1: {} })) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should show audit report path', async (ctx) => { + await AuditCMD.run(['--data-dir', resolve(__dirname, 'mock', 'contents')]); + expect(ctx.stdout).to.includes('warn Reports ready. Please find the reports at'); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(fs, 'mkdirSync', () => {}) + .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'table', () => {}) + .stub(ux.action, 'stop', () => {}) + .stub(ux.action, 'start', () => {}) + .stub(cliux, 'inquire', () => resolve(__dirname, 'mock', 'contents')) + .stub(AuditBaseCommand.prototype, 'scanAndFix', () => ({ val_1: {} })) + .stub(Entries.prototype, 'run', () => ({ entry_1: {} })) + .stub(ContentType.prototype, 'run', () => ({ ct_1: {} })) + .stub(GlobalField.prototype, 'run', () => ({ gf_1: {} })) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should print info of no ref found', async (ctx) => { + await AuditCMD.run([]); + expect(ctx.stdout).to.includes('info No missing references found.'); + }); + }); + + describe('Audit fix command flow', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(fs, 'mkdirSync', () => {}) + .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'table', (...args: any) => { + args[1].missingRefs.get({ missingRefs: ['gf_0'] }); + }) + .stub(ux.action, 'stop', () => {}) + .stub(ux.action, 'start', () => {}) + .stub(Entries.prototype, 'run', () => ({ + entry_1: { + name: 'T1', + display_name: 'T1', + data_type: 'reference', + missingRefs: ['gf_0'], + treeStr: 'T1 -> gf_0', + }, + })) + .stub(ContentType.prototype, 'run', () => ({ ct_1: {} })) + .stub(GlobalField.prototype, 'run', () => ({ gf_1: {} })) + .stub(fs, 'createBackUp', () => {}) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .stub(AuditBaseCommand.prototype, 'createBackUp', () => {}) + .it('should print missing ref and fix status on table formate', async (ctx) => { + await AuditFixCMD.run(['--data-dir', resolve(__dirname, 'mock', 'contents')]); + expect(ctx.stdout).to.includes('warn You can locate the fixed content at'); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .it('return the status column object ', async () => { + class FixCMD extends AuditBaseCommand { + async run() { + return this.fixStatus; + } + } + const res = await FixCMD.run(['--data-dir', resolve(__dirname, 'mock', 'contents')]); + + expect(res.fixStatus).ownProperty('header'); + expect(res.fixStatus.header).to.be.include('Fix Status'); + expect(res.fixStatus.get({ fixStatus: 'Fixed' })).to.be.include('Fixed'); + expect(res.fixStatus.get({ fixStatus: 'Not Fixed' })).to.be.include('Not Fixed'); + }); + }); + + describe('createBackUp method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(AuditBaseCommand.prototype, 'promptQueue', async () => {}) + .stub(AuditBaseCommand.prototype, 'scanAndFix', async () => ({})) + .stub(AuditBaseCommand.prototype, 'showOutputOnScreen', () => {}) + .stub(fs, 'mkdirSync', () => {}) + .stub(require('fs-extra'), 'copy', () => {}) + .it('should create backup dir', async () => { + class CMD extends AuditBaseCommand { + async run() { + this.sharedConfig.flags.modules = []; + const mockPath = resolve(__dirname, 'mock', 'contents'); + this.flags['copy-dir'] = true; + this.flags['data-dir'] = mockPath; + this.flags['report-path'] = mockPath; + this.sharedConfig.basePath = mockPath; + this.sharedConfig.reportPath = mockPath; + await this.start('cm:stacks:audit:fix'); + return this.sharedConfig.basePath; + } + } + + expect(await CMD.run([])).to.includes('test/unit/mock'); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(AuditBaseCommand.prototype, 'promptQueue', async () => {}) + .stub(AuditBaseCommand.prototype, 'scanAndFix', async () => ({})) + .stub(AuditBaseCommand.prototype, 'showOutputOnScreen', () => {}) + .stub(fs, 'mkdirSync', () => {}) + .stub(require('fs-extra'), 'copy', () => {}) + .it('should create backup dir', async () => { + class CMD extends AuditBaseCommand { + async run() { + this.sharedConfig.flags.modules = []; + const mockPath = resolve(__dirname, 'mock', 'contents'); + this.flags['copy-dir'] = true; + this.flags['data-dir'] = mockPath; + this.flags['report-path'] = mockPath; + this.sharedConfig.basePath = resolve(__dirname, 'mock', 'contents-1'); + this.sharedConfig.reportPath = mockPath; + await this.start('cm:stacks:audit:fix'); + return this.sharedConfig.basePath; + } + } + + try { + await CMD.run([]); + } catch (error: any) { + expect(error.message).to.include( + $t(auditMsg.NOT_VALID_PATH, { path: resolve(__dirname, 'mock', 'contents-1') }), + ); + } + }); + }); + + describe('prepareCSV method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should print missing ref and fix status on table formate', async () => { + class CMD extends AuditBaseCommand { + async run() { + this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents'); + return this.prepareCSV('content-types', { + t1: { + name: 'T1', + display_name: 'T1', + data_type: 'reference', + missingRefs: ['gf_0'], + treeStr: 'T1 -> gf_0', + }, + t2: { + name: 'T2', + display_name: 'T2', + data_type: 'reference', + missingRefs: ['gf_0'], + treeStr: 'T2 -> gf_0', + }, + }); + } + } + + expect(await CMD.run([])).to.be.undefined; + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should apply filter on output', async () => { + class CMD extends AuditBaseCommand { + async run() { + // this.currentCommand = 'cm:stacks:audit:fix'; + this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents'); + this.sharedConfig.flags.columns = 'Path'; + this.sharedConfig.flags.filter = 'Title=T1'; + return this.prepareCSV('content-types', { + t1: { + name: 'T1', + display_name: 'T1', + data_type: 'reference', + missingRefs: ['gf_0'], + treeStr: 'T1 -> gf_0', + }, + t2: { + name: 'T2', + display_name: 'T2', + data_type: 'reference', + missingRefs: ['gf_0'], + treeStr: 'T2 -> gf_0', + }, + }); + } + } + + expect(await CMD.run([])).to.be.undefined; + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + // .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should fail with error', async () => { + class CMD extends AuditBaseCommand { + async run() { + this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents-1'); + this.sharedConfig.flags.columns = 'Path'; + this.sharedConfig.flags.filter = 'Title=T1'; + return this.prepareCSV('content-types', { t1: {}, t2: {} }); + } + } + + try { + await CMD.run([]); + } catch (error: any) { + // ENOENT: no such file or directory, open '/Users/antony.raj/Documents/code/cli/packages/contentstack-audit/test/unit/mock/contents-1/content-types.csv' + expect(error.message).to.be.include( + `ENOENT: no such file or directory, open '${resolve(__dirname, 'mock', 'contents-1')}/content-types.csv'`, + ); + } + }); + }); + + describe('getCtAndGfSchema method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .stub(fs, 'createWriteStream', () => new PassThrough()) + .it('should log error and return empty array', async () => { + class CMD extends AuditBaseCommand { + async run() { + this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents-1'); + return this.getCtAndGfSchema(); + } + } + + expect(await CMD.run([])).to.be.deep.include({ + ctSchema: [], + gfSchema: [], + }); + }); + }); +}); diff --git a/packages/contentstack-audit/test/unit/base-command.test.ts b/packages/contentstack-audit/test/unit/base-command.test.ts new file mode 100644 index 0000000000..af88694ba4 --- /dev/null +++ b/packages/contentstack-audit/test/unit/base-command.test.ts @@ -0,0 +1,82 @@ +import winston from 'winston'; +import { resolve } from 'path'; +import { fancy } from 'fancy-test'; +import { expect } from '@oclif/test'; +import { FileTransportInstance } from 'winston/lib/winston/transports'; + +import { BaseCommand } from '../../src/base-command'; + +describe('BaseCommand class', () => { + class Command extends BaseCommand { + async run() { + this.parse(); + this.log('Test log'); + } + } + + describe('command', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .do(() => Command.run([])) + .do((output) => expect(output.stdout).to.equal('Test log\n')) + .it('logs to stdout'); + + fancy + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .do(() => { + class CMD extends BaseCommand { + async run() { + throw new Error('new error'); + } + } + + return CMD.run([]); + }) + .catch(/new error/) + .it('errors out'); + }); + + describe('validate config file', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log })) + .it('should log error', async (ctx) => { + class CMD extends BaseCommand { + async run() { + const { flags } = await this.parse(CMD); + this.log(flags.config); + } + } + + const configPath = resolve(__dirname, 'mock', 'invalid-config.json'); + + await CMD.run([`--config=${configPath}`]); + expect(ctx.stdout).to.include('not valid JSON'); + }); + }); +}); diff --git a/packages/contentstack-audit/test/unit/commands/fix.test.ts b/packages/contentstack-audit/test/unit/commands/fix.test.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/contentstack-audit/test/unit/commands/index.test.ts b/packages/contentstack-audit/test/unit/commands/index.test.ts new file mode 100644 index 0000000000..5cb06b1ca5 --- /dev/null +++ b/packages/contentstack-audit/test/unit/commands/index.test.ts @@ -0,0 +1,66 @@ +import sinon from 'sinon'; +import winston from 'winston'; +import { expect, test } from '@oclif/test'; +import { FileTransportInstance } from 'winston/lib/winston/transports'; +import { AuditBaseCommand } from '../../../src/audit-base-command'; + +describe('Audit command', () => { + afterEach(() => { + sinon.restore(); + }); + + describe('Audit run method', () => { + test + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .stub(AuditBaseCommand.prototype, 'start', () => {}) + .command(['cm:stacks:audit']) + .it('should trigger AuditBaseCommand start method', ({ stdout }) => { + expect(stdout).to.be.string; + }); + + test + .stderr({ print: false }) + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(AuditBaseCommand.prototype, 'start', () => Promise.reject('process failed')) + .command(['cm:stacks:audit']) + .exit(1) + .it('should log any error and exit with status code 1'); + + test + .stderr({ print: false }) + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) + .stub(AuditBaseCommand.prototype, 'start', () => { + throw Error('process failed'); + }) + .command(['cm:stacks:audit']) + .exit(1) + .it('should log the error objet message and exit with status code 1'); + }); +}); diff --git a/packages/contentstack-audit/test/unit/messages/index.test.ts b/packages/contentstack-audit/test/unit/messages/index.test.ts new file mode 100644 index 0000000000..f66e8f063a --- /dev/null +++ b/packages/contentstack-audit/test/unit/messages/index.test.ts @@ -0,0 +1,24 @@ +import { fancy } from 'fancy-test'; +import { expect } from '@oclif/test'; + +import { $t, auditMsg } from '../../../src/messages'; + +describe('messages utility', () => { + describe('$t method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .it('should replace the placeholder in the string with provided value', () => { + expect($t(auditMsg.AUDIT_START_SPINNER, { module: 'content-types' })).to.include( + auditMsg.AUDIT_START_SPINNER.replace(new RegExp(`{module}`, 'g'), 'content-types'), + ); + }); + }); + + describe('$t method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .it('should return if the provided string is empty', () => { + expect($t('', {})).to.be.empty.string; + }); + }); +}); diff --git a/packages/contentstack-audit/test/unit/mock/config.json b/packages/contentstack-audit/test/unit/mock/config.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/packages/contentstack-audit/test/unit/mock/config.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/contentstack-audit/test/unit/mock/contents/.DS_Store b/packages/contentstack-audit/test/unit/mock/contents/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f8330e40d8f41e4035e585f734c5c063af5f6130 GIT binary patch literal 6148 zcmeHK%}T>S5T4b7MJ@CoD2T9+VBa8?c=RBBfNGjH3TadPIe5#>liAHuv-$GD?qrF`v@hcpQIm-3aK_pynh%WU*(kPAZZu6tce0G^n zgAz)iXhg@rE)5*7l;T-Ew>f-4bdl$Da=$Z;M9;bF7dd||qs-qjf3^Ri0BSZ{ea)k` zs(>n>3cM-6=Yxea27hyfZV`T;RIc>076l_Xq9Z(`&e9n8*m`rd_aUmVpkzF zBiU~}za&qJ?I9vwy=-ctB@tB^f-K5}h zJ<^t*Y4rZ*7eD=nu4&qR*TP=CFYc~h+qau>%;wjae)pZHYm^8H27-ZLAQ%V+j=})W zY?12BFy>$&7zhTw7?AxTVF+f&VyIgOCT#(La*bAjF1>{0B**Mn4B>&Wr2;LLy~SWl zhdp^*b}WXLPVCJG`;$ML7uKhve$sH_Y#4Je5DW|%nAvhE=l?B!naL)9m=ddCAQ<>( z4Dh^JH!FOUpRJ?Mle0EqJYa}OToDBVeQ*iDLiUkMb(%kkj=1bt45f { + type CtType = ContentTypeStruct | GlobalFieldDataType | ModularBlockType | GroupFieldDataType; + + let constructorParam: ModuleConstructorParam & CtConstructorParam; + + beforeEach(() => { + constructorParam = { + log: () => {}, + moduleName: 'content-types', + ctSchema: cloneDeep(require('../mock/contents/content_types/schema.json')), + gfSchema: cloneDeep(require('../mock/contents/global_fields/globalfields.json')), + config: Object.assign(config, { basePath: resolve(__dirname, '..', 'mock', 'contents'), flags: {} }), + }; + }); + + afterEach(() => { + sinon.restore(); + }); + + describe('run method', () => { + fancy.stdout({ print: process.env.PRINT === 'true' || false }).it('should validate base path', async () => { + const ctInstance = new ContentType({ + ...constructorParam, + config: { ...constructorParam.config, basePath: resolve(__dirname, '..', 'mock', 'contents-1') }, + }); + try { + await ctInstance.run(); + } catch (error: any) { + expect(error).to.be.instanceOf(Error); + expect(error.message).to.eql($t(auditMsg.NOT_VALID_PATH, { path: ctInstance.folderPath })); + } + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'lookForReference', async () => {}) + .it('should call lookForReference', async () => { + const ctInstance = new ContentType(constructorParam); + const logSpy = sinon.spy(ctInstance, 'lookForReference'); + await ctInstance.run(); + expect(logSpy.callCount).to.be.equals(ctInstance.ctSchema.length); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'lookForReference', async () => {}) + .it('should not break if empty schema passed', async () => { + const ctInstance = new ContentType({ ...constructorParam, ctSchema: undefined as any }); + expect(await ctInstance.run(true)).to.be.undefined; + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'lookForReference', async () => {}) + .it('should return schema', async () => { + const ctInstance = new ContentType(constructorParam); + expect(await ctInstance.run(true)).to.deep.equals(ctInstance.ctSchema); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'lookForReference', async () => {}) + .stub(ContentType.prototype, 'writeFixContent', async () => {}) + .it('should call writeFixContent', async () => { + const ctInstance = new ContentType({ ...constructorParam, fix: true }); + const logSpy = sinon.spy(ctInstance, 'writeFixContent'); + await ctInstance.run(); + expect(logSpy.callCount).to.be.equals(1); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'writeFixContent', async () => {}) + .it('perform audit operation on the given CT schema', async () => { + const ctInstance = new (class TempClass extends ContentType { + constructor(public missingRefs: Record = {}) { + super(constructorParam); + this.currentUid = 'gf'; + this.missingRefs['gf'] = []; + } + })(); + + await ctInstance.run(); + + expect(ctInstance.missingRefs).ownProperty('page_1'); + expect(JSON.stringify(ctInstance.missingRefs)).includes('"missingRefs":["page_0"]'); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'writeFixContent', async () => {}) + .it('perform audit and fix operation on the given CT schema', async () => { + const ctInstance = new (class TempClass extends ContentType { + constructor(public missingRefs: Record = {}) { + super({ ...constructorParam, fix: true, moduleName: undefined }); + this.currentUid = 'gf'; + this.missingRefs['gf'] = []; + } + })(); + + expect(JSON.stringify(await ctInstance.run(true))).includes( + '"display_name":"Reference","reference_to":["page_4","page_3","page_2","page_1"]', + ); + }); + }); + + describe('writeFixContent method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(fs, 'writeFileSync', () => {}) + .it('should not write the file', async () => { + const ctInstance = new ContentType(constructorParam); + const logSpy = sinon.spy(fs, 'writeFileSync'); + await ctInstance.writeFixContent(); + expect(logSpy.callCount).to.be.equals(1); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(fs, 'writeFileSync', () => {}) + .it('should prompt and ask confirmation', async () => { + sinon.replace(ux, 'confirm', async () => false); + const ctInstance = new ContentType({ ...constructorParam, fix: true }); + const spy = sinon.spy(ux, 'confirm'); + await ctInstance.writeFixContent(); + expect(spy.callCount).to.be.equals(1); + }); + }); + + describe('lookForReference method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'validateReferenceField', () => []) + .stub(ContentType.prototype, 'validateGlobalField', () => []) + .stub(ContentType.prototype, 'validateJsonRTEFields', () => []) + .stub(ContentType.prototype, 'validateGroupField', () => []) + .stub(ContentType.prototype, 'validateModularBlocksField', () => []) + .it('should call all CT type audit methods', async () => { + const ctInstance = new (class TempClass extends ContentType { + constructor() { + super(constructorParam); + this.currentUid = 'test'; + this.missingRefs['test'] = []; + } + })(); + const validateReferenceFieldSpy = sinon.spy(ctInstance, 'validateReferenceField'); + const validateGlobalFieldSpy = sinon.spy(ctInstance, 'validateGlobalField'); + const validateJsonRTEFieldsSpy = sinon.spy(ctInstance, 'validateJsonRTEFields'); + const validateModularBlocksFieldSpy = sinon.spy(ctInstance, 'validateModularBlocksField'); + const validateGroupFieldSpy = sinon.spy(ctInstance, 'validateGroupField'); + + // NOTE dummy CT schema + const schema = [ + { data_type: 'reference', uid: 'ref', display_name: 'Ref' }, + { data_type: 'global_field' }, + { data_type: 'json', field_metadata: { allow_json_rte: true } }, + { data_type: 'blocks' }, + { data_type: 'group' }, + ]; + await ctInstance.lookForReference([], { schema } as unknown as CtType); + + expect(validateReferenceFieldSpy.callCount).to.be.equals(1); + expect(validateGlobalFieldSpy.callCount).to.be.equals(1); + expect(validateJsonRTEFieldsSpy.callCount).to.be.equals(1); + expect(validateModularBlocksFieldSpy.callCount).to.be.equals(1); + expect(validateGroupFieldSpy.callCount).to.be.equals(1); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'runFixOnSchema', () => []) + .it('should call runFixOnSchema method', async () => { + const ctInstance = new ContentType({ ...constructorParam, fix: true }); + const validateReferenceFieldSpy = sinon.spy(ctInstance, 'runFixOnSchema'); + await ctInstance.lookForReference([], { schema: [] } as unknown as CtType); + + expect(validateReferenceFieldSpy.callCount).to.be.equals(1); + }); + }); + + describe('validateReferenceField method', () => { + fancy.stdout({ print: process.env.PRINT === 'true' || false }).it('should return missing reference', async () => { + const ctInstance = new ContentType(constructorParam); + const [, , , page1Ct] = ctInstance.ctSchema as CtType[]; + const [, , , , refField] = page1Ct.schema ?? []; + + const res = await ctInstance.validateReferenceField( + [{ uid: refField.uid, name: refField.display_name }], + refField as ReferenceFieldDataType, + ); + + console.log(res, constructorParam); + + expect( + JSON.stringify( + await ctInstance.validateReferenceField( + [{ uid: refField.uid, name: refField.display_name }], + refField as ReferenceFieldDataType, + ), + ), + ).includes('"missingRefs":["page_0"]'); + }); + }); + + describe('validateGlobalField method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'runFixOnSchema', () => {}) + .it('should call lookForReference method', async () => { + const ctInstance = new (class TempClass extends ContentType { + constructor(public missingRefs: Record = {}) { + super(constructorParam); + this.currentUid = 'gf'; + this.missingRefs['gf'] = []; + } + })(); + + const lookForReferenceSpy = sinon.spy(ctInstance, 'lookForReference'); + const [, , , page1Ct] = ctInstance.ctSchema as CtType[]; + const [, gf] = page1Ct.schema as [unknown, GlobalFieldDataType]; + await ctInstance.validateGlobalField([{ uid: gf.uid, name: gf.display_name }], gf); + + expect(lookForReferenceSpy.called).to.be.true; + expect(JSON.stringify(ctInstance.missingRefs)).to.be.include('"missingRefs":["page_0"]'); + }); + }); +}); diff --git a/packages/contentstack-audit/test/unit/util/log.test.ts b/packages/contentstack-audit/test/unit/util/log.test.ts new file mode 100644 index 0000000000..1d26f93a7c --- /dev/null +++ b/packages/contentstack-audit/test/unit/util/log.test.ts @@ -0,0 +1,112 @@ +import sinon from 'sinon'; +import winston from 'winston'; +import { resolve } from 'path'; +import { fancy } from 'fancy-test'; +import { expect } from '@oclif/test'; +import { cliux as ux } from '@contentstack/cli-utilities'; +import { FileTransportInstance } from 'winston/lib/winston/transports'; + +import { Logger, print } from '../../../src/util'; + +describe('Log utility', () => { + afterEach(() => { + sinon.restore(); + }); + + describe('Stubbing winston createLogger', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .it('should create logger instance', () => { + sinon.replace(winston, 'createLogger', () => ({} as unknown as winston.Logger)); + const logSpy = sinon.spy(winston, 'createLogger'); + new Logger({ basePath: resolve(__dirname, '..', 'mock') }); + expect(logSpy.callCount).to.be.equals(2); + }); + }); + + describe('Stubbing winston logger method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ux, 'print', () => {}) + .stub( + winston.transports, + 'File', + () => (class FsTransport { + constructor() {} + }) as FileTransportInstance) + .it('should log message', () => { + const logSpy = sinon.spy(); + sinon.stub(winston, 'createLogger').returns({ log: logSpy, error: logSpy } as unknown as winston.Logger); + const logger = new Logger({ basePath: resolve(__dirname, '..', 'mock') }); + logger.log('Simple log'); + logger.log('Info log', 'info'); + logger.log('Error log', 'error'); + expect(logSpy.args).deep.equal([['info', 'Info log'], ['Error log']]); + }); + }); + + describe('Replace sensitive data before log', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + constructor() {} + } as FileTransportInstance, + ) + .stub(ux, 'print', () => {}) + .stub(winston, 'createLogger', () => {}) + .it('should remove any credentials before log message', () => { + const logSpy = sinon.spy(); + sinon.replace(winston, 'createLogger', () => ({} as unknown as winston.Logger)); + sinon.stub(winston, 'createLogger').callsFake( + () => + ({ + log: logSpy, + error: logSpy + } as unknown as winston.Logger), + ); + const logger = new Logger({ basePath: resolve(__dirname, '..', 'mock') }); + + let circularObject: any = {}; + circularObject.myself = circularObject; + logger.log(['Test'], 'info'); + logger.log({ authtoken: 'test token' }, 'info'); + logger.log([{ authtoken: 'test token' }], 'info'); + logger.log(circularObject, 'error'); + + expect(logSpy.calledWith(circularObject)).to.be.true; + expect(logSpy.args[1]).to.deep.equals(['info', '{"authtoken": "..."}']); + }); + }); + + describe('Stubbing print method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .do(() => { + print([ + { + message: 'test', + }, + { + bold: true, + color: 'cyan', + message: 'message', + }, + ]); + }) + .it('print method should apply given styles on the message', ({ stdout }) => { + expect(stdout).to.includes('test message') + }); + }); +}); diff --git a/packages/contentstack-import/src/utils/logger.ts b/packages/contentstack-import/src/utils/logger.ts index 207f89766d..94d73d7318 100644 --- a/packages/contentstack-import/src/utils/logger.ts +++ b/packages/contentstack-import/src/utils/logger.ts @@ -23,7 +23,7 @@ function returnString(args: any[]) { .map(function (item) { if (item && typeof item === 'object') { try { - return JSON.stringify(item).replace(/authtoken\":\d"blt................/g, 'authtoken":"blt....'); + return JSON.stringify(item).replace(/authtoken\":\d".................../g, 'authtoken":"blt....'); } catch (error) {} return item; } From f709d989e230a9397e3ae984042c4325bb7da7bc Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 7 Nov 2023 10:50:15 +0530 Subject: [PATCH 02/27] Package updates --- package-lock.json | 80 ----- packages/contentstack-audit/package.json | 3 - .../src/modules/content-types.ts | 4 +- pnpm-lock.yaml | 306 +++++++++++++++++- 4 files changed, 301 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e2919414f..9d41d8b135 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22987,18 +22987,15 @@ "audit": "bin/run" }, "devDependencies": { - "@jest/globals": "^29.7.0", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", - "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", "eslint-config-oclif-typescript": "^1.0.3", - "jest": "^29.7.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "oclif": "^3.10.0", @@ -23078,16 +23075,6 @@ "@sinonjs/commons": "^3.0.0" } }, - "packages/contentstack-audit/node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", - "dev": true, - "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "packages/contentstack-audit/node_modules/@types/node": { "version": "20.5.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", @@ -23198,18 +23185,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "packages/contentstack-audit/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "packages/contentstack-audit/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -23621,26 +23596,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "packages/contentstack-audit/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "packages/contentstack-audit/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "packages/contentstack-audit/node_modules/sinon": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.0.tgz", @@ -27345,7 +27300,6 @@ "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", - "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", @@ -27355,7 +27309,6 @@ "eslint-config-oclif-typescript": "^1.0.3", "fast-csv": "^4.3.6", "fs-extra": "^11.1.1", - "jest": "^29.7.0", "lodash": "^4.17.21", "mocha": "^10.2.0", "nyc": "^15.1.0", @@ -27428,16 +27381,6 @@ "@sinonjs/commons": "^3.0.0" } }, - "@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", - "dev": true, - "requires": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "@types/node": { "version": "20.5.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", @@ -27505,12 +27448,6 @@ "uri-js": "^4.2.2" } }, - "ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true - }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -27812,23 +27749,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "requires": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - } - }, - "react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "sinon": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.0.tgz", diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 03b312b74a..ba2628f46b 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -30,18 +30,15 @@ "winston": "^3.10.0" }, "devDependencies": { - "@jest/globals": "^29.7.0", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", - "@types/jest": "^29.5.6", "@types/node": "^20.3.1", "@types/uuid": "^9.0.4", "chai": "^4.3.7", "eslint": "^8.43.0", "eslint-config-oclif": "^4.0.0", "eslint-config-oclif-typescript": "^1.0.3", - "jest": "^29.7.0", "mocha": "^10.2.0", "nyc": "^15.1.0", "oclif": "^3.10.0", diff --git a/packages/contentstack-audit/src/modules/content-types.ts b/packages/contentstack-audit/src/modules/content-types.ts index 6cc957c66f..05f574d611 100644 --- a/packages/contentstack-audit/src/modules/content-types.ts +++ b/packages/contentstack-audit/src/modules/content-types.ts @@ -1,8 +1,8 @@ import find from 'lodash/find'; -import { ux } from '@oclif/core'; import isEmpty from 'lodash/isEmpty'; import { join, resolve } from 'path'; import { existsSync, writeFileSync } from 'fs'; +import { ux } from '@contentstack/cli-utilities'; import { LogFn, @@ -98,7 +98,7 @@ export default class ContentType { let canWrite = true; if (this.fix && !this.config.flags['copy-dir']) { - canWrite = this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)); + canWrite = this.config.flags.yes ?? (await ux.confirm(commonMsg.FIX_CONFIRMATION)); } if (canWrite) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43a17ef609..20e8a43863 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,6 +142,8 @@ importers: nyc: ^15.1.0 oclif: ^3.10.0 shx: ^0.3.4 + sinon: ^17.0.0 + ts-jest: ^29.1.1 ts-node: ^10.9.1 tslib: ^2.5.3 typescript: ^5.1.3 @@ -172,6 +174,8 @@ importers: nyc: 15.1.0 oclif: 3.17.1_eyayto62fyd4eo5o5fvolpu7d4 shx: 0.3.4 + sinon: 17.0.1 + ts-jest: 29.1.1_typescript@5.2.2 ts-node: 10.9.1_eyayto62fyd4eo5o5fvolpu7d4 tslib: 2.6.0 typescript: 5.2.2 @@ -1857,6 +1861,16 @@ packages: jest-mock: 29.6.1 dev: true + /@jest/environment/29.7.0: + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.6.5 + jest-mock: 29.7.0 + dev: true + /@jest/expect-utils/29.6.1: resolution: {integrity: sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1864,6 +1878,13 @@ packages: jest-get-type: 29.4.3 dev: true + /@jest/expect-utils/29.7.0: + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.6.3 + dev: true + /@jest/expect/29.6.1: resolution: {integrity: sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1874,6 +1895,16 @@ packages: - supports-color dev: true + /@jest/expect/29.7.0: + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/fake-timers/29.6.1: resolution: {integrity: sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1886,14 +1917,26 @@ packages: jest-util: 29.6.1 dev: true - /@jest/globals/29.6.1: - resolution: {integrity: sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A==} + /@jest/fake-timers/29.7.0: + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.6.1 - '@jest/expect': 29.6.1 - '@jest/types': 29.6.1 - jest-mock: 29.6.1 + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 20.6.5 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + dev: true + + /@jest/globals/29.7.0: + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 transitivePeerDependencies: - supports-color dev: true @@ -1942,6 +1985,13 @@ packages: '@sinclair/typebox': 0.27.8 dev: true + /@jest/schemas/29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jest/source-map/29.6.0: resolution: {integrity: sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1994,6 +2044,29 @@ packages: - supports-color dev: true + /@jest/transform/29.7.0: + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.22.9 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.18 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.5 + pirates: 4.0.6 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/types/26.6.2: resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} engines: {node: '>= 10.14.2'} @@ -2017,6 +2090,18 @@ packages: chalk: 4.1.2 dev: true + /@jest/types/29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 20.6.5 + '@types/yargs': 17.0.24 + chalk: 4.1.2 + dev: true + /@jridgewell/gen-mapping/0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -3284,6 +3369,12 @@ packages: dependencies: '@sinonjs/commons': 3.0.0 + /@sinonjs/fake-timers/11.2.2: + resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} + dependencies: + '@sinonjs/commons': 3.0.0 + dev: true + /@sinonjs/fake-timers/7.1.2: resolution: {integrity: sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==} dependencies: @@ -5710,6 +5801,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /diff-sequences/29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /diff/4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -6605,6 +6701,17 @@ packages: jest-util: 29.6.1 dev: true + /expect/29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + dev: true + /exponential-backoff/3.1.1: resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} dev: true @@ -8308,6 +8415,16 @@ packages: pretty-format: 29.6.1 dev: true + /jest-diff/29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + /jest-docblock/29.4.3: resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8348,6 +8465,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /jest-get-type/29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /jest-haste-map/29.6.1: resolution: {integrity: sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8367,6 +8489,25 @@ packages: fsevents: 2.3.2 dev: true + /jest-haste-map/29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.6 + '@types/node': 20.6.5 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /jest-leak-detector/29.6.1: resolution: {integrity: sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8385,6 +8526,16 @@ packages: pretty-format: 29.6.1 dev: true + /jest-matcher-utils/29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + /jest-message-util/29.6.1: resolution: {integrity: sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8400,6 +8551,21 @@ packages: stack-utils: 2.0.6 dev: true + /jest-message-util/29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.22.5 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + /jest-mock/29.6.1: resolution: {integrity: sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8409,6 +8575,15 @@ packages: jest-util: 29.6.1 dev: true + /jest-mock/29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.6.5 + jest-util: 29.7.0 + dev: true + /jest-pnp-resolver/1.2.3_jest-resolve@29.6.1: resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} @@ -8426,6 +8601,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /jest-regex-util/29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /jest-resolve-dependencies/29.6.1: resolution: {integrity: sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8486,7 +8666,7 @@ packages: dependencies: '@jest/environment': 29.6.1 '@jest/fake-timers': 29.6.1 - '@jest/globals': 29.6.1 + '@jest/globals': 29.7.0 '@jest/source-map': 29.6.0 '@jest/test-result': 29.6.1 '@jest/transform': 29.6.1 @@ -8539,6 +8719,34 @@ packages: - supports-color dev: true + /jest-snapshot/29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.22.9 + '@babel/generator': 7.22.9 + '@babel/plugin-syntax-jsx': 7.22.5_@babel+core@7.22.9 + '@babel/plugin-syntax-typescript': 7.22.5_@babel+core@7.22.9 + '@babel/types': 7.22.5 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.22.9 + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + dev: true + /jest-util/29.6.1: resolution: {integrity: sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8551,6 +8759,18 @@ packages: picomatch: 2.3.1 dev: true + /jest-util/29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.6.5 + chalk: 4.1.2 + ci-info: 3.8.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: true + /jest-validate/29.6.1: resolution: {integrity: sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -8587,6 +8807,16 @@ packages: supports-color: 8.1.1 dev: true + /jest-worker/29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 20.6.5 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + /jest/29.6.1: resolution: {integrity: sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -9738,6 +9968,16 @@ packages: just-extend: 4.2.1 path-to-regexp: 1.8.0 + /nise/5.1.5: + resolution: {integrity: sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==} + dependencies: + '@sinonjs/commons': 2.0.0 + '@sinonjs/fake-timers': 10.3.0 + '@sinonjs/text-encoding': 0.7.2 + just-extend: 4.2.1 + path-to-regexp: 1.8.0 + dev: true + /nock/13.3.2: resolution: {integrity: sha512-CwbljitiWJhF1gL83NbanhoKs1l23TDlRioNraPTZrzZIEooPemrHRj5m0FZCPkB1ecdYCSWWGcHysJgX/ngnQ==} engines: {node: '>= 10.13'} @@ -11069,6 +11309,15 @@ packages: react-is: 18.2.0 dev: true + /pretty-format/29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /proc-log/1.0.0: resolution: {integrity: sha512-aCk8AO51s+4JyuYGg3Q/a6gnrlDO09NpVWePtjp7xwphcoQ04x5WAfCyugcsbLooWcMJ87CLkD4+604IckEdhg==} dev: true @@ -11840,6 +12089,17 @@ packages: nise: 5.1.4 supports-color: 7.2.0 + /sinon/17.0.1: + resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} + dependencies: + '@sinonjs/commons': 3.0.0 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.0 + diff: 5.1.0 + nise: 5.1.5 + supports-color: 7.2.0 + dev: true + /sisteransi/1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} dev: true @@ -12438,6 +12698,38 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest/29.1.1_typescript@5.2.2: + resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest-util: 29.6.1 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.5.4 + typescript: 5.2.2 + yargs-parser: 21.1.1 + dev: true + /ts-node/10.9.1: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true From 661ffff5ece09a9724b609cd2f6bab86e4027b8d Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 7 Nov 2023 13:30:22 +0530 Subject: [PATCH 03/27] Reverted import logger change, .DS_Store file removed --- .../test/unit/mock/contents/.DS_Store | Bin 6148 -> 0 bytes .../test/unit/mock/contents/entries/.DS_Store | Bin 6148 -> 0 bytes packages/contentstack-import/src/utils/logger.ts | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 packages/contentstack-audit/test/unit/mock/contents/.DS_Store delete mode 100644 packages/contentstack-audit/test/unit/mock/contents/entries/.DS_Store diff --git a/packages/contentstack-audit/test/unit/mock/contents/.DS_Store b/packages/contentstack-audit/test/unit/mock/contents/.DS_Store deleted file mode 100644 index f8330e40d8f41e4035e585f734c5c063af5f6130..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T4b7MJ@CoD2T9+VBa8?c=RBBfNGjH3TadPIe5#>liAHuv-$GD?qrF`v@hcpQIm-3aK_pynh%WU*(kPAZZu6tce0G^n zgAz)iXhg@rE)5*7l;T-Ew>f-4bdl$Da=$Z;M9;bF7dd||qs-qjf3^Ri0BSZ{ea)k` zs(>n>3cM-6=Yxea27hyfZV`T;RIc>076l_Xq9Z(`&e9n8*m`rd_aUmVpkzF zBiU~}za&qJ?I9vwy=-ctB@tB^f-K5}h zJ<^t*Y4rZ*7eD=nu4&qR*TP=CFYc~h+qau>%;wjae)pZHYm^8H27-ZLAQ%V+j=})W zY?12BFy>$&7zhTw7?AxTVF+f&VyIgOCT#(La*bAjF1>{0B**Mn4B>&Wr2;LLy~SWl zhdp^*b}WXLPVCJG`;$ML7uKhve$sH_Y#4Je5DW|%nAvhE=l?B!naL)9m=ddCAQ<>( z4Dh^JH!FOUpRJ?Mle0EqJYa}OToDBVeQ*iDLiUkMb(%kkj=1bt45f Date: Tue, 7 Nov 2023 20:02:15 +0530 Subject: [PATCH 04/27] Code clean --- .../contentstack-audit/test/unit/audit-base-command.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/contentstack-audit/test/unit/audit-base-command.test.ts b/packages/contentstack-audit/test/unit/audit-base-command.test.ts index a7f58feba0..dbad7db537 100644 --- a/packages/contentstack-audit/test/unit/audit-base-command.test.ts +++ b/packages/contentstack-audit/test/unit/audit-base-command.test.ts @@ -272,7 +272,6 @@ describe('AuditBaseCommand class', () => { .it('should apply filter on output', async () => { class CMD extends AuditBaseCommand { async run() { - // this.currentCommand = 'cm:stacks:audit:fix'; this.sharedConfig.reportPath = resolve(__dirname, 'mock', 'contents'); this.sharedConfig.flags.columns = 'Path'; this.sharedConfig.flags.filter = 'Title=T1'; @@ -309,7 +308,6 @@ describe('AuditBaseCommand class', () => { } as FileTransportInstance, ) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) - // .stub(fs, 'createWriteStream', () => new PassThrough()) .it('should fail with error', async () => { class CMD extends AuditBaseCommand { async run() { @@ -323,7 +321,6 @@ describe('AuditBaseCommand class', () => { try { await CMD.run([]); } catch (error: any) { - // ENOENT: no such file or directory, open '/Users/antony.raj/Documents/code/cli/packages/contentstack-audit/test/unit/mock/contents-1/content-types.csv' expect(error.message).to.be.include( `ENOENT: no such file or directory, open '${resolve(__dirname, 'mock', 'contents-1')}/content-types.csv'`, ); From 6f6d716aad78c94fc07b1ba4aaf485daf420de08 Mon Sep 17 00:00:00 2001 From: Antony Date: Wed, 8 Nov 2023 21:39:03 +0530 Subject: [PATCH 05/27] Tests: Audit functionality unit test cases added for entry module --- package-lock.json | 2 + packages/contentstack-audit/package.json | 1 + .../src/modules/content-types.ts | 2 +- .../contentstack-audit/src/modules/entries.ts | 21 +- .../src/modules/global-fields.ts | 4 +- .../test/unit/commands/fix.test.ts | 30 ++ .../test/unit/commands/index.test.ts | 11 +- .../test/unit/mock/mock.json | 222 ++++++++++++ .../test/unit/modules/entries.test.ts | 328 ++++++++++++++++++ .../src/index.ts | 3 +- .../contentstack-dev-dependencies/src/spy.ts | 41 +++ .../src/types.ts | 140 ++++++++ 12 files changed, 782 insertions(+), 23 deletions(-) create mode 100644 packages/contentstack-audit/test/unit/mock/mock.json create mode 100644 packages/contentstack-audit/test/unit/modules/entries.test.ts create mode 100644 packages/contentstack-dev-dependencies/src/spy.ts create mode 100644 packages/contentstack-dev-dependencies/src/types.ts diff --git a/package-lock.json b/package-lock.json index 9d41d8b135..495f8530f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22987,6 +22987,7 @@ "audit": "bin/run" }, "devDependencies": { + "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", @@ -27294,6 +27295,7 @@ "version": "file:packages/contentstack-audit", "requires": { "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-dev-dependencies": "^1.2.3", "@contentstack/cli-utilities": "~1.5.5", "@oclif/plugin-help": "^5", "@oclif/plugin-plugins": "^3.8.4", diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index ba2628f46b..705c346e06 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -30,6 +30,7 @@ "winston": "^3.10.0" }, "devDependencies": { + "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.0.3", "@types/chai": "^4.3.5", "@types/fs-extra": "^11.0.2", diff --git a/packages/contentstack-audit/src/modules/content-types.ts b/packages/contentstack-audit/src/modules/content-types.ts index 05f574d611..10b8550e3c 100644 --- a/packages/contentstack-audit/src/modules/content-types.ts +++ b/packages/contentstack-audit/src/modules/content-types.ts @@ -101,7 +101,7 @@ export default class ContentType { canWrite = this.config.flags.yes ?? (await ux.confirm(commonMsg.FIX_CONFIRMATION)); } - if (canWrite) { + if (this.fix && canWrite) { writeFileSync( join(this.folderPath, this.config.moduleConfig[this.moduleName].fileName), JSON.stringify(this.schema), diff --git a/packages/contentstack-audit/src/modules/entries.ts b/packages/contentstack-audit/src/modules/entries.ts index 6356b309c5..49a59ca07d 100644 --- a/packages/contentstack-audit/src/modules/entries.ts +++ b/packages/contentstack-audit/src/modules/entries.ts @@ -1,9 +1,8 @@ import find from 'lodash/find'; -import { ux } from '@oclif/core'; import values from 'lodash/values'; import isEmpty from 'lodash/isEmpty'; import { join, resolve } from 'path'; -import { FsUtility } from '@contentstack/cli-utilities'; +import { ux, FsUtility } from '@contentstack/cli-utilities'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import auditConfig from '../config'; @@ -33,10 +32,11 @@ import { EntryModularBlocksDataType, EntryReferenceFieldDataType, } from '../types'; +import GlobalField from './global-fields'; export default class Entries { public log: LogFn; - private fix: boolean; + protected fix: boolean; public fileName: string; public locales!: Locale[]; public config: ConfigType; @@ -45,7 +45,7 @@ export default class Entries { public currentTitle!: string; public gfSchema: ContentTypeStruct[]; public ctSchema: ContentTypeStruct[]; - private entries!: Record; + protected entries!: Record; protected missingRefs: Record = {}; public entryMetaData: Record[] = []; public moduleName: keyof typeof auditConfig.moduleConfig = 'entries'; @@ -77,7 +77,7 @@ export default class Entries { for (const { code } of this.locales) { for (const ctSchema of this.ctSchema) { const basePath = join(this.folderPath, ctSchema.uid, code); - const fsUtility = new FsUtility({ basePath, indexFileName: 'index.json' }); + const fsUtility = new FsUtility({ basePath, indexFileName: 'index.json', createDirIfNotExist: false }); const indexer = fsUtility.indexFileContent; for (const fileIndex in indexer) { @@ -138,14 +138,14 @@ export default class Entries { ctSchema: this.ctSchema, gfSchema: this.gfSchema, }).run(true)) as ContentTypeStruct[]; - this.gfSchema = (await new ContentType({ + this.gfSchema = (await new GlobalField({ fix: true, log: () => {}, config: this.config, - moduleName: 'entries', + moduleName: 'global-fields', ctSchema: this.ctSchema, gfSchema: this.gfSchema, - }).run(true)) as ContentTypeStruct[]; + }).run()) as ContentTypeStruct[]; } /** @@ -159,7 +159,7 @@ export default class Entries { canWrite = this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)); } - if (canWrite) { + if (this.fix && canWrite) { writeFileSync(filePath, JSON.stringify(schema)); } } @@ -188,7 +188,7 @@ export default class Entries { for (const child of field.schema ?? []) { const { uid } = child; - if (!entry?.[uid]) return; + if (!entry?.[uid]) continue; switch (child.data_type) { case 'reference': @@ -296,7 +296,6 @@ export default class Entries { fieldStructure: JsonRTEFieldDataType, field: EntryJsonRTEFieldDataType, ) { - // const missingRefIndex = [] // NOTE Other possible reference logic will be added related to JSON RTE (Ex missing assets, extensions etc.,) for (const index in field?.children ?? []) { const child = field.children[index]; diff --git a/packages/contentstack-audit/src/modules/global-fields.ts b/packages/contentstack-audit/src/modules/global-fields.ts index d9467d8de3..1a396e06c7 100644 --- a/packages/contentstack-audit/src/modules/global-fields.ts +++ b/packages/contentstack-audit/src/modules/global-fields.ts @@ -7,9 +7,9 @@ export default class GlobalField extends ContentType { * references. * @returns the value of the variable `missingRefs`. */ - async run() { + async run(returnFixSchema = false) { // NOTE add any validation if required - const missingRefs = await super.run(); + const missingRefs = await super.run(returnFixSchema); return missingRefs; } diff --git a/packages/contentstack-audit/test/unit/commands/fix.test.ts b/packages/contentstack-audit/test/unit/commands/fix.test.ts index e69de29bb2..29825a6eb6 100644 --- a/packages/contentstack-audit/test/unit/commands/fix.test.ts +++ b/packages/contentstack-audit/test/unit/commands/fix.test.ts @@ -0,0 +1,30 @@ +import winston from 'winston'; +import { expect } from '@oclif/test'; +import { fancy } from '@contentstack/cli-dev-dependencies'; +import { FileTransportInstance } from 'winston/lib/winston/transports'; + +import { AuditBaseCommand } from '../../../src/audit-base-command'; + +describe('AuditFix command', () => { + describe('AuditFix run method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub( + winston.transports, + 'File', + () => + class FsTransport { + name!: string; + } as FileTransportInstance, + ) + .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) + .stub(AuditBaseCommand.prototype, 'start', () => {}) + .spy(AuditBaseCommand.prototype, 'start') + .command(['cm:stacks:audit:fix']) + .it('should trigger AuditBaseCommand start method', ({ stdout, spy }) => { + expect(stdout).to.be.empty.string; + expect(spy.start.callCount).to.be.equals(1); + expect(spy.start.args).deep.equal([['cm:stacks:audit:fix']]); + }); + }); +}); diff --git a/packages/contentstack-audit/test/unit/commands/index.test.ts b/packages/contentstack-audit/test/unit/commands/index.test.ts index 5cb06b1ca5..721d33a6d2 100644 --- a/packages/contentstack-audit/test/unit/commands/index.test.ts +++ b/packages/contentstack-audit/test/unit/commands/index.test.ts @@ -1,14 +1,9 @@ -import sinon from 'sinon'; import winston from 'winston'; import { expect, test } from '@oclif/test'; import { FileTransportInstance } from 'winston/lib/winston/transports'; import { AuditBaseCommand } from '../../../src/audit-base-command'; describe('Audit command', () => { - afterEach(() => { - sinon.restore(); - }); - describe('Audit run method', () => { test .stdout({ print: process.env.PRINT === 'true' || false }) @@ -17,7 +12,7 @@ describe('Audit command', () => { 'File', () => class FsTransport { - constructor() {} + name!: string; } as FileTransportInstance, ) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) @@ -35,7 +30,7 @@ describe('Audit command', () => { 'File', () => class FsTransport { - constructor() {} + name!: string; } as FileTransportInstance, ) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) @@ -52,7 +47,7 @@ describe('Audit command', () => { 'File', () => class FsTransport { - constructor() {} + name!: string; } as FileTransportInstance, ) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) diff --git a/packages/contentstack-audit/test/unit/mock/mock.json b/packages/contentstack-audit/test/unit/mock/mock.json new file mode 100644 index 0000000000..a2f9c74fa2 --- /dev/null +++ b/packages/contentstack-audit/test/unit/mock/mock.json @@ -0,0 +1,222 @@ +{ + "schema": [ + { "data_type": "reference", "uid": "reference", "display_name": "Ref" }, + { "data_type": "reference", "uid": "reference_2", "display_name": "Ref" }, + { "data_type": "global_field", "uid": "global_field" }, + { "data_type": "json", "uid": "json", "field_metadata": { "allow_json_rte": true } }, + { "data_type": "blocks", "uid": "blocks" }, + { "data_type": "group", "uid": "group" } + ], + "emptyEntries": { + "reference": [], + "global_field": {}, + "json": {}, + "blocks": {}, + "group": {} + }, + "ctBlock": { + "data_type": "blocks", + "display_name": "Block 1", + "blocks": [ + { "title": "GF 1", "uid": "gf_1", "reference_to": "gf_0" }, + { "title": "GF 1", "uid": "gf_1", "reference_to": "gf_0", "schema": [] }, + { + "title": "Group", + "uid": "group", + "schema": [ + { + "data_type": "group", + "display_name": "Group", + "field_metadata": { "description": "", "instruction": "" }, + "schema": [ + { + "data_type": "reference", + "display_name": "Reference", + "reference_to": ["page_4", "page_3", "page_2", "page_1", "page_0"], + "field_metadata": { "ref_multiple": false, "ref_multiple_content_types": true }, + "uid": "reference", + "mandatory": false, + "multiple": false, + "non_localizable": false, + "unique": false + }, + { + "data_type": "json", + "display_name": "JSON Rich Text Editor", + "uid": "json_rte", + "field_metadata": { + "allow_json_rte": true, + "embed_entry": true, + "description": "", + "default_value": "", + "multiline": false, + "rich_text_type": "advanced", + "options": [], + "ref_multiple_content_types": true + }, + "format": "", + "error_messages": { "format": "" }, + "reference_to": ["sys_assets", "page_4", "page_3", "page_2", "page_1", "page_0"], + "multiple": false, + "non_localizable": false, + "unique": false, + "mandatory": false + } + ], + "uid": "group", + "mandatory": false, + "multiple": false, + "non_localizable": false, + "unique": false + } + ] + }, + { + "schema": [] + } + ], + "multiple": true, + "uid": "block_1", + "field_metadata": { "instruction": "", "description": "" }, + "mandatory": false, + "non_localizable": false, + "unique": false + }, + "entryBlock": [ + { + "gf_1": { + "reference": [{ "uid": "blt7de1517c79624a3e", "_content_type_uid": "page_0" }], + "json_rte": { "uid": "645499f51bd042b5b8c00d0c4aba2ad1", "__v": 2 }, + "group": { "group": { "reference": [], "group_1": { "reference": [] } } }, + "_metadata": { "uid": "cse9969de09204484a" } + } + }, + { + "gf_1": { + "reference": [], + "json_rte": { "uid": "56f96390513d45d18b96f23947521a9e", "__v": 2 }, + "group": { "group": { "reference": [], "group_1": { "reference": [] } } }, + "_metadata": { "uid": "csbcf9341f4640fea8" } + } + }, + { + "group": { + "group": { + "reference": [{ "uid": "blt7de1517c79624a3e", "_content_type_uid": "page_0" }], + "json_rte": { + "type": "doc", + "attrs": {}, + "uid": "37dbbe4f26844e64a438dd6fd712d1fd", + "children": [ + { + "type": "p", + "attrs": { "style": {}, "redactor-attributes": {}, "dir": "ltr" }, + "uid": "948a27e7bf0942078c10e9a8887e6d96", + "children": [{ "text": "" }] + }, + { + "uid": "faa9e47da4624c2cb6e2f37e52dad328", + "type": "reference", + "attrs": { + "display-type": "block", + "type": "entry", + "class-name": "embedded-entry redactor-component block-entry", + "entry-uid": "blt7de1517c79624a3e", + "locale": "en-us", + "content-type-uid": "page_0" + }, + "children": [{ "text": "" }] + } + ], + "_version": 1 + } + }, + "_metadata": { "uid": "csee87e42598d0a795" } + } + } + ], + "ctJsonRTE": { + "data_type": "json", + "display_name": "JSON Rich Text Editor", + "uid": "json_rte", + "field_metadata": { + "allow_json_rte": true, + "embed_entry": true, + "description": "", + "default_value": "", + "multiline": false, + "rich_text_type": "advanced", + "options": [], + "ref_multiple_content_types": true + }, + "format": "", + "error_messages": { "format": "" }, + "reference_to": ["sys_assets", "page_4", "page_3", "page_2", "page_1", "page_0"], + "multiple": false, + "non_localizable": false, + "unique": false, + "mandatory": false + }, + "entryJsonRTE": { + "type": "doc", + "attrs": {}, + "uid": "04d936d578814a229ef2098ece9bfe5e", + "children": [ + { + "type": "p", + "attrs": { "style": {}, "redactor-attributes": {}, "dir": "ltr" }, + "uid": "bacb480045144db18aef6d89b6749a0f", + "children": [{ "text": "" }] + }, + { + "uid": "44fe70e03ec54ae8b72fe4b410519ebd", + "type": "reference", + "attrs": { + "display-type": "block", + "type": "entry", + "class-name": "embedded-entry redactor-component block-entry", + "entry-uid": "blt7de1517c79624a3e", + "locale": "en-us", + "content-type-uid": "page_0" + }, + "children": [{ "text": "" }] + } + ], + "_version": 1 + }, + "ctGroupField": { + "data_type": "group", + "display_name": "Group 1", + "field_metadata": { "description": "", "instruction": "" }, + "schema": [ + { + "data_type": "reference", + "display_name": "Reference", + "reference_to": ["page_4", "page_3", "page_2", "page_1", "page_0"], + "field_metadata": { "ref_multiple": false, "ref_multiple_content_types": true }, + "uid": "reference", + "mandatory": false, + "multiple": false, + "non_localizable": false, + "unique": false + }, + { + "data_type": "global_field", + "display_name": "Global", + "reference_to": "gf_0", + "field_metadata": { "description": "" }, + "uid": "global_field", + "mandatory": false, + "multiple": false, + "non_localizable": false, + "unique": false + } + ], + "uid": "group_1", + "mandatory": false, + "multiple": false, + "non_localizable": false, + "unique": false + }, + "entryGroupField": { "reference": [{ "uid": "blt7de1517c79624a3e", "_content_type_uid": "page_0" }] } +} diff --git a/packages/contentstack-audit/test/unit/modules/entries.test.ts b/packages/contentstack-audit/test/unit/modules/entries.test.ts new file mode 100644 index 0000000000..599ef6ff29 --- /dev/null +++ b/packages/contentstack-audit/test/unit/modules/entries.test.ts @@ -0,0 +1,328 @@ +import fs from 'fs'; +import { resolve } from 'path'; +import { expect } from '@oclif/test'; +import cloneDeep from 'lodash/cloneDeep'; +import { ux } from '@contentstack/cli-utilities'; +import { fancy } from '@contentstack/cli-dev-dependencies'; + +import config from '../../../src/config'; +import { $t, auditMsg } from '../../../src/messages'; +import { ContentType, Entries, GlobalField } from '../../../src/modules'; +import { CtConstructorParam, EntryStruct, ModuleConstructorParam } from '../../../src/types'; +import { + schema, + emptyEntries, + ctBlock, + entryBlock, + ctJsonRTE, + entryJsonRTE, + ctGroupField, + entryGroupField, +} from '../mock/mock.json'; + +describe('Entries module', () => { + let constructorParam: ModuleConstructorParam & CtConstructorParam; + + beforeEach(() => { + constructorParam = { + log: () => {}, + moduleName: 'entries', + ctSchema: cloneDeep(require('../mock/contents/content_types/schema.json')), + gfSchema: cloneDeep(require('../mock/contents/global_fields/globalfields.json')), + config: Object.assign(config, { basePath: resolve(__dirname, '..', 'mock', 'contents'), flags: {} }), + }; + }); + + describe('run method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .it('should throw folder path validation error', async () => { + const ctInstance = new Entries({ + ...constructorParam, + config: { ...constructorParam.config, basePath: resolve(__dirname, '..', 'mock', 'contents-1') }, + }); + try { + await ctInstance.run(); + } catch (error: any) { + expect(error).to.be.instanceOf(Error); + expect(error.message).to.eql($t(auditMsg.NOT_VALID_PATH, { path: ctInstance.folderPath })); + } + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'prepareEntryMetaData', async () => {}) + .stub(Entries.prototype, 'fixPrerequisiteData', async () => {}) + .stub(Entries.prototype, 'writeFixContent', async () => {}) + .stub(Entries.prototype, 'lookForReference', async () => {}) + .stub(Entries.prototype, 'locales', [{ code: 'en-us' }] as any) + .it('should return missing refs', async () => { + const ctInstance = new (class Class extends Entries { + constructor() { + super(constructorParam); + this.missingRefs['test-entry-id'] = [{ uid: 'test', treeStr: 'gf_0' }]; + } + })(); + const missingRefs = await ctInstance.run(); + expect(missingRefs).not.to.be.empty; + expect(missingRefs).deep.contain({ 'test-entry-id': [{ uid: 'test', treeStr: 'gf_0' }] }); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'prepareEntryMetaData', async () => {}) + .stub(Entries.prototype, 'fixPrerequisiteData', async () => {}) + .stub(Entries.prototype, 'lookForReference', async () => {}) + .stub(Entries.prototype, 'writeFixContent', async () => {}) + .stub(Entries.prototype, 'locales', [{ code: 'en-us' }] as any) + .spy(Entries.prototype, 'prepareEntryMetaData') + .spy(Entries.prototype, 'fixPrerequisiteData') + .spy(Entries.prototype, 'lookForReference') + .spy(Entries.prototype, 'writeFixContent') + .it('should call prepareEntryMetaData & fixPrerequisiteData methods', async ({ spy }) => { + const ctInstance = new Entries({ ...constructorParam, fix: true }); + const missingRefs = await ctInstance.run(); + expect(missingRefs).to.be.empty; + expect(spy.writeFixContent.callCount).to.be.equals(1); + expect(spy.lookForReference.callCount).to.be.equals(1); + expect(spy.fixPrerequisiteData.callCount).to.be.equals(1); + expect(spy.prepareEntryMetaData.callCount).to.be.equals(1); + }); + }); + + describe('fixPrerequisiteData method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(ContentType.prototype, 'run', async () => ({ ct1: [{}] })) + .stub(GlobalField.prototype, 'run', async () => ({ gf1: [{}] })) + .spy(ContentType.prototype, 'run', 'ct') + .spy(GlobalField.prototype, 'run', 'gf') + .it('should call content type and global fields fix functionality', async ({ spy }) => { + const ctInstance = new Entries(constructorParam); + await ctInstance.fixPrerequisiteData(); + expect(spy.ctRun.callCount).to.be.equals(1); + expect(spy.gfRun.callCount).to.be.equals(1); + expect(ctInstance.ctSchema).deep.contain({ ct1: [{}] }); + expect(ctInstance.gfSchema).deep.contain({ gf1: [{}] }); + }); + }); + + describe('writeFixContent method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'confirm', async () => true) + .spy(fs, 'writeFileSync') + .it('should ask confirmation adn write content in given path', async ({ spy }) => { + const ctInstance = new Entries({ ...constructorParam, fix: true }); + await ctInstance.writeFixContent(resolve(__dirname, '..', 'mock', 'contents'), {}); + expect(spy.writeFileSync.callCount).to.be.equals(1); + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'confirm', async () => true) + .spy(fs, 'writeFileSync') + .it("should skip confirmation if 'yes' flag passed", async ({ spy }) => { + const ctInstance = new Entries({ ...constructorParam, fix: true }); + ctInstance.config.flags.yes = true; + await ctInstance.writeFixContent(resolve(__dirname, '..', 'mock', 'contents'), {}); + expect(spy.writeFileSync.callCount).to.be.equals(1); + }); + }); + + describe('lookForReference method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'runFixOnSchema', () => emptyEntries) + .stub(Entries.prototype, 'validateReferenceField', () => []) + .stub(Entries.prototype, 'validateGlobalField', () => {}) + .stub(Entries.prototype, 'validateJsonRTEFields', () => {}) + .stub(Entries.prototype, 'validateModularBlocksField', () => {}) + .stub(Entries.prototype, 'validateGroupField', () => {}) + .spy(Entries.prototype, 'runFixOnSchema') + .spy(Entries.prototype, 'validateReferenceField') + .spy(Entries.prototype, 'validateGlobalField') + .spy(Entries.prototype, 'validateJsonRTEFields') + .spy(Entries.prototype, 'validateModularBlocksField') + .spy(Entries.prototype, 'validateGroupField') + .it('should call datatype specific methods', async ({ spy }) => { + const ctInstance = new (class Class extends Entries { + constructor() { + super({ ...constructorParam, fix: true }); + this.currentUid = 'reference'; + this.missingRefs = { reference: [] }; + } + })(); + await ctInstance.lookForReference([], { schema } as any, {}); + expect(spy.runFixOnSchema.callCount).to.be.equals(1); + expect(spy.validateReferenceField.callCount).to.be.equals(1); + expect(spy.validateGlobalField.callCount).to.be.equals(1); + expect(spy.validateJsonRTEFields.callCount).to.be.equals(1); + expect(spy.validateModularBlocksField.callCount).to.be.equals(1); + expect(spy.validateGroupField.callCount).to.be.equals(1); + }); + }); + + describe('validateReferenceField method', () => { + class Class extends Entries { + public entries: Record = ( + require('../mock/contents/entries/page_1/en-us/e7f6e3cc-64ca-4226-afb3-7794242ae5f5-entries.json') as any + )['blt9946d3cca9edec1a']; + + constructor() { + super(constructorParam); + } + } + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'validateReferenceValues', () => {}) + .spy(Entries.prototype, 'validateReferenceValues') + .it('should call validateReferenceField method', async ({ spy }) => { + const ctInstance = new Class(); + await ctInstance.validateReferenceField([], ctInstance.ctSchema[3].schema as any, ctInstance.entries as any); + expect(spy.validateReferenceValues.callCount).to.be.equals(1); + expect(spy.validateReferenceValues.alwaysCalledWith([], ctInstance.ctSchema[3].schema, ctInstance.entries)).to + .be.true; + }); + + fancy.stdout({ print: process.env.PRINT === 'true' || false }).it('should return missing reference', async () => { + const ctInstance = new Class(); + const missingRefs = await ctInstance.validateReferenceField( + [{ uid: 'test-uid', name: 'reference', field: 'reference' }], + ctInstance.ctSchema[3].schema as any, + ctInstance.entries['reference'] as any, + ); + expect(missingRefs).deep.equal([ + { + tree: [ + { + uid: 'test-uid', + name: 'reference', + field: 'reference', + }, + ], + data_type: undefined, + missingRefs: [ + { + uid: 'blt7de1517c79624a3e', + _content_type_uid: 'page_0', + }, + ], + display_name: undefined, + uid: undefined, + name: undefined, + treeStr: 'reference', + }, + ]); + }); + }); + + describe('validateGlobalField method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'lookForReference', () => {}) + .spy(Entries.prototype, 'lookForReference') + .it('should call validateReferenceField method', async ({ spy }) => { + const ctInstance = new (class Class extends Entries { + public entries: Record = ( + require('../mock/contents/entries/page_1/en-us/e7f6e3cc-64ca-4226-afb3-7794242ae5f5-entries.json') as any + )['blt9946d3cca9edec1a']; + })(constructorParam); + + await ctInstance.validateGlobalField([], ctInstance.ctSchema as any, ctInstance.entries as any); + expect(spy.lookForReference.callCount).to.be.equals(1); + expect(spy.lookForReference.alwaysCalledWith([], ctInstance.ctSchema, ctInstance.entries)).to.be.true; + }); + }); + + describe('validateJsonRTEFields method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'jsonRefCheck', () => {}) + .spy(Entries.prototype, 'jsonRefCheck') + .spy(Entries.prototype, 'validateJsonRTEFields') + .it('should do recursive call on validateJsonRTEFields method', async ({ spy }) => { + const ctInstance = new Entries(constructorParam); + await ctInstance.validateJsonRTEFields([], ctJsonRTE as any, entryJsonRTE as any); + expect(spy.jsonRefCheck.callCount).to.be.equals(4); + expect(spy.validateJsonRTEFields.callCount).to.be.equals(3); + expect(spy.validateJsonRTEFields.calledWithExactly([], ctJsonRTE, entryJsonRTE)).to.be.true; + expect(spy.jsonRefCheck.calledWithExactly([], ctJsonRTE, entryJsonRTE.children[0])).to.be.true; + }); + }); + + describe('validateModularBlocksField method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'modularBlockRefCheck', () => {}) + .stub(Entries.prototype, 'lookForReference', () => {}) + .spy(Entries.prototype, 'modularBlockRefCheck') + .spy(Entries.prototype, 'lookForReference') + .it( + 'should iterate each blocks and call modularBlockRefCheck & lookForReference methods number of blocks exist in the entry times', + async ({ spy }) => { + const ctInstance = new Entries(constructorParam); + await ctInstance.validateModularBlocksField([], ctBlock as any, entryBlock as any); + expect(spy.modularBlockRefCheck.callCount).to.be.equals(3); + expect(spy.lookForReference.callCount).to.be.equals(5); + expect(spy.modularBlockRefCheck.calledWithExactly([], ctBlock.blocks, entryBlock[0], 0)).to.be.true; + expect( + spy.lookForReference.calledWithExactly( + [{ uid: 'gf_1', name: 'GF 1' }], + ctBlock.blocks[1], + entryBlock[0].gf_1, + ), + ).to.be.true; + }, + ); + }); + + describe('validateGroupField method', () => { + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'lookForReference', () => {}) + .spy(Entries.prototype, 'lookForReference') + .it('should call lookForReference method to iterate GroupField schema', async ({ spy }) => { + const ctInstance = new Entries(constructorParam); + await ctInstance.validateGroupField([], ctGroupField as any, entryGroupField as any); + expect(spy.lookForReference.callCount).to.be.equals(1); + expect(spy.lookForReference.calledWithExactly([], ctGroupField, entryGroupField)).to.be.true; + }); + + fancy + .stdout({ print: process.env.PRINT === 'true' || false }) + .stub(Entries.prototype, 'lookForReference', () => {}) + .spy(Entries.prototype, 'lookForReference') + .it( + 'should iterate all group entries and call lookForReference method to iterate GroupField schema', + async ({ spy }) => { + const ctInstance = new Entries(constructorParam); + await ctInstance.validateGroupField([], ctGroupField as any, [entryGroupField, entryGroupField] as any); + expect(spy.lookForReference.callCount).to.be.equals(2); + expect( + spy.lookForReference.calledWithExactly( + [{ uid: ctGroupField.uid, display_name: ctGroupField.display_name }], + ctGroupField, + entryGroupField, + ), + ).to.be.true; + }, + ); + }); + + // describe('modularBlockRefCheck method', () => { + // fancy + // .stdout({ print: process.env.PRINT === 'true' || false }) + // .stub(Entries.prototype, 'lookForReference', () => {}) + // .spy(Entries.prototype, 'lookForReference') + // .it('should call lookForReference method to iterate GroupField schema', async ({ spy }) => { + // const ctInstance = new Entries(constructorParam); + // await ctInstance.validateGroupField([], ctGroupField as any, entryGroupField as any); + // expect(spy.lookForReference.callCount).to.be.equals(1); + // expect(spy.lookForReference.calledWithExactly([], ctGroupField, entryGroupField)).to.be.true; + // }); + // }); +}); diff --git a/packages/contentstack-dev-dependencies/src/index.ts b/packages/contentstack-dev-dependencies/src/index.ts index 0cd8746e83..b003d0d110 100644 --- a/packages/contentstack-dev-dependencies/src/index.ts +++ b/packages/contentstack-dev-dependencies/src/index.ts @@ -1 +1,2 @@ -export * from './csdx-test-suite'; +export * from './spy' +export * from './csdx-test-suite'; \ No newline at end of file diff --git a/packages/contentstack-dev-dependencies/src/spy.ts b/packages/contentstack-dev-dependencies/src/spy.ts new file mode 100644 index 0000000000..ac56bdcd28 --- /dev/null +++ b/packages/contentstack-dev-dependencies/src/spy.ts @@ -0,0 +1,41 @@ +import sinon from 'sinon'; +import { test } from '@oclif/test'; +import { FancyTypes } from 'fancy-test'; +import upperFirst from 'lodash/upperFirst'; + +import { FancyBaseType } from './types'; + +type TestWitSpyType = FancyTypes.Base< + FancyTypes.Context, + FancyBaseType & { + spy: { + output: { + [key: string]: { [key: string]: sinon.SinonSpy }; + }; + args: [object: any, path: string, prefix?: string]; + }; + } +>; + +export function spy>(object: T, path: string, prefix?: string) { + if (object === undefined || path === undefined) throw new Error('should not be undefined'); + + return { + run(ctx: { spy: { [key: string]: sinon.SinonSpy } }) { + if (!ctx.spy) { + ctx.spy = {}; + } + + ctx.spy[prefix ? `${prefix}${upperFirst(path)}` : path] = sinon.spy(object, path); + }, + finally() { + sinon.restore(); + }, + }; +} + +test.register('spy', spy); + +export const fancy = test.register('spy', spy) as unknown as TestWitSpyType; + +export default fancy; diff --git a/packages/contentstack-dev-dependencies/src/types.ts b/packages/contentstack-dev-dependencies/src/types.ts new file mode 100644 index 0000000000..df966c5c82 --- /dev/null +++ b/packages/contentstack-dev-dependencies/src/types.ts @@ -0,0 +1,140 @@ +import { FancyTypes } from 'fancy-test'; + +export declare namespace loadConfig { + let root: string; + interface Options { + root?: string; + reset?: boolean; + } +} + +export type FancyBaseType = { + skip: { + output: unknown; + args: []; + }; +} & { + only: { + output: unknown; + args: []; + }; +} & { + retries: { + output: unknown; + args: [count: number]; + }; +} & { + catch: { + output: { + error: Error; + }; + args: [ + arg: string | RegExp | ((err: Error) => any), + opts?: + | { + raiseIfNotThrown?: boolean | undefined; + } + | undefined, + ]; + }; +} & { + env: { + output: unknown; + args: [ + env: { + [k: string]: string | null | undefined; + }, + opts?: FancyTypes.EnvOptions | undefined, + ]; + }; +} & { + stub: { + output: { + stubs: any[]; + }; + args: [object: any, path: any, value: () => any]; + }; +} & { + stdin: { + output: unknown; + args: [input: string, delay?: number | undefined]; + }; +} & { + stderr: { + output: { + readonly stderr: string; + }; + args: [ + opts?: + | { + print?: boolean | undefined; + stripColor?: boolean | undefined; + } + | undefined, + ]; + }; +} & { + stdout: { + output: { + readonly stdout: string; + }; + args: [ + opts?: + | { + print?: boolean | undefined; + stripColor?: boolean | undefined; + } + | undefined, + ]; + }; +} & { + nock: { + output: { + nock: number; + }; + args: [ + host: string, + options: FancyTypes.NockOptions | FancyTypes.NockCallback, + cb?: FancyTypes.NockCallback | undefined, + ]; + }; +} & { + timeout: { + output: { + timeout: number; + }; + args: [timeout?: number | undefined]; + }; +} & { + loadConfig: { + output: { + config: import('@oclif/core/lib/interfaces').Config; + }; + args: [opts?: loadConfig.Options | undefined]; + }; +} & { + command: { + output: { + config: import('@oclif/core/lib/interfaces').Config; + expectation: string; + returned: unknown; + }; + args: [args: string | string[], opts?: loadConfig.Options | undefined]; + }; +} & { + exit: { + output: { + error: any; + }; + args: [code?: number | undefined]; + }; +} & { + hook: { + output: { + config: import('@oclif/core/lib/interfaces').Config; + expectation: string; + returned: unknown; + }; + args: [event: string, hookOpts?: Record | undefined, options?: loadConfig.Options | undefined]; + }; +}; From 99c594251f89a80485d57894c0e6229a1513961f Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 9 Nov 2023 11:46:06 +0530 Subject: [PATCH 06/27] Lint fixes --- package-lock.json | 2 + .../test/unit/audit-base-command.test.ts | 94 +++---------------- .../test/unit/base-command.test.ts | 31 ++---- .../test/unit/commands/fix.test.ts | 13 +-- .../test/unit/commands/index.test.ts | 31 ++---- .../test/unit/modules/content-types.test.ts | 7 +- .../test/unit/modules/entries.test.ts | 29 +++--- .../test/unit/util/log.test.ts | 35 +++---- packages/contentstack-config/package.json | 7 +- .../contentstack-dev-dependencies/src/spy.ts | 9 +- 10 files changed, 73 insertions(+), 185 deletions(-) diff --git a/package-lock.json b/package-lock.json index 495f8530f5..0666005900 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24048,6 +24048,7 @@ "winston": "^3.7.2" }, "devDependencies": { + "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", @@ -28688,6 +28689,7 @@ "version": "file:packages/contentstack-config", "requires": { "@contentstack/cli-command": "~1.2.15", + "@contentstack/cli-dev-dependencies": "^1.2.3", "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", diff --git a/packages/contentstack-audit/test/unit/audit-base-command.test.ts b/packages/contentstack-audit/test/unit/audit-base-command.test.ts index dbad7db537..03555f2956 100644 --- a/packages/contentstack-audit/test/unit/audit-base-command.test.ts +++ b/packages/contentstack-audit/test/unit/audit-base-command.test.ts @@ -24,17 +24,14 @@ describe('AuditBaseCommand class', () => { } } + const fsTransport = class FsTransport { + filename!: string; + } as FileTransportInstance; + describe('Audit command flow', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(fs, 'mkdirSync', () => {}) .stub(fs, 'writeFileSync', () => {}) @@ -52,14 +49,7 @@ describe('AuditBaseCommand class', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(fs, 'mkdirSync', () => {}) .stub(fs, 'writeFileSync', () => {}) @@ -81,14 +71,7 @@ describe('AuditBaseCommand class', () => { describe('Audit fix command flow', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(fs, 'mkdirSync', () => {}) .stub(fs, 'writeFileSync', () => {}) @@ -118,14 +101,7 @@ describe('AuditBaseCommand class', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .it('return the status column object ', async () => { class FixCMD extends AuditBaseCommand { @@ -145,14 +121,7 @@ describe('AuditBaseCommand class', () => { describe('createBackUp method', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(AuditBaseCommand.prototype, 'promptQueue', async () => {}) .stub(AuditBaseCommand.prototype, 'scanAndFix', async () => ({})) @@ -179,14 +148,7 @@ describe('AuditBaseCommand class', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(AuditBaseCommand.prototype, 'promptQueue', async () => {}) .stub(AuditBaseCommand.prototype, 'scanAndFix', async () => ({})) @@ -221,14 +183,7 @@ describe('AuditBaseCommand class', () => { describe('prepareCSV method', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(fs, 'createWriteStream', () => new PassThrough()) .it('should print missing ref and fix status on table formate', async () => { @@ -259,14 +214,7 @@ describe('AuditBaseCommand class', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(fs, 'createWriteStream', () => new PassThrough()) .it('should apply filter on output', async () => { @@ -299,14 +247,7 @@ describe('AuditBaseCommand class', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .it('should fail with error', async () => { class CMD extends AuditBaseCommand { @@ -331,14 +272,7 @@ describe('AuditBaseCommand class', () => { describe('getCtAndGfSchema method', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .stub(fs, 'createWriteStream', () => new PassThrough()) .it('should log error and return empty array', async () => { diff --git a/packages/contentstack-audit/test/unit/base-command.test.ts b/packages/contentstack-audit/test/unit/base-command.test.ts index af88694ba4..20b469bc28 100644 --- a/packages/contentstack-audit/test/unit/base-command.test.ts +++ b/packages/contentstack-audit/test/unit/base-command.test.ts @@ -14,31 +14,21 @@ describe('BaseCommand class', () => { } } + const fsTransport = class FsTransport { + filename!: string; + } as FileTransportInstance; + describe('command', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .do(() => Command.run([])) .do((output) => expect(output.stdout).to.equal('Test log\n')) .it('logs to stdout'); fancy - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .do(() => { class CMD extends BaseCommand { @@ -56,14 +46,7 @@ describe('BaseCommand class', () => { describe('validate config file', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log })) .it('should log error', async (ctx) => { class CMD extends BaseCommand { diff --git a/packages/contentstack-audit/test/unit/commands/fix.test.ts b/packages/contentstack-audit/test/unit/commands/fix.test.ts index 29825a6eb6..ab57e8eadb 100644 --- a/packages/contentstack-audit/test/unit/commands/fix.test.ts +++ b/packages/contentstack-audit/test/unit/commands/fix.test.ts @@ -6,17 +6,14 @@ import { FileTransportInstance } from 'winston/lib/winston/transports'; import { AuditBaseCommand } from '../../../src/audit-base-command'; describe('AuditFix command', () => { + const fsTransport = class FsTransport { + filename!: string; + } as FileTransportInstance; + describe('AuditFix run method', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - name!: string; - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .stub(AuditBaseCommand.prototype, 'start', () => {}) .spy(AuditBaseCommand.prototype, 'start') diff --git a/packages/contentstack-audit/test/unit/commands/index.test.ts b/packages/contentstack-audit/test/unit/commands/index.test.ts index 721d33a6d2..84c2d7d398 100644 --- a/packages/contentstack-audit/test/unit/commands/index.test.ts +++ b/packages/contentstack-audit/test/unit/commands/index.test.ts @@ -4,17 +4,14 @@ import { FileTransportInstance } from 'winston/lib/winston/transports'; import { AuditBaseCommand } from '../../../src/audit-base-command'; describe('Audit command', () => { + const fsTransport = class FsTransport { + filename!: string; + } as FileTransportInstance; + describe('Audit run method', () => { test .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - name!: string; - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) .stub(AuditBaseCommand.prototype, 'start', () => {}) .command(['cm:stacks:audit']) @@ -25,14 +22,7 @@ describe('Audit command', () => { test .stderr({ print: false }) .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - name!: string; - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(AuditBaseCommand.prototype, 'start', () => Promise.reject('process failed')) .command(['cm:stacks:audit']) @@ -42,14 +32,7 @@ describe('Audit command', () => { test .stderr({ print: false }) .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - name!: string; - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) .stub(AuditBaseCommand.prototype, 'start', () => { throw Error('process failed'); diff --git a/packages/contentstack-audit/test/unit/modules/content-types.test.ts b/packages/contentstack-audit/test/unit/modules/content-types.test.ts index 2090948a78..31ca7edad6 100644 --- a/packages/contentstack-audit/test/unit/modules/content-types.test.ts +++ b/packages/contentstack-audit/test/unit/modules/content-types.test.ts @@ -129,11 +129,12 @@ describe('Content types', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) .stub(fs, 'writeFileSync', () => {}) + .stub(ux, 'confirm', async () => true) .it('should not write the file', async () => { - const ctInstance = new ContentType(constructorParam); - const logSpy = sinon.spy(fs, 'writeFileSync'); + const ctInstance = new ContentType({ ...constructorParam, fix: true }); + const fsSpy = sinon.spy(fs, 'writeFileSync'); await ctInstance.writeFixContent(); - expect(logSpy.callCount).to.be.equals(1); + expect(fsSpy.callCount).to.be.equals(1); }); fancy diff --git a/packages/contentstack-audit/test/unit/modules/entries.test.ts b/packages/contentstack-audit/test/unit/modules/entries.test.ts index 599ef6ff29..759cbea6ef 100644 --- a/packages/contentstack-audit/test/unit/modules/entries.test.ts +++ b/packages/contentstack-audit/test/unit/modules/entries.test.ts @@ -64,6 +64,7 @@ describe('Entries module', () => { } })(); const missingRefs = await ctInstance.run(); + expect(missingRefs).not.to.be.empty; expect(missingRefs).deep.contain({ 'test-entry-id': [{ uid: 'test', treeStr: 'gf_0' }] }); }); @@ -82,6 +83,7 @@ describe('Entries module', () => { .it('should call prepareEntryMetaData & fixPrerequisiteData methods', async ({ spy }) => { const ctInstance = new Entries({ ...constructorParam, fix: true }); const missingRefs = await ctInstance.run(); + expect(missingRefs).to.be.empty; expect(spy.writeFixContent.callCount).to.be.equals(1); expect(spy.lookForReference.callCount).to.be.equals(1); @@ -100,6 +102,7 @@ describe('Entries module', () => { .it('should call content type and global fields fix functionality', async ({ spy }) => { const ctInstance = new Entries(constructorParam); await ctInstance.fixPrerequisiteData(); + expect(spy.ctRun.callCount).to.be.equals(1); expect(spy.gfRun.callCount).to.be.equals(1); expect(ctInstance.ctSchema).deep.contain({ ct1: [{}] }); @@ -116,19 +119,23 @@ describe('Entries module', () => { .it('should ask confirmation adn write content in given path', async ({ spy }) => { const ctInstance = new Entries({ ...constructorParam, fix: true }); await ctInstance.writeFixContent(resolve(__dirname, '..', 'mock', 'contents'), {}); + expect(spy.writeFileSync.callCount).to.be.equals(1); }); fancy .stdout({ print: process.env.PRINT === 'true' || false }) .stub(fs, 'writeFileSync', () => {}) - .stub(ux, 'confirm', async () => true) .spy(fs, 'writeFileSync') .it("should skip confirmation if 'yes' flag passed", async ({ spy }) => { const ctInstance = new Entries({ ...constructorParam, fix: true }); ctInstance.config.flags.yes = true; await ctInstance.writeFixContent(resolve(__dirname, '..', 'mock', 'contents'), {}); + expect(spy.writeFileSync.callCount).to.be.equals(1); + expect( + spy.writeFileSync.calledWithExactly(resolve(__dirname, '..', 'mock', 'contents'), JSON.stringify({})), + ).to.be.true; }); }); @@ -156,6 +163,7 @@ describe('Entries module', () => { } })(); await ctInstance.lookForReference([], { schema } as any, {}); + expect(spy.runFixOnSchema.callCount).to.be.equals(1); expect(spy.validateReferenceField.callCount).to.be.equals(1); expect(spy.validateGlobalField.callCount).to.be.equals(1); @@ -183,6 +191,7 @@ describe('Entries module', () => { .it('should call validateReferenceField method', async ({ spy }) => { const ctInstance = new Class(); await ctInstance.validateReferenceField([], ctInstance.ctSchema[3].schema as any, ctInstance.entries as any); + expect(spy.validateReferenceValues.callCount).to.be.equals(1); expect(spy.validateReferenceValues.alwaysCalledWith([], ctInstance.ctSchema[3].schema, ctInstance.entries)).to .be.true; @@ -195,6 +204,7 @@ describe('Entries module', () => { ctInstance.ctSchema[3].schema as any, ctInstance.entries['reference'] as any, ); + expect(missingRefs).deep.equal([ { tree: [ @@ -231,8 +241,8 @@ describe('Entries module', () => { require('../mock/contents/entries/page_1/en-us/e7f6e3cc-64ca-4226-afb3-7794242ae5f5-entries.json') as any )['blt9946d3cca9edec1a']; })(constructorParam); - await ctInstance.validateGlobalField([], ctInstance.ctSchema as any, ctInstance.entries as any); + expect(spy.lookForReference.callCount).to.be.equals(1); expect(spy.lookForReference.alwaysCalledWith([], ctInstance.ctSchema, ctInstance.entries)).to.be.true; }); @@ -266,6 +276,7 @@ describe('Entries module', () => { async ({ spy }) => { const ctInstance = new Entries(constructorParam); await ctInstance.validateModularBlocksField([], ctBlock as any, entryBlock as any); + expect(spy.modularBlockRefCheck.callCount).to.be.equals(3); expect(spy.lookForReference.callCount).to.be.equals(5); expect(spy.modularBlockRefCheck.calledWithExactly([], ctBlock.blocks, entryBlock[0], 0)).to.be.true; @@ -301,6 +312,7 @@ describe('Entries module', () => { async ({ spy }) => { const ctInstance = new Entries(constructorParam); await ctInstance.validateGroupField([], ctGroupField as any, [entryGroupField, entryGroupField] as any); + expect(spy.lookForReference.callCount).to.be.equals(2); expect( spy.lookForReference.calledWithExactly( @@ -312,17 +324,4 @@ describe('Entries module', () => { }, ); }); - - // describe('modularBlockRefCheck method', () => { - // fancy - // .stdout({ print: process.env.PRINT === 'true' || false }) - // .stub(Entries.prototype, 'lookForReference', () => {}) - // .spy(Entries.prototype, 'lookForReference') - // .it('should call lookForReference method to iterate GroupField schema', async ({ spy }) => { - // const ctInstance = new Entries(constructorParam); - // await ctInstance.validateGroupField([], ctGroupField as any, entryGroupField as any); - // expect(spy.lookForReference.callCount).to.be.equals(1); - // expect(spy.lookForReference.calledWithExactly([], ctGroupField, entryGroupField)).to.be.true; - // }); - // }); }); diff --git a/packages/contentstack-audit/test/unit/util/log.test.ts b/packages/contentstack-audit/test/unit/util/log.test.ts index 1d26f93a7c..527c8abd0f 100644 --- a/packages/contentstack-audit/test/unit/util/log.test.ts +++ b/packages/contentstack-audit/test/unit/util/log.test.ts @@ -9,6 +9,10 @@ import { FileTransportInstance } from 'winston/lib/winston/transports'; import { Logger, print } from '../../../src/util'; describe('Log utility', () => { + const fsTransport = class FsTransport { + filename!: string; + } as FileTransportInstance; + afterEach(() => { sinon.restore(); }); @@ -16,19 +20,14 @@ describe('Log utility', () => { describe('Stubbing winston createLogger', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .it('should create logger instance', () => { sinon.replace(winston, 'createLogger', () => ({} as unknown as winston.Logger)); const logSpy = sinon.spy(winston, 'createLogger'); - new Logger({ basePath: resolve(__dirname, '..', 'mock') }); + const logger = new Logger({ basePath: resolve(__dirname, '..', 'mock') }); + expect(logSpy.callCount).to.be.equals(2); + expect(Object.getPrototypeOf(logger)).has.ownProperty('log'); }); }); @@ -36,12 +35,7 @@ describe('Log utility', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) .stub(ux, 'print', () => {}) - .stub( - winston.transports, - 'File', - () => (class FsTransport { - constructor() {} - }) as FileTransportInstance) + .stub(winston.transports, 'File', () => fsTransport) .it('should log message', () => { const logSpy = sinon.spy(); sinon.stub(winston, 'createLogger').returns({ log: logSpy, error: logSpy } as unknown as winston.Logger); @@ -56,14 +50,7 @@ describe('Log utility', () => { describe('Replace sensitive data before log', () => { fancy .stdout({ print: process.env.PRINT === 'true' || false }) - .stub( - winston.transports, - 'File', - () => - class FsTransport { - constructor() {} - } as FileTransportInstance, - ) + .stub(winston.transports, 'File', () => fsTransport) .stub(ux, 'print', () => {}) .stub(winston, 'createLogger', () => {}) .it('should remove any credentials before log message', () => { @@ -73,7 +60,7 @@ describe('Log utility', () => { () => ({ log: logSpy, - error: logSpy + error: logSpy, } as unknown as winston.Logger), ); const logger = new Logger({ basePath: resolve(__dirname, '..', 'mock') }); diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index b3c7bf2abf..57faf1b173 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -25,12 +25,13 @@ "@contentstack/cli-utilities": "~1.5.5", "chalk": "^4.0.0", "debug": "^4.1.1", - "mkdirp": "^1.0.4", "inquirer": "8.2.4", - "winston": "^3.7.2", - "lodash": "^4.17.20" + "lodash": "^4.17.20", + "mkdirp": "^1.0.4", + "winston": "^3.7.2" }, "devDependencies": { + "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", diff --git a/packages/contentstack-dev-dependencies/src/spy.ts b/packages/contentstack-dev-dependencies/src/spy.ts index ac56bdcd28..f1745c6ff2 100644 --- a/packages/contentstack-dev-dependencies/src/spy.ts +++ b/packages/contentstack-dev-dependencies/src/spy.ts @@ -17,7 +17,7 @@ type TestWitSpyType = FancyTypes.Base< } >; -export function spy>(object: T, path: string, prefix?: string) { +export function spy(object: T, path: K, prefix?: string) { if (object === undefined || path === undefined) throw new Error('should not be undefined'); return { @@ -26,7 +26,10 @@ export function spy>(object: T, path: string, ctx.spy = {}; } - ctx.spy[prefix ? `${prefix}${upperFirst(path)}` : path] = sinon.spy(object, path); + ctx.spy[(prefix && typeof path === 'string' ? `${prefix}${upperFirst(path)}` : path) as string] = sinon.spy( + object, + path, + ); }, finally() { sinon.restore(); @@ -34,8 +37,6 @@ export function spy>(object: T, path: string, }; } -test.register('spy', spy); - export const fancy = test.register('spy', spy) as unknown as TestWitSpyType; export default fancy; From 64099128e3c3e1e33cedb0bdbfbb3ca990e6e29e Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 9 Nov 2023 12:25:44 +0530 Subject: [PATCH 07/27] Code clean --- packages/contentstack-audit/test/unit/base-command.test.ts | 2 +- .../contentstack-audit/test/unit/commands/index.test.ts | 1 + .../test/unit/modules/content-types.test.ts | 7 ------- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/contentstack-audit/test/unit/base-command.test.ts b/packages/contentstack-audit/test/unit/base-command.test.ts index 20b469bc28..f94840c4b5 100644 --- a/packages/contentstack-audit/test/unit/base-command.test.ts +++ b/packages/contentstack-audit/test/unit/base-command.test.ts @@ -9,7 +9,7 @@ import { BaseCommand } from '../../src/base-command'; describe('BaseCommand class', () => { class Command extends BaseCommand { async run() { - this.parse(); + // this.parse(); this.log('Test log'); } } diff --git a/packages/contentstack-audit/test/unit/commands/index.test.ts b/packages/contentstack-audit/test/unit/commands/index.test.ts index 84c2d7d398..ab28cb717f 100644 --- a/packages/contentstack-audit/test/unit/commands/index.test.ts +++ b/packages/contentstack-audit/test/unit/commands/index.test.ts @@ -1,6 +1,7 @@ import winston from 'winston'; import { expect, test } from '@oclif/test'; import { FileTransportInstance } from 'winston/lib/winston/transports'; + import { AuditBaseCommand } from '../../../src/audit-base-command'; describe('Audit command', () => { diff --git a/packages/contentstack-audit/test/unit/modules/content-types.test.ts b/packages/contentstack-audit/test/unit/modules/content-types.test.ts index 31ca7edad6..ce12786571 100644 --- a/packages/contentstack-audit/test/unit/modules/content-types.test.ts +++ b/packages/contentstack-audit/test/unit/modules/content-types.test.ts @@ -206,13 +206,6 @@ describe('Content types', () => { const [, , , page1Ct] = ctInstance.ctSchema as CtType[]; const [, , , , refField] = page1Ct.schema ?? []; - const res = await ctInstance.validateReferenceField( - [{ uid: refField.uid, name: refField.display_name }], - refField as ReferenceFieldDataType, - ); - - console.log(res, constructorParam); - expect( JSON.stringify( await ctInstance.validateReferenceField( From f18e65482436290d566dc04bf589cae0d833e315 Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 9 Nov 2023 12:31:20 +0530 Subject: [PATCH 08/27] package.json updated --- packages/contentstack-config/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/contentstack-config/package.json b/packages/contentstack-config/package.json index 57faf1b173..56ef661e33 100644 --- a/packages/contentstack-config/package.json +++ b/packages/contentstack-config/package.json @@ -31,7 +31,6 @@ "winston": "^3.7.2" }, "devDependencies": { - "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", From b8b519d32af826eb0ba0c8eca3354e207d57e8e1 Mon Sep 17 00:00:00 2001 From: Antony Date: Wed, 15 Nov 2023 17:25:25 +0530 Subject: [PATCH 09/27] Feat: Add missing global fields schema in to content type if global field exists --- .gitignore | 4 +- package-lock.json | 6 +- packages/contentstack-audit/README.md | 94 +++++++++----- packages/contentstack-audit/package.json | 2 +- .../src/audit-base-command.ts | 17 ++- .../contentstack-audit/src/base-command.ts | 2 + .../src/commands/cm/stacks/audit/fix.ts | 11 +- .../src/commands/cm/stacks/audit/index.ts | 5 +- .../contentstack-audit/src/config/index.ts | 1 + .../contentstack-audit/src/messages/index.ts | 18 ++- .../src/modules/content-types.ts | 71 +++++++++-- .../contentstack-audit/src/modules/entries.ts | 14 ++- .../contentstack-audit/src/types/common.ts | 8 ++ .../src/types/content-types.ts | 1 + .../contentstack-audit/src/types/index.ts | 5 +- packages/contentstack-audit/src/util/flags.ts | 31 +++++ packages/contentstack-audit/src/util/index.ts | 3 +- .../test/unit/audit-base-command.test.ts | 2 +- .../test/unit/modules/content-types.test.ts | 117 ++++++++++++++---- .../test/unit/util/flags.test.ts | 30 +++++ .../package.json | 2 +- packages/contentstack/README.md | 94 +++++++++----- pnpm-lock.yaml | 4 +- 23 files changed, 411 insertions(+), 131 deletions(-) create mode 100644 packages/contentstack-audit/src/types/common.ts create mode 100644 packages/contentstack-audit/src/util/flags.ts create mode 100644 packages/contentstack-audit/test/unit/util/flags.test.ts diff --git a/.gitignore b/.gitignore index 329aeebd38..e378ee25cd 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,6 @@ contentstack-cli-logs packages/**/package-lock.json .dccache yarn.lock -contents-* \ No newline at end of file +contents-* +*.http +*.todo \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0666005900..c8a0833eee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22999,7 +22999,7 @@ "eslint-config-oclif-typescript": "^1.0.3", "mocha": "^10.2.0", "nyc": "^15.1.0", - "oclif": "^3.10.0", + "oclif": "^3", "shx": "^0.3.4", "sinon": "^17.0.0", "ts-jest": "^29.1.1", @@ -24048,7 +24048,6 @@ "winston": "^3.7.2" }, "devDependencies": { - "@contentstack/cli-dev-dependencies": "^1.2.3", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", "@types/inquirer": "^9.0.3", @@ -27315,7 +27314,7 @@ "lodash": "^4.17.21", "mocha": "^10.2.0", "nyc": "^15.1.0", - "oclif": "^3.10.0", + "oclif": "^3", "shx": "^0.3.4", "sinon": "^17.0.0", "ts-jest": "^29.1.1", @@ -28689,7 +28688,6 @@ "version": "file:packages/contentstack-config", "requires": { "@contentstack/cli-command": "~1.2.15", - "@contentstack/cli-dev-dependencies": "^1.2.3", "@contentstack/cli-utilities": "~1.5.5", "@oclif/test": "^2.2.10", "@types/chai": "^4.2.18", diff --git a/packages/contentstack-audit/README.md b/packages/contentstack-audit/README.md index 0d0960ba8a..584a5c87e3 100644 --- a/packages/contentstack-audit/README.md +++ b/packages/contentstack-audit/README.md @@ -56,16 +56,20 @@ USAGE --no-truncate] FLAGS + --modules=