diff --git a/.aiAutoMinify.json b/.aiAutoMinify.json index 859c6c98e..3c6d580b8 100644 --- a/.aiAutoMinify.json +++ b/.aiAutoMinify.json @@ -20,7 +20,6 @@ "eStorageType", "FieldType", "eDistributedTracingModes", - "IThrottleMsgKey", "eRequestHeaders", "DataPointType", "DependencyKind", diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 05bdf2b50..34256dd99 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -112,12 +112,12 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", + "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -213,9 +213,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "peer": true, "dependencies": { "ajv": "^6.12.4", @@ -236,9 +236,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", + "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -283,16 +283,16 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@microsoft/api-extractor": { - "version": "7.36.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.36.3.tgz", - "integrity": "sha512-u0H6362AQq+r55X8drHx4npgkrCfJnMzRRHfQo8PMNKB8TcBnrTLfXhXWi+xnTM6CzlU/netEN8c4bq581Rnrg==", + "version": "7.36.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.36.4.tgz", + "integrity": "sha512-21UECq8C/8CpHT23yiqTBQ10egKUacIpxkPyYR7hdswo/M5yTWdBvbq+77YC9uPKQJOUfOD1FImBQ1DzpsdeQQ==", "dependencies": { - "@microsoft/api-extractor-model": "7.27.5", + "@microsoft/api-extractor-model": "7.27.6", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.6", - "@rushstack/rig-package": "0.4.0", - "@rushstack/ts-command-line": "4.15.1", + "@rushstack/node-core-library": "3.59.7", + "@rushstack/rig-package": "0.4.1", + "@rushstack/ts-command-line": "4.15.2", "colors": "~1.2.1", "lodash": "~4.17.15", "resolve": "~1.22.1", @@ -305,13 +305,13 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.27.5.tgz", - "integrity": "sha512-9/tBzYMJitR+o+zkPr1lQh2+e8ClcaTF6eZo7vZGDqRt2O5XmXWPbYJZmxyM3wb5at6lfJNEeGZrQXLjsQ0Nbw==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.27.6.tgz", + "integrity": "sha512-eiCnlayyum1f7fS2nA9pfIod5VCNR1G+Tq84V/ijDrKrOFVa598BLw145nCsGDMoFenV6ajNi2PR5WCwpAxW6Q==", "dependencies": { "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.6" + "@rushstack/node-core-library": "3.59.7" } }, "node_modules/@microsoft/api-extractor/node_modules/typescript": { @@ -540,9 +540,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", - "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.3.tgz", + "integrity": "sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g==", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -1217,9 +1217,9 @@ } }, "node_modules/@rushstack/node-core-library": { - "version": "3.59.6", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.6.tgz", - "integrity": "sha512-bMYJwNFfWXRNUuHnsE9wMlW/mOB4jIwSUkRKtu02CwZhQdmzMsUbxE0s1xOLwTpNIwlzfW/YT7OnOHgDffLgYg==", + "version": "3.59.7", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.7.tgz", + "integrity": "sha512-ln1Drq0h+Hwa1JVA65x5mlSgUrBa1uHL+V89FqVWQgXd1vVIMhrtqtWGQrhTnFHxru5ppX+FY39VWELF/FjQCw==", "dependencies": { "colors": "~1.2.1", "fs-extra": "~7.0.1", @@ -1239,18 +1239,18 @@ } }, "node_modules/@rushstack/rig-package": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.4.0.tgz", - "integrity": "sha512-FnM1TQLJYwSiurP6aYSnansprK5l8WUK8VG38CmAaZs29ZeL1msjK0AP1VS4ejD33G0kE/2cpsPsS9jDenBMxw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.4.1.tgz", + "integrity": "sha512-AGRwpqlXNSp9LhUSz4HKI9xCluqQDt/obsQFdv/NYIekF3pTTPzc+HbQsIsjVjYnJ3DcmxOREVMhvrMEjpiq6g==", "dependencies": { "resolve": "~1.22.1", "strip-json-comments": "~3.1.1" } }, "node_modules/@rushstack/ts-command-line": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.15.1.tgz", - "integrity": "sha512-EL4jxZe5fhb1uVL/P/wQO+Z8Rc8FMiWJ1G7VgnPDvdIt5GVjRfK7vwzder1CZQiX3x0PY6uxENYLNGTFd1InRQ==", + "version": "4.15.2", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.15.2.tgz", + "integrity": "sha512-5+C2uoJY8b+odcZD6coEe2XNC4ZjGB4vCMESbqW/8DHRWC/qIHfANdmN9F1wz/lAgxz72i7xRoVtPY2j7e4gpQ==", "dependencies": { "@types/argparse": "1.0.38", "argparse": "~1.0.9", @@ -1402,9 +1402,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.196", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz", - "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==" + "version": "4.14.197", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz", + "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==" }, "node_modules/@types/minimatch": { "version": "5.1.2", @@ -1432,9 +1432,9 @@ "integrity": "sha512-bz9STa6EHurtpSfn5cNiScBladlw43bM+7luQA985Kd9YlF4dZaLmKt3c5/oSyN1AWAl50YBpqTq0BxCP64nGg==" }, "node_modules/@types/react": { - "version": "16.14.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.43.tgz", - "integrity": "sha512-7zdjv7jvoLLQg1tTvpQsm+hyNUMT2mPlNV1+d0I8fbGhkJl82spopMyBlu4wb1dviZAxpGdk5eHu/muacknnfw==", + "version": "16.14.45", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.45.tgz", + "integrity": "sha512-XFtKkY3yuPO5VJSE6Lru9yLkVQvYE+l6NbmLp6IWCg4jo5S8Ijbpke8wC9q4NmQ5pJErT8KKboG5eY7n5n718A==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1488,21 +1488,20 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.2.0.tgz", - "integrity": "sha512-rClGrMuyS/3j0ETa1Ui7s6GkLhfZGKZL3ZrChLeAiACBE/tRc1wq8SNZESUuluxhLj9FkUefRs2l6bCIArWBiQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/type-utils": "6.2.0", - "@typescript-eslint/utils": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", - "natural-compare-lite": "^1.4.0", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, @@ -1524,15 +1523,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.0.tgz", - "integrity": "sha512-igVYOqtiK/UsvKAmmloQAruAdUHihsOCvplJpplPZ+3h4aDkC/UKZZNKgB6h93ayuYLuEymU3h8nF1xMRbh37g==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/typescript-estree": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4" }, "engines": { @@ -1552,13 +1551,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.0.tgz", - "integrity": "sha512-1ZMNVgm5nnHURU8ZSJ3snsHzpFeNK84rdZjluEVBGNu7jDymfqceB3kdIZ6A4xCfEFFhRIB6rF8q/JIqJd2R0Q==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.0.tgz", + "integrity": "sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==", "peer": true, "dependencies": { - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0" + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1569,13 +1568,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.2.0.tgz", - "integrity": "sha512-DnGZuNU2JN3AYwddYIqrVkYW0uUQdv0AY+kz2M25euVNlujcN2u+rJgfJsBFlUEzBB6OQkUqSZPyuTLf2bP5mw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", "peer": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.2.0", - "@typescript-eslint/utils": "6.2.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1596,9 +1595,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.0.tgz", - "integrity": "sha512-1nRRaDlp/XYJQLvkQJG5F3uBTno5SHPT7XVcJ5n1/k2WfNI28nJsvLakxwZRNY5spuatEKO7d5nZWsQpkqXwBA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "peer": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1609,13 +1608,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.0.tgz", - "integrity": "sha512-Mts6+3HQMSM+LZCglsc2yMIny37IhUgp1Qe8yJUYVyO6rHP7/vN0vajKu3JvHCBIy8TSiKddJ/Zwu80jhnGj1w==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "peer": true, "dependencies": { - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1636,17 +1635,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.2.0.tgz", - "integrity": "sha512-RCFrC1lXiX1qEZN8LmLrxYRhOkElEsPKTVSNout8DMzf8PeWoQG7Rxz2SadpJa3VSh5oYKGwt7j7X/VRg+Y3OQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/typescript-estree": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", "semver": "^7.5.4" }, "engines": { @@ -1661,12 +1660,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.0.tgz", - "integrity": "sha512-QbaYUQVKKo9bgCzpjz45llCfwakyoxHetIy8CAvYCtd16Zu1KrpzNHofwF8kGkpPOxZB2o6kz+0nqH8ZkIzuoQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.0.tgz", + "integrity": "sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==", "peer": true, "dependencies": { - "@typescript-eslint/types": "6.2.0", + "@typescript-eslint/types": "6.4.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1741,9 +1740,9 @@ } }, "node_modules/ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==" }, "node_modules/ansi-styles": { "version": "4.3.0", @@ -1963,9 +1962,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "funding": [ { "type": "opencollective", @@ -1981,9 +1980,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.11" }, "bin": { @@ -2082,9 +2081,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==", "funding": [ { "type": "opencollective", @@ -2467,9 +2466,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.471", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.471.tgz", - "integrity": "sha512-GpmGRC1vTl60w/k6YpQ18pSiqnmr0j3un//5TV1idPi6aheNfkT1Ye71tMEabWyNDO6sBMgAR+95Eb0eUUr1tA==" + "version": "1.4.490", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz", + "integrity": "sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -2521,27 +2520,27 @@ } }, "node_modules/eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -2596,9 +2595,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz", - "integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "peer": true, "dependencies": { "esrecurse": "^4.3.0", @@ -2612,9 +2611,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3036,6 +3035,19 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3152,9 +3164,9 @@ } }, "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "peer": true, "dependencies": { "type-fest": "^0.20.2" @@ -3714,9 +3726,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dependencies": { "has": "^1.0.3" }, @@ -4245,12 +4257,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "peer": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "peer": true - }, "node_modules/nise": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", @@ -5033,11 +5039,11 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -5124,9 +5130,9 @@ } }, "node_modules/rollup": { - "version": "3.26.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.3.tgz", - "integrity": "sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", + "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", "bin": { "rollup": "dist/bin/rollup" }, @@ -5914,9 +5920,9 @@ } }, "node_modules/validator": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.9.0.tgz", - "integrity": "sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==", + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", "engines": { "node": ">= 0.10" } @@ -6081,12 +6087,12 @@ "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==" }, "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", + "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", "requires": { "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -6157,9 +6163,9 @@ "peer": true }, "@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "peer": true, "requires": { "ajv": "^6.12.4", @@ -6174,9 +6180,9 @@ } }, "@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", + "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", "peer": true }, "@humanwhocodes/config-array": { @@ -6208,16 +6214,16 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "@microsoft/api-extractor": { - "version": "7.36.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.36.3.tgz", - "integrity": "sha512-u0H6362AQq+r55X8drHx4npgkrCfJnMzRRHfQo8PMNKB8TcBnrTLfXhXWi+xnTM6CzlU/netEN8c4bq581Rnrg==", + "version": "7.36.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.36.4.tgz", + "integrity": "sha512-21UECq8C/8CpHT23yiqTBQ10egKUacIpxkPyYR7hdswo/M5yTWdBvbq+77YC9uPKQJOUfOD1FImBQ1DzpsdeQQ==", "requires": { - "@microsoft/api-extractor-model": "7.27.5", + "@microsoft/api-extractor-model": "7.27.6", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.6", - "@rushstack/rig-package": "0.4.0", - "@rushstack/ts-command-line": "4.15.1", + "@rushstack/node-core-library": "3.59.7", + "@rushstack/rig-package": "0.4.1", + "@rushstack/ts-command-line": "4.15.2", "colors": "~1.2.1", "lodash": "~4.17.15", "resolve": "~1.22.1", @@ -6234,13 +6240,13 @@ } }, "@microsoft/api-extractor-model": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.27.5.tgz", - "integrity": "sha512-9/tBzYMJitR+o+zkPr1lQh2+e8ClcaTF6eZo7vZGDqRt2O5XmXWPbYJZmxyM3wb5at6lfJNEeGZrQXLjsQ0Nbw==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.27.6.tgz", + "integrity": "sha512-eiCnlayyum1f7fS2nA9pfIod5VCNR1G+Tq84V/ijDrKrOFVa598BLw145nCsGDMoFenV6ajNi2PR5WCwpAxW6Q==", "requires": { "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.59.6" + "@rushstack/node-core-library": "3.59.7" } }, "@microsoft/applicationinsights-web-snippet": { @@ -6390,9 +6396,9 @@ } }, "@rollup/pluginutils": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", - "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.3.tgz", + "integrity": "sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g==", "requires": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -7028,9 +7034,9 @@ } }, "@rushstack/node-core-library": { - "version": "3.59.6", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.6.tgz", - "integrity": "sha512-bMYJwNFfWXRNUuHnsE9wMlW/mOB4jIwSUkRKtu02CwZhQdmzMsUbxE0s1xOLwTpNIwlzfW/YT7OnOHgDffLgYg==", + "version": "3.59.7", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.59.7.tgz", + "integrity": "sha512-ln1Drq0h+Hwa1JVA65x5mlSgUrBa1uHL+V89FqVWQgXd1vVIMhrtqtWGQrhTnFHxru5ppX+FY39VWELF/FjQCw==", "requires": { "colors": "~1.2.1", "fs-extra": "~7.0.1", @@ -7042,18 +7048,18 @@ } }, "@rushstack/rig-package": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.4.0.tgz", - "integrity": "sha512-FnM1TQLJYwSiurP6aYSnansprK5l8WUK8VG38CmAaZs29ZeL1msjK0AP1VS4ejD33G0kE/2cpsPsS9jDenBMxw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.4.1.tgz", + "integrity": "sha512-AGRwpqlXNSp9LhUSz4HKI9xCluqQDt/obsQFdv/NYIekF3pTTPzc+HbQsIsjVjYnJ3DcmxOREVMhvrMEjpiq6g==", "requires": { "resolve": "~1.22.1", "strip-json-comments": "~3.1.1" } }, "@rushstack/ts-command-line": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.15.1.tgz", - "integrity": "sha512-EL4jxZe5fhb1uVL/P/wQO+Z8Rc8FMiWJ1G7VgnPDvdIt5GVjRfK7vwzder1CZQiX3x0PY6uxENYLNGTFd1InRQ==", + "version": "4.15.2", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.15.2.tgz", + "integrity": "sha512-5+C2uoJY8b+odcZD6coEe2XNC4ZjGB4vCMESbqW/8DHRWC/qIHfANdmN9F1wz/lAgxz72i7xRoVtPY2j7e4gpQ==", "requires": { "@types/argparse": "1.0.38", "argparse": "~1.0.9", @@ -7196,9 +7202,9 @@ } }, "@types/lodash": { - "version": "4.14.196", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz", - "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==" + "version": "4.14.197", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz", + "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==" }, "@types/minimatch": { "version": "5.1.2", @@ -7226,9 +7232,9 @@ "integrity": "sha512-bz9STa6EHurtpSfn5cNiScBladlw43bM+7luQA985Kd9YlF4dZaLmKt3c5/oSyN1AWAl50YBpqTq0BxCP64nGg==" }, "@types/react": { - "version": "16.14.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.43.tgz", - "integrity": "sha512-7zdjv7jvoLLQg1tTvpQsm+hyNUMT2mPlNV1+d0I8fbGhkJl82spopMyBlu4wb1dviZAxpGdk5eHu/muacknnfw==", + "version": "16.14.45", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.45.tgz", + "integrity": "sha512-XFtKkY3yuPO5VJSE6Lru9yLkVQvYE+l6NbmLp6IWCg4jo5S8Ijbpke8wC9q4NmQ5pJErT8KKboG5eY7n5n718A==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -7282,74 +7288,73 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.2.0.tgz", - "integrity": "sha512-rClGrMuyS/3j0ETa1Ui7s6GkLhfZGKZL3ZrChLeAiACBE/tRc1wq8SNZESUuluxhLj9FkUefRs2l6bCIArWBiQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", "peer": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/type-utils": "6.2.0", - "@typescript-eslint/utils": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", - "natural-compare-lite": "^1.4.0", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/parser": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.0.tgz", - "integrity": "sha512-igVYOqtiK/UsvKAmmloQAruAdUHihsOCvplJpplPZ+3h4aDkC/UKZZNKgB6h93ayuYLuEymU3h8nF1xMRbh37g==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "peer": true, "requires": { - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/typescript-estree": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.0.tgz", - "integrity": "sha512-1ZMNVgm5nnHURU8ZSJ3snsHzpFeNK84rdZjluEVBGNu7jDymfqceB3kdIZ6A4xCfEFFhRIB6rF8q/JIqJd2R0Q==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.0.tgz", + "integrity": "sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==", "peer": true, "requires": { - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0" + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0" } }, "@typescript-eslint/type-utils": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.2.0.tgz", - "integrity": "sha512-DnGZuNU2JN3AYwddYIqrVkYW0uUQdv0AY+kz2M25euVNlujcN2u+rJgfJsBFlUEzBB6OQkUqSZPyuTLf2bP5mw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", "peer": true, "requires": { - "@typescript-eslint/typescript-estree": "6.2.0", - "@typescript-eslint/utils": "6.2.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.0.tgz", - "integrity": "sha512-1nRRaDlp/XYJQLvkQJG5F3uBTno5SHPT7XVcJ5n1/k2WfNI28nJsvLakxwZRNY5spuatEKO7d5nZWsQpkqXwBA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "peer": true }, "@typescript-eslint/typescript-estree": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.0.tgz", - "integrity": "sha512-Mts6+3HQMSM+LZCglsc2yMIny37IhUgp1Qe8yJUYVyO6rHP7/vN0vajKu3JvHCBIy8TSiKddJ/Zwu80jhnGj1w==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "peer": true, "requires": { - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/visitor-keys": "6.2.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -7358,27 +7363,27 @@ } }, "@typescript-eslint/utils": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.2.0.tgz", - "integrity": "sha512-RCFrC1lXiX1qEZN8LmLrxYRhOkElEsPKTVSNout8DMzf8PeWoQG7Rxz2SadpJa3VSh5oYKGwt7j7X/VRg+Y3OQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", "peer": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.2.0", - "@typescript-eslint/types": "6.2.0", - "@typescript-eslint/typescript-estree": "6.2.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.0.tgz", - "integrity": "sha512-QbaYUQVKKo9bgCzpjz45llCfwakyoxHetIy8CAvYCtd16Zu1KrpzNHofwF8kGkpPOxZB2o6kz+0nqH8ZkIzuoQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.0.tgz", + "integrity": "sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==", "peer": true, "requires": { - "@typescript-eslint/types": "6.2.0", + "@typescript-eslint/types": "6.4.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -7425,9 +7430,9 @@ "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" }, "ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==" }, "ansi-styles": { "version": "4.3.0", @@ -7599,13 +7604,13 @@ } }, "browserslist": { - "version": "4.21.9", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", - "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "requires": { - "caniuse-lite": "^1.0.30001503", - "electron-to-chromium": "^1.4.431", - "node-releases": "^2.0.12", + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.11" } }, @@ -7663,9 +7668,9 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==" + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==" }, "chalk": { "version": "4.1.2", @@ -7945,9 +7950,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "electron-to-chromium": { - "version": "1.4.471", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.471.tgz", - "integrity": "sha512-GpmGRC1vTl60w/k6YpQ18pSiqnmr0j3un//5TV1idPi6aheNfkT1Ye71tMEabWyNDO6sBMgAR+95Eb0eUUr1tA==" + "version": "1.4.490", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz", + "integrity": "sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==" }, "encodeurl": { "version": "1.0.2", @@ -7987,27 +7992,27 @@ "peer": true }, "eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "peer": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -8050,9 +8055,9 @@ } }, "eslint-scope": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.1.tgz", - "integrity": "sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "peer": true, "requires": { "esrecurse": "^4.3.0", @@ -8060,9 +8065,9 @@ } }, "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "peer": true }, "espree": { @@ -8392,6 +8397,12 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -8482,9 +8493,9 @@ } }, "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "peer": true, "requires": { "type-fest": "^0.20.2" @@ -8888,9 +8899,9 @@ } }, "is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "requires": { "has": "^1.0.3" } @@ -9323,12 +9334,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "peer": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "peer": true - }, "nise": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", @@ -9890,11 +9895,11 @@ "peer": true }, "resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "requires": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -9955,9 +9960,9 @@ } }, "rollup": { - "version": "3.26.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.3.tgz", - "integrity": "sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", + "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", "requires": { "fsevents": "~2.3.2" } @@ -10541,9 +10546,9 @@ } }, "validator": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.9.0.tgz", - "integrity": "sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==" + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==" }, "vscode-oniguruma": { "version": "1.7.0", diff --git a/shared/AppInsightsCommon/Tests/Unit/src/ThrottleMgr.tests.ts b/shared/AppInsightsCommon/Tests/Unit/src/ThrottleMgr.tests.ts index 672d445f3..84f1d4413 100644 --- a/shared/AppInsightsCommon/Tests/Unit/src/ThrottleMgr.tests.ts +++ b/shared/AppInsightsCommon/Tests/Unit/src/ThrottleMgr.tests.ts @@ -1,12 +1,12 @@ import { Assert, AITestClass } from "@microsoft/ai-test-framework"; -import { AppInsightsCore, IAppInsightsCore, _eInternalMessageId } from "@microsoft/applicationinsights-core-js"; +import { AppInsightsCore, IAppInsightsCore, IConfiguration, IPlugin, _eInternalMessageId } from "@microsoft/applicationinsights-core-js"; import { ThrottleMgr} from "../../../src/ThrottleMgr"; import { SinonSpy } from "sinon"; import { utlCanUseLocalStorage } from "../../../src/StorageHelperFuncs"; -import { IThrottleMsgKey } from "../../../src/Enums"; import { IThrottleInterval, IThrottleLimit, IThrottleMgrConfig, IThrottleResult } from "../../../src/Interfaces/IThrottleMgr"; +import { IConfig } from "../../../types/applicationinsights-common"; -const daysInMonth = [ +const daysInMonth = [ 31, // Jan 28, // Feb 31, // Mar @@ -41,18 +41,20 @@ const compareDates = (date1: Date, date: string | Date, expectedSame: boolean = } export class ThrottleMgrTest extends AITestClass { - private _core: IAppInsightsCore; - private _msgKey: IThrottleMsgKey; + private _core: IAppInsightsCore; + private _msgKey: number; private _storageName: string; private _msgId: _eInternalMessageId; private loggingSpy: SinonSpy; + private _channel; public testInitialize() { this._core = new AppInsightsCore(); - this._msgKey = IThrottleMsgKey.ikeyDeprecate; + this._msgKey = _eInternalMessageId.InstrumentationKeyDeprecation; this._storageName = "appInsightsThrottle-" + this._msgKey; this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); this._msgId = _eInternalMessageId.InstrumentationKeyDeprecation; + this._channel = new ChannelPlugin(); if (utlCanUseLocalStorage()) { window.localStorage.clear(); @@ -63,6 +65,8 @@ export class ThrottleMgrTest extends AITestClass { if (utlCanUseLocalStorage()) { window.localStorage.clear(); } + + this.loggingSpy = null; } public registerTests() { @@ -71,7 +75,6 @@ export class ThrottleMgrTest extends AITestClass { name: "ThrottleMgrTest: Default config should be set from root", test: () => { let expectedconfig = { - msgKey: IThrottleMsgKey.default, disabled: false, limit: { samplingRate: 100, @@ -83,22 +86,58 @@ export class ThrottleMgrTest extends AITestClass { daysOfMonth: [28] } as IThrottleInterval } as IThrottleMgrConfig; + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: expectedconfig + }; + this._core.initialize(coreCfg, [this._channel]); - let throttleMgr = new ThrottleMgr({}, this._core); + let throttleMgr = new ThrottleMgr(this._core); let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedconfig, actualConfig, "should get expected default config"); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false, "should not be triggered"); } }); + this.testCase({ + name: "ThrottleMgrTest: Mutiple msg keys - Default config should be set from root", + test: () => { + let expectedconfig = { + disabled: false, + limit: { + samplingRate: 100, + maxSendNumber: 1 + } as IThrottleLimit, + interval: { + monthInterval: 3, + dayInterval: undefined, + daysOfMonth: [28] + } as IThrottleInterval + } as IThrottleMgrConfig; + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: expectedconfig + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); + Assert.deepEqual(expectedconfig, actualConfig, "should get expected default config"); + let isTriggered = throttleMgr.isTriggered(this._msgId); + Assert.equal(isTriggered, false, "should not be triggered"); + + isTriggered = throttleMgr.isTriggered(109); + Assert.equal(isTriggered, false, "should not be triggered msg key 109"); + } + }); + this.testCase({ name: "ThrottleMgrTest: Config should be updated dynamically", useFakeTimers: true, test: () => { let date = new Date(); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 50, @@ -110,16 +149,20 @@ export class ThrottleMgrTest extends AITestClass { daysOfMonth: [date.getUTCDate()] } as IThrottleInterval } as IThrottleMgrConfig; + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); - let throttleMgr = new ThrottleMgr(config, this._core); + let throttleMgr = new ThrottleMgr(this._core); let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(config, actualConfig, "should get expected config"); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false, "should not be triggered"); - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.deepEqual(canThrottle, true, "should be able to throttle"); - config.msgKey = IThrottleMsgKey.cdnDeprecate; config.disabled = true; config.limit = { samplingRate: 80, @@ -129,11 +172,12 @@ export class ThrottleMgrTest extends AITestClass { monthInterval: 3, dayInterval: undefined, daysOfMonth: [date.getUTCDate() + 1] - } as IThrottleInterval + } as IThrottleInterval; + this._core.config.throttleMgrCfg = config; this.clock.tick(1); actualConfig = throttleMgr.getConfig(); Assert.deepEqual(config, actualConfig, "config should be updated dynamically"); - canThrottle = throttleMgr.canThrottle(); + canThrottle = throttleMgr.canThrottle(this._msgId); Assert.deepEqual(canThrottle, false, "should not be able to throttle"); } }); @@ -143,7 +187,6 @@ export class ThrottleMgrTest extends AITestClass { test: () => { let date = new Date(); let expectedconfig = { - msgKey: IThrottleMsgKey.ikeyDeprecate, disabled: false, limit: { samplingRate: 100, @@ -156,12 +199,19 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(expectedconfig, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: expectedconfig + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedconfig, actualConfig, "should get expected default config"); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgKey); Assert.equal(isTriggered, false, "should not be triggered"); - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgKey); Assert.equal(canThrottle, true, "should be able to be throttle"); let isReady = throttleMgr.isReady(); @@ -171,13 +221,13 @@ export class ThrottleMgrTest extends AITestClass { // note: _getDbgPlgTargets returns array let target = throttleMgr["_getDbgPlgTargets"](); Assert.ok(target && target.length === 1, "target should contain queue"); - let queue = target[0]; - Assert.equal(queue.length, 1, "should have 1 item"); - Assert.equal(queue[0].msgID, this._msgId, "sshould habe correct msgId"); + let queue = target[0][this._msgKey]; + Assert.deepEqual(queue.length,1, "should have 1 item"); + Assert.equal(queue[0].msgID, this._msgId, "should be correct msgId"); throttleMgr.onReadyState(true); target = throttleMgr["_getDbgPlgTargets"](); - queue = target[0]; + queue = target[0][this._msgKey]; Assert.equal(queue.length, 0, "queue should be empty"); let storage = window.localStorage[this._storageName]; let dateNum = date.getUTCDate(); @@ -186,11 +236,83 @@ export class ThrottleMgrTest extends AITestClass { } }); + this.testCase({ + name: "ThrottleMgrTest: Mutiple msg keys - flush", + test: () => { + let msgId = 109; + let storageName = this._storageName = "appInsightsThrottle-" + msgId; + let date = new Date(); + let expectedconfig = { + disabled: false, + limit: { + samplingRate: 100, + maxSendNumber: 10 + } as IThrottleLimit, + interval: { + monthInterval: 1, + dayInterval: undefined, + daysOfMonth: [date.getUTCDate()] + } as IThrottleInterval + } as IThrottleMgrConfig; + + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: expectedconfig + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + let actualConfig = throttleMgr.getConfig(); + Assert.deepEqual(expectedconfig, actualConfig, "should get expected default config"); + let isTriggered = throttleMgr.isTriggered(this._msgKey); + Assert.equal(isTriggered, false, "should not be triggered"); + let canThrottle = throttleMgr.canThrottle(this._msgKey); + Assert.equal(canThrottle, true, "should be able to be throttle"); + isTriggered = throttleMgr.isTriggered(msgId); + Assert.equal(isTriggered, false, "should not be triggered test1"); + canThrottle = throttleMgr.canThrottle(msgId); + Assert.equal(canThrottle, true, "should be able to be throttle test1"); + + let isReady = throttleMgr.isReady(); + Assert.equal(isReady, false, "isReady state should be false"); + let result = throttleMgr.sendMessage(this._msgId, "test"); + Assert.equal(result, null, "should not be throttled"); + result = throttleMgr.sendMessage(msgId, "test1"); + Assert.equal(result, null, "should not be throttled test1"); + // note: _getDbgPlgTargets returns array + let target = throttleMgr["_getDbgPlgTargets"](); + Assert.ok(target && target.length === 1, "target should contain queue"); + let queue = target[0][this._msgKey]; + Assert.deepEqual(queue.length,1, "should have 1 item"); + Assert.equal(queue[0].msgID, this._msgId, "should be correct msgId"); + queue = target[0][msgId]; + Assert.deepEqual(queue.length,1, "should have 1 item test1"); + Assert.equal(queue[0].msgID, msgId, "should be correct msgId test1"); + + throttleMgr.onReadyState(true); + target = throttleMgr["_getDbgPlgTargets"](); + queue = target[0][this._msgKey]; + Assert.equal(queue.length, 0, "queue should be empty"); + let storage = window.localStorage[this._storageName]; + let dateNum = date.getUTCDate(); + let prefix = dateNum < 10? "0":""; + Assert.ok(storage.indexOf(`${date.getUTCMonth() + 1}-${prefix + dateNum}`) > -1, "local storage should have correct date"); + + target = throttleMgr["_getDbgPlgTargets"](); + queue = target[0][msgId]; + Assert.equal(queue.length, 0, "queue should be empty test1"); + storage = window.localStorage[storageName]; + dateNum = date.getUTCDate(); + prefix = dateNum < 10? "0":""; + Assert.ok(storage.indexOf(`${date.getUTCMonth() + 1}-${prefix + dateNum}`) > -1, "local storage should have correct date test1"); + } + }); + this.testCase({ name: "ThrottleMgrTest: Throttle Manager can get expected config", test: () => { let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 50, @@ -203,11 +325,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(config, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgKey); Assert.equal(isTriggered, false); } }); @@ -215,12 +343,8 @@ export class ThrottleMgrTest extends AITestClass { this.testCase({ name: "ThrottleMgrTest: Throttle Manager can get default config", test: () => { - let config = { - msgKey: this._msgKey - } as IThrottleMgrConfig; let expectedConfig = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -233,11 +357,18 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: {} + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedConfig, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } }); @@ -247,7 +378,6 @@ export class ThrottleMgrTest extends AITestClass { test: () => { let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -259,7 +389,6 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleMgrConfig; let expectedConfig = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -272,11 +401,18 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedConfig, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } }); @@ -286,7 +422,6 @@ export class ThrottleMgrTest extends AITestClass { test: () => { let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -298,7 +433,6 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleMgrConfig; let expectedConfig = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -311,11 +445,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedConfig, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } }); @@ -332,7 +472,6 @@ export class ThrottleMgrTest extends AITestClass { daysOfMonth = [day-1, day]; } let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -345,14 +484,20 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(config, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, true, "should throttle"); } @@ -363,12 +508,8 @@ export class ThrottleMgrTest extends AITestClass { test: () => { let date = new Date(); let day = date.getUTCDate(); - let config = { - msgKey: this._msgKey - } as IThrottleMgrConfig; let expectedConfig = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 100, @@ -381,11 +522,16 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test" + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + let actualConfig = throttleMgr.getConfig(); Assert.deepEqual(expectedConfig, actualConfig); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); let shouldTrigger = false; @@ -393,7 +539,7 @@ export class ThrottleMgrTest extends AITestClass { shouldTrigger = true; } - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, shouldTrigger, "should only throttle on 28th"); } }); @@ -402,14 +548,19 @@ export class ThrottleMgrTest extends AITestClass { name: "ThrottleMgrTest: should not trigger throttle when disabled is true", test: () => { let config = { - msgKey: this._msgKey, disabled: true } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, false); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } }); @@ -437,7 +588,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -448,12 +598,17 @@ export class ThrottleMgrTest extends AITestClass { dayInterval: 1 } as IThrottleInterval } as IThrottleMgrConfig; - - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, false); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } @@ -484,7 +639,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -496,11 +650,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, false); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } @@ -527,7 +687,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -539,11 +698,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, false); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } @@ -560,7 +725,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -572,11 +736,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, true); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } @@ -595,7 +765,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -607,11 +776,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, true); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggered, false); } @@ -627,7 +802,6 @@ export class ThrottleMgrTest extends AITestClass { } window.localStorage[this._storageName] = JSON.stringify(storageObj); let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -639,16 +813,23 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, true); - let isTriggered = throttleMgr.isTriggered(); + let isTriggered = throttleMgr.isTriggered(this._msgId); Assert.ok(isTriggered); let result = throttleMgr.sendMessage(this._msgId, "test"); let count = this.loggingSpy.callCount; Assert.equal(count,0); Assert.deepEqual(result, null); - let postIsTriggered = throttleMgr.isTriggered(); + let postIsTriggered = throttleMgr.isTriggered(this._msgId); Assert.ok(postIsTriggered); } @@ -673,7 +854,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = preStorageVal; let config = { - msgKey: this._msgKey, disabled: false, limit: { samplingRate: 1000000, @@ -685,10 +865,17 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); - let canThrottle = throttleMgr.canThrottle(); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottle, true); - let isPretriggered = throttleMgr.isTriggered(); + let isPretriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isPretriggered, false); throttleMgr.onReadyState(true); @@ -699,7 +886,7 @@ export class ThrottleMgrTest extends AITestClass { throttleNum: 1 } as IThrottleResult; Assert.deepEqual(result, expectedRetryRlt); - let isPostTriggered = throttleMgr.isTriggered(); + let isPostTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(isPostTriggered, true); let afterTriggered = window.localStorage[this._storageName]; @@ -714,10 +901,10 @@ export class ThrottleMgrTest extends AITestClass { this.testCase({ name: "ThrottleMgrTest: should not trigger sendmessage when isready state is not set and should flush message after isReady state is set", test: () => { + let msg = "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"; let date = new Date(); let config = { - msgKey: IThrottleMsgKey.ikeyDeprecate, disabled: false, limit: { samplingRate: 1000000, @@ -728,13 +915,21 @@ export class ThrottleMgrTest extends AITestClass { dayInterval: 1 } as IThrottleInterval } as IThrottleMgrConfig; - - let throttleMgr = new ThrottleMgr(config, this._core); + + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.ok(canThrottle); - let isTriggeredPre = throttleMgr.isTriggered(); + let isTriggeredPre = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPre, false); let initialVal = window.localStorage[this._storageName]; let initObj = JSON.parse(initialVal); @@ -746,7 +941,7 @@ export class ThrottleMgrTest extends AITestClass { let count = this.loggingSpy.callCount; Assert.equal(count,0); Assert.deepEqual(result, null); - let isTriggeredPost = throttleMgr.isTriggered(); + let isTriggeredPost = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPost, false); let postVal = window.localStorage[this._storageName]; let postObj = JSON.parse(postVal); @@ -756,7 +951,7 @@ export class ThrottleMgrTest extends AITestClass { let isFlushed = throttleMgr.onReadyState(true); Assert.ok(isFlushed); - let isTriggeredAfterReadySate = throttleMgr.isTriggered(); + let isTriggeredAfterReadySate = throttleMgr.isTriggered(this._msgId); Assert.ok(isTriggeredAfterReadySate); let postOnReadyVal = window.localStorage[this._storageName]; let postOnReadyObj = JSON.parse(postOnReadyVal); @@ -770,9 +965,9 @@ export class ThrottleMgrTest extends AITestClass { isThrottled: false, throttleNum: 0 } as IThrottleResult - Assert.equal(onReadyCount,1); + Assert.equal(onReadyCount,1, "test1"); Assert.deepEqual(onReadyResult, expectedRlt); - let onReadyIsTriggered = throttleMgr.isTriggered(); + let onReadyIsTriggered = throttleMgr.isTriggered(this._msgId); Assert.equal(onReadyIsTriggered, true); let afterResendVal = window.localStorage[this._storageName]; let afterResendObj = JSON.parse(afterResendVal); @@ -796,7 +991,6 @@ export class ThrottleMgrTest extends AITestClass { window.localStorage[this._storageName] = testStorageVal; let config = { - msgKey: IThrottleMsgKey.ikeyDeprecate, disabled: false, limit: { samplingRate: 1000000, @@ -808,12 +1002,22 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); - let canThrottle = throttleMgr.canThrottle(); + + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.ok(canThrottle); - let isTriggeredPre = throttleMgr.isTriggered(); + let isTriggeredPre = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPre, false); throttleMgr.onReadyState(true); @@ -833,18 +1037,103 @@ export class ThrottleMgrTest extends AITestClass { Assert.equal(0, obj.count); compareDates(date, obj.preTriggerDate); - let isTriggeredPost = throttleMgr.isTriggered(); + let isTriggeredPost = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPost, true); } }); + this.testCase({ + name: "ThrottleMgrTest: Mutiple keys - throw messages with correct number", + test: () => { + let msg = "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"; + let msgId = 109; + let storageName = "appInsightsThrottle-" + msgId; + let date = new Date(); + let testStorageObj = { + date: date, + count: 5 + } + let testStorageVal = JSON.stringify(testStorageObj); + window.localStorage[this._storageName] = testStorageVal; + window.localStorage[storageName] = testStorageVal; + + let config = { + disabled: false, + limit: { + samplingRate: 1000000, + maxSendNumber:1 + } as IThrottleLimit, + interval: { + monthInterval: 1, + dayInterval: 1 + } as IThrottleInterval + } as IThrottleMgrConfig; + + + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + + this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); + + + let canThrottle = throttleMgr.canThrottle(this._msgId); + Assert.ok(canThrottle, "can throttle"); + canThrottle = throttleMgr.canThrottle(msgId); + Assert.ok(canThrottle, "can throttle test1"); + + let isTriggeredPre = throttleMgr.isTriggered(this._msgId); + Assert.equal(isTriggeredPre, false, "preTrigger"); + isTriggeredPre = throttleMgr.isTriggered(msgId); + Assert.equal(isTriggeredPre, false, "preTrigger test1"); + + throttleMgr.onReadyState(true); + + let result = throttleMgr.sendMessage(this._msgId, msg); + let count = this.loggingSpy.callCount + Assert.equal(count,1, "sendMsg count"); + let expectedRlt = { + isThrottled: true, + throttleNum: 1 + } as IThrottleResult + Assert.deepEqual(result, expectedRlt, "expected result"); + result = throttleMgr.sendMessage(msgId, msg); + count = this.loggingSpy.callCount + Assert.equal(count,2, "sendMsg count test1"); + expectedRlt = { + isThrottled: true, + throttleNum: 1 + } as IThrottleResult + Assert.deepEqual(result, expectedRlt, "expected result test1"); + + let val = window.localStorage[this._storageName]; + let obj = JSON.parse(val); + compareDates(date, obj.date); + Assert.equal(0, obj.count, "local storage count"); + compareDates(date, obj.preTriggerDate); + val = window.localStorage[storageName]; + obj = JSON.parse(val); + compareDates(date, obj.date); + Assert.equal(0, obj.count, "local storage count test1"); + compareDates(date, obj.preTriggerDate); + + let isTriggeredPost = throttleMgr.isTriggered(this._msgId); + Assert.equal(isTriggeredPost, true, "trigger post"); + isTriggeredPost = throttleMgr.isTriggered(msgId); + Assert.equal(isTriggeredPost, true, "trigger post test1"); + } + }); + this.testCase({ name: "ThrottleMgrTest: should throw messages 1 time within a day", test: () => { let msg = "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"; let config = { - msgKey: IThrottleMsgKey.ikeyDeprecate, disabled: false, limit: { samplingRate: 1000000, @@ -856,12 +1145,20 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleInterval } as IThrottleMgrConfig; - let throttleMgr = new ThrottleMgr(config, this._core); + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); + - let canThrottle = throttleMgr.canThrottle(); + let canThrottle = throttleMgr.canThrottle(this._msgId); Assert.ok(canThrottle); - let isTriggeredPre = throttleMgr.isTriggered(); + let isTriggeredPre = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPre, false); throttleMgr.onReadyState(true); @@ -876,9 +1173,9 @@ export class ThrottleMgrTest extends AITestClass { } as IThrottleResult Assert.deepEqual(result, expectedRlt); - let isTriggeredPost = throttleMgr.isTriggered(); + let isTriggeredPost = throttleMgr.isTriggered(this._msgId); Assert.equal(isTriggeredPost, true); - let canThrottlePost = throttleMgr.canThrottle(); + let canThrottlePost = throttleMgr.canThrottle(this._msgId); Assert.equal(canThrottlePost, true); let retryRlt = throttleMgr.sendMessage(this._msgId, msg); @@ -891,5 +1188,135 @@ export class ThrottleMgrTest extends AITestClass { Assert.deepEqual(retryRlt, expectedRetryRlt); } }); + + this.testCase({ + name: "ThrottleMgrTest: Mutiple msg keys - should throw messages 1 time within a day", + test: () => { + let msg = "Instrumentation key support will end soon, see aka.ms/IkeyMigrate"; + let msgId = 109; + + let config = { + disabled: false, + limit: { + samplingRate: 1000000, + maxSendNumber:1 + } as IThrottleLimit, + interval: { + monthInterval: 1, + dayInterval: 1 + } as IThrottleInterval + } as IThrottleMgrConfig; + + let coreCfg = { + instrumentationKey: "test", + throttleMgrCfg: config + }; + this._core.initialize(coreCfg, [this._channel]); + + let throttleMgr = new ThrottleMgr(this._core); + this.loggingSpy = this.sandbox.stub(this._core.logger, "throwInternal"); + + + let canThrottle = throttleMgr.canThrottle(this._msgId); + Assert.ok(canThrottle, "can throttle"); + canThrottle = throttleMgr.canThrottle(msgId); + Assert.ok(canThrottle, "can throttle test1"); + + let isTriggeredPre = throttleMgr.isTriggered(this._msgId); + Assert.equal(isTriggeredPre, false, "is trigger"); + isTriggeredPre = throttleMgr.isTriggered(msgId); + Assert.equal(isTriggeredPre, false, "is trigger test1"); + + throttleMgr.onReadyState(true); + + let result = throttleMgr.sendMessage(this._msgId, msg); + let count = this.loggingSpy.callCount + Assert.equal(count,1, "sendMsg count"); + let expectedRlt = { + isThrottled: true, + throttleNum: 1 + } as IThrottleResult; + Assert.deepEqual(result, expectedRlt, "expected result"); + result = throttleMgr.sendMessage(msgId, msg); + count = this.loggingSpy.callCount + Assert.equal(count,2, "sendMsg count test1"); + Assert.deepEqual(result, expectedRlt, "expected result test1"); + + let isTriggeredPost = throttleMgr.isTriggered(this._msgId); + Assert.equal(isTriggeredPost, true, "trigger post"); + let canThrottlePost = throttleMgr.canThrottle(this._msgId); + Assert.equal(canThrottlePost, true, "can throttle post"); + isTriggeredPost = throttleMgr.isTriggered(msgId); + Assert.equal(isTriggeredPost, true, "trigger post test1"); + canThrottlePost = throttleMgr.canThrottle(msgId); + Assert.equal(canThrottlePost, true, "can throttle post test1"); + + let retryRlt = throttleMgr.sendMessage(this._msgId, msg); + let retryCount = this.loggingSpy.callCount + Assert.equal(retryCount,2, "retrt count"); + let expectedRetryRlt = { + isThrottled: false, + throttleNum: 0 + } as IThrottleResult + Assert.deepEqual(retryRlt, expectedRetryRlt, "retry result"); + + retryRlt = throttleMgr.sendMessage(msgId, msg); + retryCount = this.loggingSpy.callCount + Assert.equal(retryCount,2, "retrt count test1"); + expectedRetryRlt = { + isThrottled: false, + throttleNum: 0 + } as IThrottleResult + Assert.deepEqual(retryRlt, expectedRetryRlt, "retry result test1"); + } + }); + } +} + + +class ChannelPlugin implements IPlugin { + + public isFlushInvoked = false; + public isTearDownInvoked = false; + public isResumeInvoked = false; + public isPauseInvoked = false; + + public identifier = "Sender"; + + public priority: number = 1001; + + constructor() { + this.processTelemetry = this._processTelemetry.bind(this); + } + public pause(): void { + this.isPauseInvoked = true; + } + + public resume(): void { + this.isResumeInvoked = true; + } + + public teardown(): void { + this.isTearDownInvoked = true; + } + + flush(async?: boolean, callBack?: () => void): void { + this.isFlushInvoked = true; + if (callBack) { + callBack(); + } + } + + public processTelemetry(env: any) {} + + setNextPlugin(next: any) { + // no next setup + } + + public initialize = (config: IConfiguration, core: IAppInsightsCore, plugin: IPlugin[]) => { + } + + private _processTelemetry(env: any) { + } } \ No newline at end of file diff --git a/shared/AppInsightsCommon/src/Enums.ts b/shared/AppInsightsCommon/src/Enums.ts index 56da18d5e..d84fda2e1 100644 --- a/shared/AppInsightsCommon/src/Enums.ts +++ b/shared/AppInsightsCommon/src/Enums.ts @@ -47,19 +47,3 @@ export const DistributedTracingModes = createEnumStyle boolean; - public sendMessage: (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null; + public canThrottle: (msgId: _eInternalMessageId | number) => boolean; + public sendMessage: (msgId: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null; public getConfig: () => IThrottleMgrConfig; - public isTriggered: () => boolean; // this function is to get previous triggered status + public isTriggered: (msgId: _eInternalMessageId | number) => boolean; // this function is to get previous triggered status public isReady: () => boolean - public onReadyState: (isReady?: boolean) => boolean; - public flush: () => boolean; + public onReadyState: (isReady?: boolean, flushAll?: boolean) => boolean; + public flush: (msgId: _eInternalMessageId | number) => boolean; + public flushAll: () => boolean; public config: IThrottleMgrConfig; - constructor(config?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string, unloadHookContainer?: IUnloadHookContainer) { + constructor(core: IAppInsightsCore, namePrefix?: string) { let _self = this; let _canUseLocalStorage: boolean; let _logger: IDiagnosticLogger | null | undefined; let _config: IThrottleMgrConfig; - let _localStorageName: string | null; - let _localStorageObj: IThrottleLocalStorageObj | null | undefined; - let _isTriggered: boolean; //_isTriggered is to make sure that we only trigger throttle once a day + let _localStorageObj: {[msgKey: number]: IThrottleLocalStorageObj | null | undefined}; + let _isTriggered: {[msgKey: number]: boolean}; //_isTriggered is to make sure that we only trigger throttle once a day let _namePrefix: string; - let _queue: Array; + let _queue: {[msgKey: number]: Array}; let _isReady: boolean = false; let _isSpecificDaysGiven: boolean = false; @@ -55,8 +55,9 @@ export class ThrottleMgr { * because we only allow triggering sendMessage() once a day. * @returns if the current date is the valid date to send message */ - _self.canThrottle = (): boolean => { - return _canThrottle(_config, _canUseLocalStorage, _localStorageObj); + _self.canThrottle = (msgId: _eInternalMessageId | number ): boolean => { + let localObj = _getLocalStorageObjByKey(msgId); + return _canThrottle(_config, _canUseLocalStorage, localObj); } /** @@ -64,8 +65,8 @@ export class ThrottleMgr { * if canThrottle returns false, isTriggered will return false * @returns if throttle is triggered on current day(UTC) */ - _self.isTriggered = (): boolean => { - return _isTriggered; + _self.isTriggered = (msgId: _eInternalMessageId | number): boolean => { + return _isTrigger(msgId); } /** @@ -79,14 +80,15 @@ export class ThrottleMgr { } /** - * Flush all message in queue with isReady state set to true. + * Flush all message with given message key in queue with isReady state set to true. * @returns if message queue is flushed */ - _self.flush = (): boolean => { + _self.flush = (msgId: _eInternalMessageId | number): boolean => { try { - if (_isReady && _queue.length > 0) { - let items = _queue.slice(0); - _queue = []; + let queue = _getQueueByKey(msgId); + if (queue && queue.length > 0) { + let items = queue.slice(0); + _queue[msgId] = [] arrForEach(items, (item: SendMsgParameter) => { _flushMessage(item.msgID, item.message, item.severity, false); }); @@ -98,43 +100,71 @@ export class ThrottleMgr { return false; } + /** + * Flush all message in queue with isReady state set to true. + * @returns if message queue is flushed + */ + _self.flushAll = (): boolean => { + try { + if (_queue) { + let result = true; + objForEachKey(_queue, (key) => { + let isFlushed = _self.flush(parseInt(key)); + result = result && isFlushed; + }); + return result; + } + + } catch(err) { + // eslint-disable-next-line no-empty + } + return false; + } + /** * Set isReady State * if isReady set to true, message queue will be flushed automatically. * @param isReady isReady State + * @pa * @returns if message queue is flushed */ - _self.onReadyState = (isReady?: boolean): boolean => { + _self.onReadyState = (isReady?: boolean, flushAll: boolean = true): boolean => { _isReady = isNullOrUndefined(isReady)? true : isReady; - return _self.flush(); + if (_isReady && flushAll) { + return _self.flushAll(); + } + return null; } - _self.sendMessage = (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity): IThrottleResult | null => { + _self.sendMessage = (msgID: _eInternalMessageId | number, message: string, severity?: eLoggingSeverity): IThrottleResult | null => { return _flushMessage(msgID, message, severity, true); - + } - function _flushMessage(msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity, saveUnsentMsg?: boolean) { + function _flushMessage(msgID: _eInternalMessageId | number, message: string, severity?: eLoggingSeverity, saveUnsentMsg?: boolean) { if (_isReady) { let isSampledIn = _canSampledIn(); if (!isSampledIn) { return; } - let canThrottle = _canThrottle(_config, _canUseLocalStorage, _localStorageObj); + let localStorageObj = _getLocalStorageObjByKey(msgID); + let canThrottle = _canThrottle(_config, _canUseLocalStorage, localStorageObj); let throttled = false; let number = 0; + let isTriggered = _isTrigger(msgID); try { - if (canThrottle && !_isTriggered) { - number = Math.min(_config.limit.maxSendNumber, _localStorageObj.count + 1); - _localStorageObj.count = 0; + if (canThrottle && !isTriggered) { + number = Math.min(_config.limit.maxSendNumber, localStorageObj.count + 1); + localStorageObj.count = 0; throttled = true; - _isTriggered = true; - _localStorageObj.preTriggerDate = new Date(); + _isTriggered[msgID] = true; + localStorageObj.preTriggerDate = new Date(); } else { - _isTriggered = canThrottle; - _localStorageObj.count += 1; + _isTriggered[msgID] = canThrottle; + localStorageObj.count += 1; } - _resetLocalStorage(_logger, _localStorageName, _localStorageObj); + let localStorageName = _getLocalStorageName(msgID); + _resetLocalStorage(_logger, localStorageName, localStorageObj); for (let i = 0; i < number; i++) { _sendMessage(msgID, _logger, message, severity); } @@ -147,7 +177,8 @@ export class ThrottleMgr { } as IThrottleResult; } else { if (!!saveUnsentMsg) { - _queue.push({ + let queue = _getQueueByKey(msgID); + queue.push({ msgID: msgID, message: message, severity: severity @@ -159,21 +190,18 @@ export class ThrottleMgr { function _initConfig() { _logger = safeGetLogger(core); - _isTriggered = false; - _queue = []; + _isTriggered = {}; + _localStorageObj = {}; + _queue = {}; _namePrefix = isNotNullOrUndefined(namePrefix)? namePrefix : ""; - unloadHookContainer = unloadHookContainer || createUnloadHookContainer(); - // Make sure the root config is dynamic as it may be the global config - config = createDynamicConfig(config as any || {}, null, _logger).cfg; - let unloadHook = onConfigChange(config, () => { + core.addUnloadHook(onConfigChange(core.config, (details) => { + let coreConfig = details.cfg; _canUseLocalStorage = utlCanUseLocalStorage(); - let configMgr = config || {}; + let configMgr = coreConfig.throttleMgrCfg || {}; _config = {} as any; _config.disabled = !!configMgr.disabled; - - _config.msgKey = configMgr.msgKey || IThrottleMsgKey.default; let configInterval = configMgr.interval || {}; _isSpecificDaysGiven = configInterval?.daysOfMonth && configInterval?.daysOfMonth.length > 0; @@ -185,16 +213,8 @@ export class ThrottleMgr { maxSendNumber: configMgr.limit?.maxSendNumber || 1 }; _config.limit = limit; - _localStorageName = _getLocalStorageName(_config.msgKey, _namePrefix); - - if (_canUseLocalStorage && _localStorageName) { - _localStorageObj = _getLocalStorageObj(utlGetLocalStorage(_logger, _localStorageName), _logger, _localStorageName); - } - if (_localStorageObj) { - _isTriggered = _isTriggeredOnCurDate(_localStorageObj.preTriggerDate); - } - }); - unloadHookContainer && unloadHookContainer.add(unloadHook); + + })); } function _getIntervalConfig(interval: IThrottleInterval) { @@ -244,7 +264,7 @@ export class ThrottleMgr { return false; } - function _getLocalStorageName(msgKey: IThrottleMsgKey, prefix?: string) { + function _getLocalStorageName(msgKey: _eInternalMessageId | number, prefix?: string) { let fix = isNotNullOrUndefined(prefix)? prefix : ""; if (msgKey) { return THROTTLE_STORAGE_PREFIX + fix + "-" + msgKey; @@ -276,15 +296,15 @@ export class ThrottleMgr { } as IThrottleLocalStorageObj; if (value) { let obj = JSON.parse(value); - return { + let curObj = { date: _getThrottleDate(obj.date) || storageObj.date, count: obj.count || storageObj.count, preTriggerDate: obj.preTriggerDate? _getThrottleDate(obj.preTriggerDate) : undefined } as IThrottleLocalStorageObj; + return curObj; } else { _resetLocalStorage(logger, storageName, storageObj); return storageObj; - } } catch(e) { // eslint-disable-next-line no-empty @@ -341,5 +361,42 @@ export class ThrottleMgr { function _canSampledIn() { return randomValue(1000000) <= _config.limit.samplingRate; } + + function _getLocalStorageObjByKey(key: _eInternalMessageId | number) { + try { + let curObj = _localStorageObj[key]; + if (!curObj) { + let localStorageName = _getLocalStorageName(key, _namePrefix); + curObj = _getLocalStorageObj(utlGetLocalStorage(_logger, localStorageName), _logger, localStorageName); + _localStorageObj[key] = curObj; + } + return _localStorageObj[key]; + + } catch (e) { + // eslint-disable-next-line no-empty + } + return null; + } + + function _isTrigger(key: _eInternalMessageId | number) { + let isTrigger = _isTriggered[key]; + if (isNullOrUndefined(isTrigger)) { + isTrigger = false; + let localStorageObj = _getLocalStorageObjByKey(key); + if (localStorageObj) { + isTrigger = _isTriggeredOnCurDate(localStorageObj.preTriggerDate); + } + _isTriggered[key] = isTrigger; + } + return _isTriggered[key]; + } + + function _getQueueByKey(key: _eInternalMessageId | number) { + _queue = _queue || {}; + if (isNullOrUndefined(_queue[key])) { + _queue[key] = []; + } + return _queue[key]; + } } } diff --git a/shared/AppInsightsCommon/src/applicationinsights-common.ts b/shared/AppInsightsCommon/src/applicationinsights-common.ts index b3c86f1ad..9a9bbd65c 100644 --- a/shared/AppInsightsCommon/src/applicationinsights-common.ts +++ b/shared/AppInsightsCommon/src/applicationinsights-common.ts @@ -59,7 +59,7 @@ export { IPropertiesPlugin } from "./Interfaces/IPropertiesPlugin"; export { IUser, IUserContext } from "./Interfaces/Context/IUser"; export { ITelemetryTrace, ITraceState } from "./Interfaces/Context/ITelemetryTrace"; export { IRequestContext } from "./Interfaces/IRequestContext"; -export { eDistributedTracingModes, DistributedTracingModes, IThrottleMsgKey } from "./Enums"; +export { eDistributedTracingModes, DistributedTracingModes } from "./Enums"; export { stringToBoolOrDefault, msToTimeSpan, getExtensionByName, isCrossOriginError } from "./HelperFuncs"; export { isBeaconsSupported as isBeaconApiSupported, diff --git a/shared/AppInsightsCore/src/JavaScriptSDK.Enums/LoggingEnums.ts b/shared/AppInsightsCore/src/JavaScriptSDK.Enums/LoggingEnums.ts index d6c16eb82..383a6deb5 100644 --- a/shared/AppInsightsCore/src/JavaScriptSDK.Enums/LoggingEnums.ts +++ b/shared/AppInsightsCore/src/JavaScriptSDK.Enums/LoggingEnums.ts @@ -122,7 +122,8 @@ export const enum _eInternalMessageId { InMemoryStorageBufferFull = 105, InstrumentationKeyDeprecation = 106, ConfigWatcherException = 107, - DynamicConfigException = 108 + DynamicConfigException = 108, + DefaultThrottleMsgKey = 109 } export type _InternalMessageId = number | _eInternalMessageId;