diff --git a/server/package-lock.json b/server/package-lock.json index 5734199..dcaf75a 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -116,7 +116,7 @@ "jest": "^29.3.1", "jest-junit": "^16.0.0", "jest-light-runner": "^0.4.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.2", "jsonpath-plus": "^10.4.0", "knip": "^6.16.1", "supertest": "^6.2.2", @@ -2311,6 +2311,29 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -17776,9 +17799,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.2.tgz", + "integrity": "sha512-dayzUzKkJ1MkuUtZglSebU43utNXH0OWQByK9rKOOuYIO8M5TV1y+n8ALMdG0rdzBnfNkOmZEqrURepb0ejqBw==", "dev": true, "funding": [ { @@ -17795,7 +17818,7 @@ "argparse": "^2.0.1" }, "bin": { - "js-yaml": "bin/js-yaml.js" + "js-yaml": "bin/js-yaml.mjs" } }, "node_modules/jsdoc-type-pratt-parser": { diff --git a/server/package.json b/server/package.json index 4db8f40..877428c 100644 --- a/server/package.json +++ b/server/package.json @@ -135,7 +135,7 @@ "jest": "^29.3.1", "jest-junit": "^16.0.0", "jest-light-runner": "^0.4.1", - "js-yaml": "^4.2.0", + "js-yaml": "^5.2.2", "jsonpath-plus": "^10.4.0", "knip": "^6.16.1", "supertest": "^6.2.2", diff --git a/server/services/ruleAnomalyDetectionService/getRuleAlarmStatus.test.ts b/server/services/ruleAnomalyDetectionService/getRuleAlarmStatus.test.ts index c068a33..0232efa 100644 --- a/server/services/ruleAnomalyDetectionService/getRuleAlarmStatus.test.ts +++ b/server/services/ruleAnomalyDetectionService/getRuleAlarmStatus.test.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'fs'; import { dirname, join } from 'path'; import fc from 'fast-check'; -import yaml from 'js-yaml'; +import { load } from 'js-yaml'; import _ from 'lodash'; import { RuleAlarmStatus } from '../moderationConfigService/index.js'; @@ -17,7 +17,7 @@ const samplesPassRate = (samples: { passes: number; runs: number }[]) => sum(samples.map((it) => it.passes)) / sum(samples.map((it) => it.runs)); const __dirname = dirname(new URL(import.meta.url).pathname); -const tableDump = yaml.load( +const tableDump = load( // eslint-disable-next-line security/detect-non-literal-fs-filename readFileSync( join(__dirname, '../../test/stubs/rule_pass_sample_data.yaml'), diff --git a/server/test/stubs/getRuleAnomalyDetectionStatistics.ts b/server/test/stubs/getRuleAnomalyDetectionStatistics.ts index 1ebc36e..f756e75 100644 --- a/server/test/stubs/getRuleAnomalyDetectionStatistics.ts +++ b/server/test/stubs/getRuleAnomalyDetectionStatistics.ts @@ -1,11 +1,11 @@ import { readFileSync } from 'fs'; import { dirname, join } from 'path'; -import yaml from 'js-yaml'; +import { load } from 'js-yaml'; import { type GetRuleAnomalyDetectionStatistics } from '../../services/ruleAnomalyDetectionService/index.js'; const __dirname = dirname(new URL(import.meta.url).pathname); -const tableDump = yaml.load( +const tableDump = load( // eslint-disable-next-line security/detect-non-literal-fs-filename readFileSync(join(__dirname, './rule_pass_sample_data.yaml'), 'utf-8'), ) as {