diff --git a/Accounts/package-lock.json b/Accounts/package-lock.json index d5811c3401..70b0e27e58 100644 --- a/Accounts/package-lock.json +++ b/Accounts/package-lock.json @@ -74,18 +74,6 @@ "multicast-dns": "cli.js" } }, - "node_modules/pkg-up/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -1898,20 +1886,6 @@ "url": "https://github.com/sponsors/gregberge" } }, - "node_modules/pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -2325,11 +2299,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-watch-typeahead/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==" - }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -2453,14 +2422,6 @@ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" }, - "node_modules/serve-index/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -2742,17 +2703,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-watch-typeahead/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==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -3547,17 +3497,6 @@ "postcss": "^8.4" } }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", @@ -3942,14 +3881,6 @@ "reusify": "^1.0.4" } }, - "node_modules/jest-watch-typeahead/node_modules/jest-message-util/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "engines": { - "node": ">=8" - } - }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", @@ -3962,25 +3893,6 @@ "node": ">=6.9.0" } }, - "node_modules/jest-watch-typeahead/node_modules/jest-message-util": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz", - "integrity": "sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==", - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.1.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^28.1.3", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, "node_modules/escodegen/node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -4241,17 +4153,6 @@ "node": ">=8" } }, - "node_modules/svgo/node_modules/css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -4686,20 +4587,6 @@ "postcss": ">=8" } }, - "node_modules/jest-watch-typeahead/node_modules/pretty-format": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", - "integrity": "sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==", - "dependencies": { - "@jest/schemas": "^28.1.3", - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -5401,11 +5288,6 @@ "postcss": "^8.2.15" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "node_modules/svgo/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -5592,11 +5474,6 @@ "@xtuc/long": "4.2.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -6464,14 +6341,6 @@ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, - "node_modules/webpack/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -7669,18 +7538,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -7745,11 +7602,6 @@ "postcss": "^8.3" } }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/webpack-merge": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", @@ -8355,17 +8207,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -9789,14 +9630,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/@types/eslint": { "version": "8.4.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz", @@ -11491,20 +11324,6 @@ "node": ">= 0.6" } }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/resolve-url-loader/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11619,11 +11438,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/compression/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -13876,14 +13690,6 @@ } } }, - "node_modules/postcss-svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -15318,17 +15124,6 @@ "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==" }, - "node_modules/pkg-up/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/postcss-custom-properties": { "version": "12.1.11", "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-12.1.11.tgz", @@ -17395,11 +17190,6 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "globals": { "version": "13.19.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", @@ -19862,11 +19652,6 @@ "ms": "2.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -20046,11 +19831,6 @@ "fast-deep-equal": "^3.1.3" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -20734,15 +20514,6 @@ "source-map": "~0.6.1" }, "dependencies": { - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -21304,11 +21075,6 @@ "requires": { "ms": "2.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -22975,39 +22741,11 @@ "@types/yargs-parser": "*" } }, - "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==" - }, "emittery": { "version": "0.10.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz", "integrity": "sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==" }, - "jest-message-util": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz", - "integrity": "sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==", - "requires": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.1.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^28.1.3", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "dependencies": { - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - } - } - }, "jest-regex-util": { "version": "28.0.2", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", @@ -23060,22 +22798,6 @@ } } }, - "pretty-format": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", - "integrity": "sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==", - "requires": { - "@jest/schemas": "^28.1.3", - "ansi-regex": "^5.0.1", - "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==" - }, "slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -24007,30 +23729,6 @@ "locate-path": "^5.0.0", "path-exists": "^4.0.0" } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } } } }, @@ -24049,36 +23747,6 @@ "requires": { "locate-path": "^3.0.0" } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==" } } }, @@ -24667,11 +24335,6 @@ "svgo": "^2.7.0" }, "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" - }, "css-tree": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", @@ -25543,11 +25206,6 @@ "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" - }, "http-errors": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", @@ -25989,11 +25647,6 @@ "nth-check": "^1.0.2" } }, - "css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==" - }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -26595,11 +26248,6 @@ "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" } } }, diff --git a/ApiDocs/package-lock.json b/ApiDocs/package-lock.json index da8abe842e..a52ac93cc1 100644 --- a/ApiDocs/package-lock.json +++ b/ApiDocs/package-lock.json @@ -33,7 +33,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -157,11 +156,6 @@ "node": ">=4" } }, - "node_modules/jake/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -1013,8 +1007,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/strip-ansi": { "version": "6.0.1", @@ -1725,11 +1718,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1775,7 +1763,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -1831,11 +1818,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1963,17 +1945,6 @@ "semver-compare": "^1.0.0" } }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -2205,11 +2176,6 @@ "node": ">=0.4.0" } }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2919,8 +2885,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/supports-color": { "version": "5.5.0", @@ -3782,7 +3747,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -3995,7 +3959,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -4003,8 +3966,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "combined-stream": { "version": "1.0.8", @@ -4301,11 +4263,6 @@ "requires": { "ms": "2.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -4693,11 +4650,6 @@ "color-name": "~1.1.4" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4952,11 +4904,6 @@ "yargs-unparser": "2.0.0" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", @@ -5503,8 +5450,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "statuses": { "version": "2.0.1", @@ -5768,19 +5714,6 @@ "requires": { "color-convert": "^2.0.1" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" } } }, diff --git a/Common/Models/BaseModel.ts b/Common/Models/BaseModel.ts index 8c9b187dca..ddf107a8c0 100644 --- a/Common/Models/BaseModel.ts +++ b/Common/Models/BaseModel.ts @@ -13,7 +13,7 @@ import TableColumn, { getTableColumns, TableColumnMetadata, } from '../Types/Database/TableColumn'; -import { JSONArray, JSONFunctions, JSONObject, JSONValue } from '../Types/JSON'; +import { JSONArray, JSONObject, JSONValue } from '../Types/JSON'; import ObjectID from '../Types/ObjectID'; import Dictionary from '../Types/Dictionary'; import HashedString from '../Types/HashedString'; @@ -32,6 +32,7 @@ import { ColumnAccessControl } from '../Types/Database/AccessControl/AccessContr import { getColumnAccessControlForAllColumns } from '../Types/Database/AccessControl/ColumnAccessControl'; import BadDataException from '../Types/Exception/BadDataException'; import { PlanSelect } from '../Types/Billing/SubscriptionPlan'; +import JSONFunctions from '../Types/JSONFunctions'; export type DbTypes = | string diff --git a/Common/Types/API/HTTPResponse.ts b/Common/Types/API/HTTPResponse.ts index 2c2c6930ef..6bf8f9f487 100644 --- a/Common/Types/API/HTTPResponse.ts +++ b/Common/Types/API/HTTPResponse.ts @@ -1,10 +1,10 @@ import BaseModel from '../../Models/BaseModel'; import { JSONArray, - JSONFunctions, JSONObject, JSONObjectOrArray, } from '../JSON'; +import JSONFunctions from '../JSONFunctions'; import Typeof from '../Typeof'; export default class HTTPResponse< diff --git a/Common/Types/Database/Date.ts b/Common/Types/Database/Date.ts new file mode 100644 index 0000000000..7f0a045c6c --- /dev/null +++ b/Common/Types/Database/Date.ts @@ -0,0 +1,29 @@ +import moment from "moment"; +import OneUptimeDate from "../Date"; +import InBetween from "./InBetween"; + +export default class DatabaseDate { + public static asDateStartOfTheDayEndOfTheDayForDatabaseQuery( + date: string | Date + ): InBetween { + let startValue: string | Date = date; + + if (!(startValue instanceof Date)) { + startValue = OneUptimeDate.fromString(startValue); + } + + let endValue: string | Date = date; + + if (!(endValue instanceof Date)) { + endValue = OneUptimeDate.fromString(endValue); + } + + startValue = OneUptimeDate.getStartOfDay(startValue); + endValue = OneUptimeDate.getEndOfDay(endValue); + + return new InBetween( + moment(startValue).format('YYYY-MM-DD HH:mm:ss'), + moment(endValue).format('YYYY-MM-DD HH:mm:ss') + ); + } +} \ No newline at end of file diff --git a/Common/Types/Date.ts b/Common/Types/Date.ts index 70c41d4930..0e4f2cd110 100644 --- a/Common/Types/Date.ts +++ b/Common/Types/Date.ts @@ -1,6 +1,5 @@ import PositiveNumber from './PositiveNumber'; import moment from 'moment-timezone'; -import InBetween from './Database/InBetween'; export default class OneUptimeDate { public static getCurrentDate(): Date { @@ -360,28 +359,4 @@ export default class OneUptimeDate { const formatstring: string = 'YYYY-MM-DD'; return moment(date).local().format(formatstring); } - - public static asDateStartOfTheDayEndOfTheDayForDatabaseQuery( - date: string | Date - ): InBetween { - let startValue: string | Date = date; - - if (!(startValue instanceof Date)) { - startValue = OneUptimeDate.fromString(startValue); - } - - let endValue: string | Date = date; - - if (!(endValue instanceof Date)) { - endValue = OneUptimeDate.fromString(endValue); - } - - startValue = OneUptimeDate.getStartOfDay(startValue); - endValue = OneUptimeDate.getEndOfDay(endValue); - - return new InBetween( - moment(startValue).format('YYYY-MM-DD HH:mm:ss'), - moment(endValue).format('YYYY-MM-DD HH:mm:ss') - ); - } } diff --git a/Common/Types/JSON.ts b/Common/Types/JSON.ts index 546799ba42..a34b0d9146 100644 --- a/Common/Types/JSON.ts +++ b/Common/Types/JSON.ts @@ -8,13 +8,9 @@ import URL from './API/URL'; import Name from './Name'; import Permission from './Permission'; import Search from './Database/Search'; -import Typeof from './Typeof'; import Port from './Port'; import Hostname from './API/Hostname'; import HashedString from './HashedString'; -import DatabaseProperty from './Database/DatabaseProperty'; -import OneUptimeDate from './Date'; -import BaseModel from '../Models/BaseModel'; import GreaterThan from './Database/GreaterThan'; import GreaterThanOrEqual from './Database/GreaterThanOrEqual'; import LessThan from './Database/LessThan'; @@ -22,8 +18,9 @@ import LessThanOrEqual from './Database/LessThanOrEqual'; import InBetween from './Database/InBetween'; import Domain from './Domain'; import NotNull from './Database/NotNull'; +import { BaseEntity } from 'typeorm'; -enum ObjectType { +export enum ObjectType { ObjectID = 'ObjectID', Name = 'Name', Email = 'Email', @@ -62,8 +59,8 @@ export type JSONValue = | Array | ObjectID | Array - | BaseModel - | Array + | BaseEntity + | Array | Name | Array | Email @@ -115,482 +112,5 @@ export interface JSONObject { export type JSONArray = Array; -export class JSONFunctions { - public static toCompressedString(val: JSONValue): string { - return JSON.stringify(val, null, 2); - } - - public static toString(val: JSONValue): string { - return JSON.stringify(val); - } - - public static getJSONValueInPath( - obj: JSONObject, - path: string - ): JSONValue | null { - const paths: Array = path.split('.'); - let returnValue: JSONObject = obj as JSONObject; - for (const p of paths) { - if (!p) { - continue; - } - - if (returnValue && returnValue[p as string]!) { - returnValue = returnValue[p] as JSONObject; - } else { - return null; - } - } - - return returnValue as JSONValue; - } - - // this funciton serializes JSON with Common Objects to JSON that can be stringified. - public static serialize(val: JSONObject): JSONObject { - const newVal: JSONObject = {}; - - for (const key in val) { - if (val[key] === undefined) { - continue; - } - - if (val[key] === null) { - newVal[key] = val[key]; - } - - if (Array.isArray(val[key])) { - const arraySerialize: Array = []; - for (const arrVal of val[key] as Array) { - arraySerialize.push(this.serializeValue(arrVal)); - } - - newVal[key] = arraySerialize; - } else { - newVal[key] = this.serializeValue(val[key] as JSONValue); - } - } - - return newVal; - } - - public static serializeValue(val: JSONValue): JSONValue { - if (val === null || val === undefined) { - return val; - } else if ( - typeof val === Typeof.String && - val.toString().trim() === '' - ) { - return val; - } else if (val instanceof BaseModel) { - return BaseModel.toJSON(val, BaseModel); - } else if (typeof val === Typeof.Number) { - return val; - } else if (ArrayBuffer.isView(val)) { - return { - _type: ObjectType.Buffer, - value: val as Uint8Array, - }; - } else if (val && val instanceof Name) { - return { - _type: ObjectType.Name, - value: (val as Name).toString(), - }; - } else if (val && val instanceof Domain) { - return { - _type: ObjectType.Domain, - value: (val as Domain).toString(), - }; - } else if (val && val instanceof ObjectID) { - return { - _type: ObjectType.ObjectID, - value: (val as ObjectID).toString(), - }; - } else if (val && val instanceof Phone) { - return { - _type: ObjectType.Phone, - value: (val as Phone).toString(), - }; - } else if (val && val instanceof Email) { - return { - _type: ObjectType.Email, - value: (val as Email).toString(), - }; - } else if (val && val instanceof Port) { - return { - _type: ObjectType.Port, - value: (val as Port).toString(), - }; - } else if (val && val instanceof HashedString) { - return { - _type: ObjectType.HashedString, - value: (val as HashedString).toString(), - }; - } else if (val && val instanceof Hostname) { - return { - _type: ObjectType.Hostname, - value: (val as Hostname).toString(), - }; - } else if (val && val instanceof Version) { - return { - _type: ObjectType.Version, - value: (val as Version).toString(), - }; - } else if (val && val instanceof Route) { - return { - _type: ObjectType.Route, - value: (val as Route).toString(), - }; - } else if (val && val instanceof URL) { - return { - _type: ObjectType.URL, - value: (val as URL).toString(), - }; - } else if (val && val instanceof Color) { - return { - _type: ObjectType.Color, - value: (val as Color).toString(), - }; - } else if (val && val instanceof Search) { - return { - _type: ObjectType.Search, - value: (val as Search).toString(), - }; - } else if (val && val instanceof LessThan) { - return { - _type: ObjectType.LessThan, - value: (val as LessThan).value, - }; - } else if (val && val instanceof InBetween) { - return { - _type: ObjectType.InBetween, - startValue: (val as InBetween).startValue, - endValue: (val as InBetween).endValue, - }; - } else if (val && val instanceof NotNull) { - return { - _type: ObjectType.NotNull, - value: null, - }; - } else if (val && val instanceof GreaterThan) { - return { - _type: ObjectType.GreaterThan, - value: (val as GreaterThan).value, - }; - } else if (val && val instanceof LessThanOrEqual) { - return { - _type: ObjectType.LessThanOrEqual, - value: (val as LessThanOrEqual).value, - }; - } else if (val && val instanceof GreaterThanOrEqual) { - return { - _type: ObjectType.GreaterThanOrEqual, - value: (val as GreaterThanOrEqual).value, - }; - } else if (val && val instanceof Date) { - return { - _type: ObjectType.DateTime, - value: OneUptimeDate.toString(val as Date).toString(), - }; - } else if ( - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - Object.keys(ObjectType).includes( - (val as JSONObject)['_type'] as string - ) - ) { - return val; - } else if (typeof val === Typeof.Object) { - return this.serialize(val as JSONObject); - } - - return val; - } - - public static deserializeValue(val: JSONValue): JSONValue { - if (val === null || val === undefined) { - return val; - } else if ( - typeof val === Typeof.String && - val.toString().trim() === '' - ) { - return val; - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - ((val as JSONObject)['value'] as JSONObject)['data'] && - ((val as JSONObject)['value'] as JSONObject)['type'] && - ((val as JSONObject)['value'] as JSONObject)['type'] === - ObjectType.Buffer && - ((val as JSONObject)['_type'] as string) === ObjectType.Buffer - ) { - return Buffer.from( - ((val as JSONObject)['value'] as JSONObject)[ - 'data' - ] as Uint8Array - ); - } else if (val && ArrayBuffer.isView(val)) { - return Buffer.from(val as Uint8Array); - } else if (typeof val === Typeof.Number) { - return val; - } else if (val instanceof DatabaseProperty) { - return val; - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Name - ) { - return new Name((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Domain - ) { - return new Domain((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.ObjectID - ) { - return new ObjectID((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Phone - ) { - return new Phone((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Email - ) { - return new Email((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Version - ) { - return new Name((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Route - ) { - return new Route((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.URL - ) { - return URL.fromString((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Port - ) { - return new Port((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Hostname - ) { - return new Hostname((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.HashedString - ) { - return new HashedString((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.DateTime - ) { - return OneUptimeDate.fromString( - (val as JSONObject)['value'] as string - ); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Color - ) { - return new Color((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - typeof (val as JSONObject)['value'] === Typeof.String && - ((val as JSONObject)['_type'] as string) === ObjectType.Search - ) { - return new Search((val as JSONObject)['value'] as string); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - (typeof (val as JSONObject)['value'] === Typeof.Number || - (val as JSONObject)['value'] instanceof Date) && - ((val as JSONObject)['_type'] as string) === ObjectType.LessThan - ) { - return new LessThan((val as JSONObject)['value'] as number | Date); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - (typeof (val as JSONObject)['value'] === Typeof.Number || - (val as JSONObject)['value'] instanceof Date || - typeof (val as JSONObject)['value'] === Typeof.String) && - ((val as JSONObject)['_type'] as string) === ObjectType.GreaterThan - ) { - return new GreaterThan( - (val as JSONObject)['value'] as number | Date - ); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - (typeof (val as JSONObject)['value'] === Typeof.Number || - (val as JSONObject)['value'] instanceof Date || - typeof (val as JSONObject)['value'] === Typeof.String) && - ((val as JSONObject)['_type'] as string) === - ObjectType.LessThanOrEqual - ) { - return new LessThanOrEqual( - (val as JSONObject)['value'] as number | Date - ); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] === null && - ((val as JSONObject)['_type'] as string) === ObjectType.NotNull - ) { - return new NotNull(); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['value'] && - (typeof (val as JSONObject)['value'] === Typeof.Number || - (val as JSONObject)['value'] instanceof Date || - typeof (val as JSONObject)['value'] === Typeof.String) && - ((val as JSONObject)['_type'] as string) === - ObjectType.GreaterThanOrEqual - ) { - return new GreaterThanOrEqual( - (val as JSONObject)['value'] as number | Date - ); - } else if ( - val && - typeof val === Typeof.Object && - (val as JSONObject)['_type'] && - (val as JSONObject)['startValue'] && - (typeof (val as JSONObject)['startValue'] === Typeof.Number || - typeof (val as JSONObject)['endValue'] === Typeof.String || - (val as JSONObject)['startValue'] instanceof Date) && - (val as JSONObject)['endValue'] && - (typeof (val as JSONObject)['endValue'] === Typeof.Number || - typeof (val as JSONObject)['endValue'] === Typeof.String || - (val as JSONObject)['endValue'] instanceof Date) && - ((val as JSONObject)['_type'] as string) === ObjectType.InBetween - ) { - return new InBetween( - (val as JSONObject)['startValue'] as number | Date, - (val as JSONObject)['endValue'] as number | Date - ); - } else if (val instanceof Date) { - return val; - } else if (typeof val === Typeof.Object) { - return this.deserialize(val as JSONObject); - } - - return val; - } - - public static deserializeArray(array: JSONArray): JSONArray { - const returnArr: JSONArray = []; - - for (const obj of array) { - returnArr.push(this.deserialize(obj)); - } - - return returnArr; - } - - public static serializeArray(array: JSONArray): JSONArray { - const returnArr: JSONArray = []; - - for (const obj of array) { - returnArr.push(this.serialize(obj)); - } - - return returnArr; - } - - public static deserialize(val: JSONObject): JSONObject { - const newVal: JSONObject = {}; - for (const key in val) { - if (val[key] === null || val[key] === undefined) { - newVal[key] = val[key]; - } - - if (Array.isArray(val[key])) { - const arraySerialize: Array = []; - for (const arrVal of val[key] as Array) { - arraySerialize.push(this.deserializeValue(arrVal)); - } - - newVal[key] = arraySerialize; - } else { - newVal[key] = this.deserializeValue(val[key] as JSONValue); - } - } - - return newVal; - } -} export type JSONObjectOrArray = JSONObject | JSONArray; diff --git a/Common/Types/JSONFunctions.ts b/Common/Types/JSONFunctions.ts new file mode 100644 index 0000000000..04f5793818 --- /dev/null +++ b/Common/Types/JSONFunctions.ts @@ -0,0 +1,503 @@ +import ObjectID from './ObjectID'; +import Version from './Version'; +import Email from './Email'; +import Phone from './Phone'; +import Color from './Color'; +import Route from './API/Route'; +import URL from './API/URL'; +import Name from './Name'; +import Search from './Database/Search'; +import Typeof from './Typeof'; +import Port from './Port'; +import Hostname from './API/Hostname'; +import HashedString from './HashedString'; +import DatabaseProperty from './Database/DatabaseProperty'; +import OneUptimeDate from './Date'; +import BaseModel from '../Models/BaseModel'; +import GreaterThan from './Database/GreaterThan'; +import GreaterThanOrEqual from './Database/GreaterThanOrEqual'; +import LessThan from './Database/LessThan'; +import LessThanOrEqual from './Database/LessThanOrEqual'; +import InBetween from './Database/InBetween'; +import Domain from './Domain'; +import NotNull from './Database/NotNull'; +import { JSONArray, JSONObject, JSONValue, ObjectType } from './JSON'; + + +export default class JSONFunctions { + public static toCompressedString(val: JSONValue): string { + return JSON.stringify(val, null, 2); + } + + public static toString(val: JSONValue): string { + return JSON.stringify(val); + } + + public static getJSONValueInPath( + obj: JSONObject, + path: string + ): JSONValue | null { + const paths: Array = path.split('.'); + let returnValue: JSONObject = obj as JSONObject; + for (const p of paths) { + if (!p) { + continue; + } + + if (returnValue && returnValue[p as string]!) { + returnValue = returnValue[p] as JSONObject; + } else { + return null; + } + } + + return returnValue as JSONValue; + } + + // this funciton serializes JSON with Common Objects to JSON that can be stringified. + public static serialize(val: JSONObject): JSONObject { + const newVal: JSONObject = {}; + + for (const key in val) { + if (val[key] === undefined) { + continue; + } + + if (val[key] === null) { + newVal[key] = val[key]; + } + + if (Array.isArray(val[key])) { + const arraySerialize: Array = []; + for (const arrVal of val[key] as Array) { + arraySerialize.push(this.serializeValue(arrVal)); + } + + newVal[key] = arraySerialize; + } else { + newVal[key] = this.serializeValue(val[key] as JSONValue); + } + } + + return newVal; + } + + public static serializeValue(val: JSONValue): JSONValue { + if (val === null || val === undefined) { + return val; + } else if ( + typeof val === Typeof.String && + val.toString().trim() === '' + ) { + return val; + } else if (val instanceof BaseModel) { + return BaseModel.toJSON(val, BaseModel); + } else if (typeof val === Typeof.Number) { + return val; + } else if (ArrayBuffer.isView(val)) { + return { + _type: ObjectType.Buffer, + value: val as Uint8Array, + }; + } else if (val && val instanceof Name) { + return { + _type: ObjectType.Name, + value: (val as Name).toString(), + }; + } else if (val && val instanceof Domain) { + return { + _type: ObjectType.Domain, + value: (val as Domain).toString(), + }; + } else if (val && val instanceof ObjectID) { + return { + _type: ObjectType.ObjectID, + value: (val as ObjectID).toString(), + }; + } else if (val && val instanceof Phone) { + return { + _type: ObjectType.Phone, + value: (val as Phone).toString(), + }; + } else if (val && val instanceof Email) { + return { + _type: ObjectType.Email, + value: (val as Email).toString(), + }; + } else if (val && val instanceof Port) { + return { + _type: ObjectType.Port, + value: (val as Port).toString(), + }; + } else if (val && val instanceof HashedString) { + return { + _type: ObjectType.HashedString, + value: (val as HashedString).toString(), + }; + } else if (val && val instanceof Hostname) { + return { + _type: ObjectType.Hostname, + value: (val as Hostname).toString(), + }; + } else if (val && val instanceof Version) { + return { + _type: ObjectType.Version, + value: (val as Version).toString(), + }; + } else if (val && val instanceof Route) { + return { + _type: ObjectType.Route, + value: (val as Route).toString(), + }; + } else if (val && val instanceof URL) { + return { + _type: ObjectType.URL, + value: (val as URL).toString(), + }; + } else if (val && val instanceof Color) { + return { + _type: ObjectType.Color, + value: (val as Color).toString(), + }; + } else if (val && val instanceof Search) { + return { + _type: ObjectType.Search, + value: (val as Search).toString(), + }; + } else if (val && val instanceof LessThan) { + return { + _type: ObjectType.LessThan, + value: (val as LessThan).value, + }; + } else if (val && val instanceof InBetween) { + return { + _type: ObjectType.InBetween, + startValue: (val as InBetween).startValue, + endValue: (val as InBetween).endValue, + }; + } else if (val && val instanceof NotNull) { + return { + _type: ObjectType.NotNull, + value: null, + }; + } else if (val && val instanceof GreaterThan) { + return { + _type: ObjectType.GreaterThan, + value: (val as GreaterThan).value, + }; + } else if (val && val instanceof LessThanOrEqual) { + return { + _type: ObjectType.LessThanOrEqual, + value: (val as LessThanOrEqual).value, + }; + } else if (val && val instanceof GreaterThanOrEqual) { + return { + _type: ObjectType.GreaterThanOrEqual, + value: (val as GreaterThanOrEqual).value, + }; + } else if (val && val instanceof Date) { + return { + _type: ObjectType.DateTime, + value: OneUptimeDate.toString(val as Date).toString(), + }; + } else if ( + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + Object.keys(ObjectType).includes( + (val as JSONObject)['_type'] as string + ) + ) { + return val; + } else if (typeof val === Typeof.Object) { + return this.serialize(val as JSONObject); + } + + return val; + } + + public static deserializeValue(val: JSONValue): JSONValue { + if (val === null || val === undefined) { + return val; + } else if ( + typeof val === Typeof.String && + val.toString().trim() === '' + ) { + return val; + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + ((val as JSONObject)['value'] as JSONObject)['data'] && + ((val as JSONObject)['value'] as JSONObject)['type'] && + ((val as JSONObject)['value'] as JSONObject)['type'] === + ObjectType.Buffer && + ((val as JSONObject)['_type'] as string) === ObjectType.Buffer + ) { + return Buffer.from( + ((val as JSONObject)['value'] as JSONObject)[ + 'data' + ] as Uint8Array + ); + } else if (val && ArrayBuffer.isView(val)) { + return Buffer.from(val as Uint8Array); + } else if (typeof val === Typeof.Number) { + return val; + } else if (val instanceof DatabaseProperty) { + return val; + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Name + ) { + return new Name((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Domain + ) { + return new Domain((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.ObjectID + ) { + return new ObjectID((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Phone + ) { + return new Phone((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Email + ) { + return new Email((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Version + ) { + return new Name((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Route + ) { + return new Route((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.URL + ) { + return URL.fromString((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Port + ) { + return new Port((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Hostname + ) { + return new Hostname((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.HashedString + ) { + return new HashedString((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.DateTime + ) { + return OneUptimeDate.fromString( + (val as JSONObject)['value'] as string + ); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Color + ) { + return new Color((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + typeof (val as JSONObject)['value'] === Typeof.String && + ((val as JSONObject)['_type'] as string) === ObjectType.Search + ) { + return new Search((val as JSONObject)['value'] as string); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + (typeof (val as JSONObject)['value'] === Typeof.Number || + (val as JSONObject)['value'] instanceof Date) && + ((val as JSONObject)['_type'] as string) === ObjectType.LessThan + ) { + return new LessThan((val as JSONObject)['value'] as number | Date); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + (typeof (val as JSONObject)['value'] === Typeof.Number || + (val as JSONObject)['value'] instanceof Date || + typeof (val as JSONObject)['value'] === Typeof.String) && + ((val as JSONObject)['_type'] as string) === ObjectType.GreaterThan + ) { + return new GreaterThan( + (val as JSONObject)['value'] as number | Date + ); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + (typeof (val as JSONObject)['value'] === Typeof.Number || + (val as JSONObject)['value'] instanceof Date || + typeof (val as JSONObject)['value'] === Typeof.String) && + ((val as JSONObject)['_type'] as string) === + ObjectType.LessThanOrEqual + ) { + return new LessThanOrEqual( + (val as JSONObject)['value'] as number | Date + ); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] === null && + ((val as JSONObject)['_type'] as string) === ObjectType.NotNull + ) { + return new NotNull(); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['value'] && + (typeof (val as JSONObject)['value'] === Typeof.Number || + (val as JSONObject)['value'] instanceof Date || + typeof (val as JSONObject)['value'] === Typeof.String) && + ((val as JSONObject)['_type'] as string) === + ObjectType.GreaterThanOrEqual + ) { + return new GreaterThanOrEqual( + (val as JSONObject)['value'] as number | Date + ); + } else if ( + val && + typeof val === Typeof.Object && + (val as JSONObject)['_type'] && + (val as JSONObject)['startValue'] && + (typeof (val as JSONObject)['startValue'] === Typeof.Number || + typeof (val as JSONObject)['endValue'] === Typeof.String || + (val as JSONObject)['startValue'] instanceof Date) && + (val as JSONObject)['endValue'] && + (typeof (val as JSONObject)['endValue'] === Typeof.Number || + typeof (val as JSONObject)['endValue'] === Typeof.String || + (val as JSONObject)['endValue'] instanceof Date) && + ((val as JSONObject)['_type'] as string) === ObjectType.InBetween + ) { + return new InBetween( + (val as JSONObject)['startValue'] as number | Date, + (val as JSONObject)['endValue'] as number | Date + ); + } else if (val instanceof Date) { + return val; + } else if (typeof val === Typeof.Object) { + return this.deserialize(val as JSONObject); + } + + return val; + } + + public static deserializeArray(array: JSONArray): JSONArray { + const returnArr: JSONArray = []; + + for (const obj of array) { + returnArr.push(this.deserialize(obj)); + } + + return returnArr; + } + + public static serializeArray(array: JSONArray): JSONArray { + const returnArr: JSONArray = []; + + for (const obj of array) { + returnArr.push(this.serialize(obj)); + } + + return returnArr; + } + + public static deserialize(val: JSONObject): JSONObject { + const newVal: JSONObject = {}; + for (const key in val) { + if (val[key] === null || val[key] === undefined) { + newVal[key] = val[key]; + } + + if (Array.isArray(val[key])) { + const arraySerialize: Array = []; + for (const arrVal of val[key] as Array) { + arraySerialize.push(this.deserializeValue(arrVal)); + } + + newVal[key] = arraySerialize; + } else { + newVal[key] = this.deserializeValue(val[key] as JSONValue); + } + } + + return newVal; + } +} diff --git a/CommonServer/API/BaseAPI.ts b/CommonServer/API/BaseAPI.ts index 99cfe93b2c..7e0a73af34 100644 --- a/CommonServer/API/BaseAPI.ts +++ b/CommonServer/API/BaseAPI.ts @@ -12,7 +12,8 @@ import PositiveNumber from 'Common/Types/PositiveNumber'; import BadRequestException from 'Common/Types/Exception/BadRequestException'; import Response from '../Utils/Response'; import ObjectID from 'Common/Types/ObjectID'; -import { JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import CreateBy from '../Types/Database/CreateBy'; import DatabaseCommonInteractionProps from 'Common/Types/Database/DatabaseCommonInteractionProps'; import Query from '../Types/Database/Query'; diff --git a/CommonServer/Infrastructure/GlobalCache.ts b/CommonServer/Infrastructure/GlobalCache.ts index 049844bdfe..1066c6bf88 100644 --- a/CommonServer/Infrastructure/GlobalCache.ts +++ b/CommonServer/Infrastructure/GlobalCache.ts @@ -1,4 +1,5 @@ -import { JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import Redis, { ClientType } from './Redis'; import DatabaseNotConnectedException from 'Common/Types/Exception/DatabaseNotConnectedException'; import OneUptimeDate from 'Common/Types/Date'; diff --git a/CommonServer/Middleware/UserAuthorization.ts b/CommonServer/Middleware/UserAuthorization.ts index 9e50df240c..3ceb4c31fe 100644 --- a/CommonServer/Middleware/UserAuthorization.ts +++ b/CommonServer/Middleware/UserAuthorization.ts @@ -15,7 +15,8 @@ import { UserTenantAccessPermission, } from 'Common/Types/Permission'; import AccessTokenService from '../Services/AccessTokenService'; -import { JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import HashedString from 'Common/Types/HashedString'; export default class UserMiddleware { diff --git a/CommonServer/Types/Database/Populate.ts b/CommonServer/Types/Database/Populate.ts index e510d1b5ef..f566aad999 100644 --- a/CommonServer/Types/Database/Populate.ts +++ b/CommonServer/Types/Database/Populate.ts @@ -1,5 +1,7 @@ import BaseModel from 'Common/Models/BaseModel'; +import { JSONObject } from 'Common/Types/JSON'; import { FindOptionsRelations } from 'typeorm'; -type Populate = FindOptionsRelations; +type Populate = FindOptionsRelations | JSONObject; + export default Populate; diff --git a/CommonServer/Utils/ModelPermission.ts b/CommonServer/Utils/ModelPermission.ts index 4960b38c84..cecca2fe1f 100644 --- a/CommonServer/Utils/ModelPermission.ts +++ b/CommonServer/Utils/ModelPermission.ts @@ -502,7 +502,7 @@ export default class ModelPermission { populate: Populate; } { for (const key in populate) { - if (typeof populate[key] === Typeof.Object) { + if (typeof (populate as JSONObject)[key] === Typeof.Object) { (select as any)[key] = { ...(populate as any)[key], _id: true }; (populate as any)[key] = true; @@ -535,7 +535,7 @@ export default class ModelPermission { ModelPermission.getExcludedColumns(); for (const key in populate) { - if (typeof populate[key] === Typeof.Object) { + if (typeof (populate as JSONObject)[key] === Typeof.Object) { const tableColumnMetadata: TableColumnMetadata = model.getTableColumnMetadata(key); diff --git a/CommonServer/Utils/Response.ts b/CommonServer/Utils/Response.ts index f8c9f611fb..dcf67b1fae 100644 --- a/CommonServer/Utils/Response.ts +++ b/CommonServer/Utils/Response.ts @@ -10,7 +10,6 @@ import { JSONObject, JSONArray, JSONObjectOrArray, - JSONFunctions, } from 'Common/Types/JSON'; import { File } from 'Common/Types/File'; import Exception from 'Common/Types/Exception/Exception'; @@ -19,6 +18,7 @@ import PositiveNumber from 'Common/Types/PositiveNumber'; import URL from 'Common/Types/API/URL'; import BaseModel from 'Common/Models/BaseModel'; import EmptyResponse from 'Common/Types/API/EmptyResponse'; +import JSONFunctions from 'Common/Types/JSONFunctions'; export default class Response { private static logResponse( diff --git a/CommonUI/package-lock.json b/CommonUI/package-lock.json index 145fdb38ad..0c91ec2bf1 100644 --- a/CommonUI/package-lock.json +++ b/CommonUI/package-lock.json @@ -2326,6 +2326,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2510,7 +2511,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/bcp-47-match": { "version": "2.0.3", @@ -2548,6 +2550,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2683,6 +2686,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2793,6 +2797,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2803,7 +2808,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -2833,7 +2839,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/convert-source-map": { "version": "1.9.0", @@ -3517,7 +3524,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -3608,6 +3616,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3646,7 +3655,8 @@ "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/harmony-reflect": { "version": "1.6.2", @@ -3678,6 +3688,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -4097,6 +4108,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -4114,6 +4126,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4122,7 +4135,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/inline-style-parser": { "version": "0.1.1", @@ -4468,7 +4482,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -6472,6 +6487,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -8980,6 +8996,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -9137,6 +9154,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -10053,6 +10071,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -10146,7 +10165,8 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/sisteransi": { "version": "1.0.5", @@ -10329,6 +10349,7 @@ "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" }, @@ -10979,6 +11000,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -11069,12 +11091,14 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -12963,6 +12987,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -13100,7 +13125,8 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "bcp-47-match": { "version": "2.0.3", @@ -13122,6 +13148,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13212,6 +13239,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -13287,6 +13315,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -13294,7 +13323,8 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -13338,7 +13368,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "convert-source-map": { "version": "1.9.0", @@ -13890,7 +13921,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -13953,6 +13985,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -13979,7 +14012,8 @@ "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "harmony-reflect": { "version": "1.6.2", @@ -14004,7 +14038,8 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "has-property-descriptors": { "version": "1.0.0", @@ -14308,7 +14343,8 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true }, "indent-string": { "version": "4.0.0", @@ -14320,6 +14356,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -14328,7 +14365,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "inline-style-parser": { "version": "0.1.1", @@ -14548,7 +14586,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -15965,6 +16004,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -17667,6 +17707,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "requires": { "wrappy": "1" } @@ -17782,7 +17823,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true }, "path-key": { "version": "3.1.1", @@ -18466,6 +18508,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -18535,7 +18578,8 @@ "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "sisteransi": { "version": "1.0.5", @@ -18676,6 +18720,7 @@ "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" } @@ -19128,6 +19173,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -19191,12 +19237,14 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "write-file-atomic": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, "requires": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" diff --git a/CommonUI/src/Components/Table/TableHeader.tsx b/CommonUI/src/Components/Table/TableHeader.tsx index 80b191bbec..4e569d4a41 100644 --- a/CommonUI/src/Components/Table/TableHeader.tsx +++ b/CommonUI/src/Components/Table/TableHeader.tsx @@ -19,6 +19,7 @@ import Dropdown, { DropdownValue } from '../Dropdown/Dropdown'; import ComponentLoader from '../ComponentLoader/ComponentLoader'; import ErrorMessage from '../ErrorMessage/ErrorMessage'; import InBetween from 'Common/Types/Database/InBetween'; +import DatabaseDate from 'Common/Types/Database/Date'; export type FilterData = Dictionary< | string @@ -285,7 +286,7 @@ const TableHeader: FunctionComponent = ( filterData[ column.key ] = - OneUptimeDate.asDateStartOfTheDayEndOfTheDayForDatabaseQuery( + DatabaseDate.asDateStartOfTheDayEndOfTheDayForDatabaseQuery( changedValue ); } diff --git a/CommonUI/src/Utils/API/API.ts b/CommonUI/src/Utils/API/API.ts index 85fc28b34b..253d550bfa 100644 --- a/CommonUI/src/Utils/API/API.ts +++ b/CommonUI/src/Utils/API/API.ts @@ -11,7 +11,7 @@ import URL from 'Common/Types/API/URL'; import Navigation from '../Navigation'; import Dictionary from 'Common/Types/Dictionary'; import PermissionUtil from '../Permission'; -import { JSONFunctions } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import { UserGlobalAccessPermission, UserTenantAccessPermission, diff --git a/CommonUI/src/Utils/LocalStorage.ts b/CommonUI/src/Utils/LocalStorage.ts index 39f11a4ca4..5b1884277f 100644 --- a/CommonUI/src/Utils/LocalStorage.ts +++ b/CommonUI/src/Utils/LocalStorage.ts @@ -1,7 +1,8 @@ import URL from 'Common/Types/API/URL'; import Email from 'Common/Types/Email'; -import { JSONFunctions, JSONObject, JSONValue } from 'Common/Types/JSON'; +import { JSONObject, JSONValue } from 'Common/Types/JSON'; import Typeof from 'Common/Types/Typeof'; +import JSONFunctions from 'Common/Types/JSONFunctions'; export default class LocalStorage { public static setItem(key: string, value: JSONValue | Email | URL): void { diff --git a/CommonUI/src/Utils/ModelAPI/ModelAPI.ts b/CommonUI/src/Utils/ModelAPI/ModelAPI.ts index 0a994ae6a8..26be33dfe5 100644 --- a/CommonUI/src/Utils/ModelAPI/ModelAPI.ts +++ b/CommonUI/src/Utils/ModelAPI/ModelAPI.ts @@ -10,7 +10,8 @@ import { DASHBOARD_API_URL } from '../../Config'; import HTTPResponse from 'Common/Types/API/HTTPResponse'; import HTTPMethod from 'Common/Types/API/HTTPMethod'; import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse'; -import { JSONArray, JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONArray, JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import { FormType } from '../../Components/Forms/ModelForm'; import Dictionary from 'Common/Types/Dictionary'; import ProjectUtil from '../Project'; diff --git a/Dashboard/package-lock.json b/Dashboard/package-lock.json index 814b4f7cad..99cf958857 100644 --- a/Dashboard/package-lock.json +++ b/Dashboard/package-lock.json @@ -81,20 +81,6 @@ "multicast-dns": "cli.js" } }, - "node_modules/pkg-up/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "peer": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -2117,22 +2103,6 @@ "url": "https://github.com/sponsors/gregberge" } }, - "node_modules/pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "peer": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -2620,13 +2590,6 @@ "redux": "^4.2.0" } }, - "node_modules/jest-watch-typeahead/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, - "peer": true - }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -2766,15 +2729,6 @@ "dev": true, "peer": true }, - "node_modules/serve-index/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -3084,19 +3038,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-watch-typeahead/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, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -3970,18 +3911,6 @@ "postcss": "^8.4" } }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/update-browserslist-db": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", @@ -4410,16 +4339,6 @@ "reusify": "^1.0.4" } }, - "node_modules/jest-watch-typeahead/node_modules/jest-message-util/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", @@ -4434,27 +4353,6 @@ "node": ">=6.9.0" } }, - "node_modules/jest-watch-typeahead/node_modules/jest-message-util": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz", - "integrity": "sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.1.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^28.1.3", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, "node_modules/escodegen/node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -4746,19 +4644,6 @@ "node": ">=8" } }, - "node_modules/svgo/node_modules/css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -5092,6 +4977,7 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -5232,7 +5118,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -5265,22 +5150,6 @@ "postcss": ">=8" } }, - "node_modules/jest-watch-typeahead/node_modules/pretty-format": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", - "integrity": "sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==", - "dev": true, - "peer": true, - "dependencies": { - "@jest/schemas": "^28.1.3", - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" - } - }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -6068,13 +5937,6 @@ "postcss": "^8.2.15" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, "node_modules/svgo/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -6227,7 +6089,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -6291,13 +6152,6 @@ "@xtuc/long": "4.2.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -7266,15 +7120,6 @@ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, - "node_modules/webpack/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -8666,20 +8511,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "peer": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -8753,12 +8584,6 @@ "postcss": "^8.3" } }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/webpack-merge": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", @@ -9401,18 +9226,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -10990,16 +10803,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/@types/eslint": { "version": "8.4.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz", @@ -12862,7 +12665,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -12939,21 +12741,6 @@ "node": ">= 0.6" } }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/resolve-url-loader/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13085,12 +12872,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/compression/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -13781,7 +13562,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, - "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -15654,16 +15434,6 @@ } } }, - "node_modules/postcss-svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -17316,19 +17086,6 @@ "dev": true, "peer": true }, - "node_modules/pkg-up/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/postcss-custom-properties": { "version": "12.1.11", "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-12.1.11.tgz", @@ -19774,13 +19531,6 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "peer": true - }, "globals": { "version": "13.19.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", @@ -22671,12 +22421,6 @@ "ms": "2.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -22887,13 +22631,6 @@ "fast-deep-equal": "^3.1.3" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -23699,17 +23436,6 @@ "source-map": "~0.6.1" }, "dependencies": { - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "peer": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -24374,12 +24100,6 @@ "requires": { "ms": "2.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true } } }, @@ -26304,13 +26024,6 @@ "@types/yargs-parser": "*" } }, - "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, - "peer": true - }, "emittery": { "version": "0.10.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz", @@ -26318,33 +26031,6 @@ "dev": true, "peer": true }, - "jest-message-util": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.3.tgz", - "integrity": "sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==", - "dev": true, - "peer": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.1.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^28.1.3", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "dependencies": { - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "peer": true - } - } - }, "jest-regex-util": { "version": "28.0.2", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", @@ -26407,26 +26093,6 @@ } } }, - "pretty-format": { - "version": "28.1.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", - "integrity": "sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==", - "dev": true, - "peer": true, - "requires": { - "@jest/schemas": "^28.1.3", - "ansi-regex": "^5.0.1", - "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, - "peer": true - }, "slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -26732,7 +26398,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "peer": true, "requires": { "p-locate": "^5.0.0" } @@ -27338,7 +27003,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "peer": true, "requires": { "yocto-queue": "^0.1.0" } @@ -27348,7 +27012,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, - "peer": true, "requires": { "p-limit": "^3.0.2" } @@ -27367,7 +27030,8 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "dev": true, + "peer": true }, "param-case": { "version": "3.0.4", @@ -27515,33 +27179,6 @@ "locate-path": "^5.0.0", "path-exists": "^4.0.0" } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } } } }, @@ -27564,44 +27201,6 @@ "requires": { "locate-path": "^3.0.0" } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "peer": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "peer": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "peer": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "peer": true } } }, @@ -28322,13 +27921,6 @@ "svgo": "^2.7.0" }, "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "peer": true - }, "css-tree": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", @@ -29356,12 +28948,6 @@ "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true - }, "http-errors": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", @@ -29901,13 +29487,6 @@ "nth-check": "^1.0.2" } }, - "css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", - "dev": true, - "peer": true - }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -30634,12 +30213,6 @@ "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true } } }, @@ -31418,8 +30991,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true + "dev": true } } } \ No newline at end of file diff --git a/DashboardAPI/Index.ts b/DashboardAPI/Index.ts index 6e24787914..6a643806ab 100755 --- a/DashboardAPI/Index.ts +++ b/DashboardAPI/Index.ts @@ -1,10 +1,10 @@ import 'ejs'; -import { PostgresAppInstance } from 'CommonServer/Infrastructure/PostgresDatabase'; import Redis from 'CommonServer/Infrastructure/Redis'; import Express, { ExpressApplication } from 'CommonServer/Utils/Express'; import logger from 'CommonServer/Utils/Logger'; import BaseAPI from 'CommonServer/API/BaseAPI'; import App from 'CommonServer/Utils/StartServer'; +import { PostgresAppInstance } from 'CommonServer/Infrastructure/PostgresDatabase'; import User from 'Model/Models/User'; import UserService, { diff --git a/StatusPage/src/App.tsx b/StatusPage/src/App.tsx index 28cc28f875..39f1d49706 100644 --- a/StatusPage/src/App.tsx +++ b/StatusPage/src/App.tsx @@ -24,7 +24,8 @@ import PageMap from './Utils/PageMap'; import 'CommonUI/src/Styles/theme.scss'; import Navigation from 'CommonUI/src/Utils/Navigation'; -import { JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import RouteParams from './Utils/RouteParams'; const App: FunctionComponent = () => { diff --git a/StatusPage/src/Components/MasterPage/MasterPage.tsx b/StatusPage/src/Components/MasterPage/MasterPage.tsx index d953c55132..d29a8a9ade 100644 --- a/StatusPage/src/Components/MasterPage/MasterPage.tsx +++ b/StatusPage/src/Components/MasterPage/MasterPage.tsx @@ -11,7 +11,8 @@ import Navigation from 'CommonUI/src/Utils/Navigation'; import ObjectID from 'Common/Types/ObjectID'; import BadDataException from 'Common/Types/Exception/BadDataException'; import useAsyncEffect from 'use-async-effect'; -import { JSONFunctions, JSONObject } from 'Common/Types/JSON'; +import { JSONObject } from 'Common/Types/JSON'; +import JSONFunctions from 'Common/Types/JSONFunctions'; import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse'; import ErrorMessage from 'CommonUI/src/Components/ErrorMessage/ErrorMessage'; import RouteParams from '../../Utils/RouteParams'; diff --git a/get-certs.sh b/certs-issue.sh similarity index 100% rename from get-certs.sh rename to certs-issue.sh diff --git a/renew-certs.sh b/certs-renew.sh similarity index 100% rename from renew-certs.sh rename to certs-renew.sh diff --git a/find-circular-deps.sh b/find-circular-deps.sh new file mode 100644 index 0000000000..682e3b6b6c --- /dev/null +++ b/find-circular-deps.sh @@ -0,0 +1,14 @@ + +# Loop through all the directories. +npm i -g madge +for d in */ ; do + PACKAGE_JSON=./$d/package.json + if test -f "$PACKAGE_JSON"; then + cd $d + npm i --force + npm run compile || echo "No compile script found" + madge --circular . + cd .. + fi +done +