From 80aa2134c2d1e0559d7196b057678401653ce839 Mon Sep 17 00:00:00 2001 From: Shunguo Date: Mon, 29 Jul 2024 11:24:50 -0500 Subject: [PATCH 1/3] new test cases and rule logic change #1911 --- .../v4/rules/element_scrollable_tabbable.ts | 4 +- .../textarea_pass.html | 46 +++++++++++++++++++ .../textarea_pass2.html | 40 ++++++++++++++++ 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass.html create mode 100644 accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass2.html diff --git a/accessibility-checker-engine/src/v4/rules/element_scrollable_tabbable.ts b/accessibility-checker-engine/src/v4/rules/element_scrollable_tabbable.ts index c97427d29..4f01a3aec 100644 --- a/accessibility-checker-engine/src/v4/rules/element_scrollable_tabbable.ts +++ b/accessibility-checker-engine/src/v4/rules/element_scrollable_tabbable.ts @@ -76,8 +76,8 @@ export let element_scrollable_tabbable: Rule = { && ruleContext.scrollHeight - ruleContext.clientHeight < 1+ padding_y) return null; - // pass iframe element has a tabindex attribute value that is not negative - if (ruleContext.hasAttribute("tabindex") && parseInt(ruleContext.getAttribute("tabindex")) >= 0) + // pass if element is tabbable + if (RPTUtil.isTabbable(ruleContext)) return RulePass("pass_tabbable"); // check if element content is tabbable diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass.html new file mode 100644 index 000000000..7c97d9292 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass.html @@ -0,0 +1,46 @@ + + + + + test case + + + + + + + + \ No newline at end of file diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass2.html new file mode 100644 index 000000000..a8937f074 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass2.html @@ -0,0 +1,40 @@ + + + + + test case + + + + + + + + \ No newline at end of file From afd44d1a14823d1828e346b106db14e74665d2c9 Mon Sep 17 00:00:00 2001 From: Shunguo Date: Tue, 30 Jul 2024 18:30:12 -0500 Subject: [PATCH 2/3] update the rule logic to use visible text only #1911 --- accessibility-checker-engine/karma.conf.js | 4 +- .../v2/checker/accessibility/util/legacy.ts | 34 +++++++++++ .../src/v2/dom/VisUtil.ts | 20 +++++++ .../src/v4/rules/label_name_visible.ts | 4 +- .../label_multiple_offscreen.html | 44 ++++++++++++++ .../label_offscreen.html | 59 +++++++++++++++++++ 6 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html create mode 100644 accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html diff --git a/accessibility-checker-engine/karma.conf.js b/accessibility-checker-engine/karma.conf.js index 3411dee9d..17905f4ef 100644 --- a/accessibility-checker-engine/karma.conf.js +++ b/accessibility-checker-engine/karma.conf.js @@ -44,7 +44,9 @@ // { pattern: 'test/v2/checker/accessibility/rules/WCAG20_Table_CapSummRedundant_ruleunit/*.html', watched: true }, // { pattern: 'test/v2/checker/accessibility/rules/Rpt_Aria_RequiredParent_Native_Host_Sematics_ruleunit/ACT_ff89c9_pass4.html', watched: true }, - // { pattern: 'test/v2/checker/accessibility/rules/IBMA_Color_Contrast_WCAG2AA_ruleunit/Color-hidden.html', watched: true }, + //{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html', watched: true }, + //{ pattern: 'test/v2/checker/accessibility/rules/aria_role_valid_ruleunit/td_attribute_invalid_copy.html', watched: true }, + //{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html', watched: true }, { pattern: 'test/**/*_ruleunit/*.html', watched: true }, diff --git a/accessibility-checker-engine/src/v2/checker/accessibility/util/legacy.ts b/accessibility-checker-engine/src/v2/checker/accessibility/util/legacy.ts index 9ce224f83..a56ec659c 100644 --- a/accessibility-checker-engine/src/v2/checker/accessibility/util/legacy.ts +++ b/accessibility-checker-engine/src/v2/checker/accessibility/util/legacy.ts @@ -637,6 +637,7 @@ export class RPTUtil { } public static normalizeSpacing(s) { + if (!s) return ''; return s.trim().replace(/\s+/g, ' '); }; @@ -2686,6 +2687,39 @@ export class RPTUtil { return retVal; } + /** + * return onscreen innerText. + * This function should return the same result as innerText if no offscreen content exists + * + * @parm {element} node The node which should be checked it has inner text or not. + * @return {null | string} null if element has empty inner text, text otherwise + * + * @memberOf RPTUtil + */ + public static getOnScreenInnerText(element) { + if (!element) return null; + if (element.nodeType === 3) return element.nodeValue(); + + let text = ""; + let nw = new NodeWalker(element); + + // Loop over all the childrens of the element to get the text + while (nw.nextNode() && nw.node !== element && nw.node !== element.parentNode) { + if ((nw.node.nodeType === 1 && (VisUtil.hiddenByDefaultElements.includes(nw.node.nodeName.toLowerCase())) || !VisUtil.isNodeVisible(nw.node) || VisUtil.isElementOffscreen(nw.node))) { + if (nw.node.nextSibling) { + if (nw.node.nextSibling.nodeType === 3 && nw.node.nextSibling.nodeValue !== null) + text += nw.node.nextSibling.nodeValue; + nw.node = nw.node.nextSibling; + continue; + } else + break; + } + if (nw.node.nodeType === 3 && nw.node.nodeValue !== null) + text += nw.node.nodeValue; + } + return text.trim(); + } + /** Return the text content of the given node * this is different than innerText or textContent that return text content of a node and its descendants */ diff --git a/accessibility-checker-engine/src/v2/dom/VisUtil.ts b/accessibility-checker-engine/src/v2/dom/VisUtil.ts index 9e97b006a..1d22ffcc4 100644 --- a/accessibility-checker-engine/src/v2/dom/VisUtil.ts +++ b/accessibility-checker-engine/src/v2/dom/VisUtil.ts @@ -14,6 +14,7 @@ import { getCache, setCache } from "../../v4/util/CacheUtil"; import { DOMUtil } from "./DOMUtil"; import { DOMWalker } from "./DOMWalker"; +import { DOMMapper } from "../../v2/dom/DOMMapper"; export class VisUtil { // This list contains a list of element tags which can not be hidden, when hidden is @@ -248,6 +249,25 @@ export class VisUtil { return true; } + /** + * return true if the node is offscreen by CSS position + * @param node + */ + public static isElementOffscreen(node: Node) : boolean { + if (!node) return false; + + const mapper : DOMMapper = new DOMMapper(); + const bounds = mapper.getUnadjustedBounds(node);; + + if (!bounds) + return false; + + if (bounds['height'] === 0 || bounds['width'] === 0 || bounds['top'] < 0 || bounds['left'] < 0) + return true; + + return false; + } + /** * return true if the node or its ancestor is natively hidden or aria-hidden = 'true' * @param node diff --git a/accessibility-checker-engine/src/v4/rules/label_name_visible.ts b/accessibility-checker-engine/src/v4/rules/label_name_visible.ts index dcbcd2490..275ef02df 100644 --- a/accessibility-checker-engine/src/v4/rules/label_name_visible.ts +++ b/accessibility-checker-engine/src/v4/rules/label_name_visible.ts @@ -139,8 +139,8 @@ export let label_name_visible: Rule = { if (!labelElem && elementsToSkipContentCheck.indexOf(nodeName) !== -1) { text = ""; // skip content check for some elements } else { - // get the visible text - text = RPTUtil.getInnerText(element); + // get the visible text only + text = RPTUtil.getOnScreenInnerText(element); } /* Note: Disable this alt check in images for now until we get confirmation diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html new file mode 100644 index 000000000..1331b14d5 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html @@ -0,0 +1,44 @@ + + + + + test case + + +
+ 1st label + 2nd label + 3rd label + 4th label + 5th label6th label + 7th label + 8th label +
+ +
another line
+ + + + \ No newline at end of file diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html new file mode 100644 index 000000000..b96435230 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html @@ -0,0 +1,59 @@ + + + + + test case + + + + + +
another line
+ + + + \ No newline at end of file From 807a61bbd90f49765ab34efa7f27596fb70184e4 Mon Sep 17 00:00:00 2001 From: Tom Brunet Date: Tue, 13 Aug 2024 10:58:54 -0500 Subject: [PATCH 3/3] Fix metric server --- .github/workflows/test.yml | 1 + rule-server/package-lock.json | 290 ++++++++++++++++++++++------------ rule-server/package.json | 3 +- rule-server/src/tsconfig.json | 3 +- 4 files changed, 191 insertions(+), 106 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7af5a6a4..579f607a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: working-directory: rule-server/dist - run: sleep 10 working-directory: rule-server/dist + - run: curl --insecure https://localhost:9445/tools/api/pub/meter/v2 - run: google-chrome --version - run: npm install diff --git a/rule-server/package-lock.json b/rule-server/package-lock.json index 2ebd8edcf..a2eaa89a8 100644 --- a/rule-server/package-lock.json +++ b/rule-server/package-lock.json @@ -16,7 +16,8 @@ "crypto-js": "^4.2.0", "express": "^4.19.2", "mkdirp": "^1.0.4", - "tsoa": "^3.14.1", + "multer": "^1.4.5-lts.1", + "tsoa": "4.1.3", "typescript": "^4.5.4" }, "devDependencies": { @@ -152,36 +153,36 @@ "dev": true }, "node_modules/@tsoa/cli": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/@tsoa/cli/-/cli-3.14.1.tgz", - "integrity": "sha512-Bhir7MGg86Og/S0w2ADJyKIaZiJ6cEzD7hYAJvr2Nc3mfFHVh1KvARtH7qOu7KFouX9l59rsFIRZS9SbO364aw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@tsoa/cli/-/cli-4.1.3.tgz", + "integrity": "sha512-tbuuAf9akIQHoqI0HgRV4GFtvzYxX+Hz5hMRdIDpmvFb9oH1vOekjlLlTNVnzV18amUWAz6lrMdaZWwzLu0JXg==", "dependencies": { - "@tsoa/runtime": "^3.13.0", + "@tsoa/runtime": "^4.1.3", "deepmerge": "^4.2.2", "fs-extra": "^8.1.0", "glob": "^7.1.6", "handlebars": "^4.7.7", "merge": "^2.1.0", "minimatch": "^3.0.4", - "typescript": "^4.1.2", + "typescript": "<4.8.0", "validator": "^13.6.0", "yamljs": "^0.3.0", - "yargs": "^14.0.0" + "yargs": "^15.4.1" }, "bin": { "tsoa": "dist/cli.js" }, "engines": { - "node": ">=6.0.0", + "node": ">=12.0.0", "yarn": ">=1.9.4" } }, "node_modules/@tsoa/cli/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/camelcase": { @@ -193,24 +194,25 @@ } }, "node_modules/@tsoa/cli/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, "node_modules/@tsoa/cli/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/get-caller-file": { @@ -222,11 +224,19 @@ } }, "node_modules/@tsoa/cli/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { - "node": ">=4" + "node": ">=8" + } + }, + "node_modules/@tsoa/cli/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/require-main-filename": { @@ -235,27 +245,39 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "node_modules/@tsoa/cli/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/@tsoa/cli/node_modules/typescript": { + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" } }, "node_modules/@tsoa/cli/node_modules/which-module": { @@ -264,16 +286,16 @@ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" }, "node_modules/@tsoa/cli/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/y18n": { @@ -282,42 +304,49 @@ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, "node_modules/@tsoa/cli/node_modules/yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dependencies": { - "cliui": "^5.0.0", + "cliui": "^6.0.0", "decamelize": "^1.2.0", - "find-up": "^3.0.0", + "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^3.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" } }, "node_modules/@tsoa/cli/node_modules/yargs-parser": { - "version": "15.0.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.3.tgz", - "integrity": "sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/@tsoa/runtime": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@tsoa/runtime/-/runtime-3.13.0.tgz", - "integrity": "sha512-rs8HmX0AjIuD4lz6FybDaK55HjmFum12drjeLpBm5sp2WHJXYgBEulV7G/S9bqtpOoUzn130W6EzDopFxpoKNg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@tsoa/runtime/-/runtime-4.1.3.tgz", + "integrity": "sha512-XvHgrzdbpLI3RfWJ2xq6sNk74Lln5OpkHxGyWdUkZfcExizr+bt/QpSEDOZC6XgfhIgzFZqWah+TZ51zX88OCg==", "dependencies": { "promise.any": "^2.0.2", + "reflect-metadata": "^0.1.13", "validator": "^13.6.0" }, "engines": { - "node": ">=6.0.0", + "node": ">=12.0.0", "yarn": ">=1.9.4" } }, @@ -435,14 +464,17 @@ } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/ansi-wrap": { @@ -488,6 +520,11 @@ "node": ">=0.10.0" } }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", @@ -1041,6 +1078,17 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -1329,17 +1377,20 @@ } }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/color-support": { "version": "1.1.3", @@ -1918,9 +1969,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -4559,23 +4610,14 @@ } }, "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/locate-path/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/lockfile": { @@ -5020,6 +5062,34 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/multer/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/multipipe": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", @@ -5478,14 +5548,14 @@ } }, "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dependencies": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/p-try": { @@ -5899,6 +5969,11 @@ "node": ">= 0.10" } }, + "node_modules/reflect-metadata": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==" + }, "node_modules/regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -6787,6 +6862,14 @@ "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", "dev": true }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -7140,18 +7223,18 @@ } }, "node_modules/tsoa": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsoa/-/tsoa-3.14.1.tgz", - "integrity": "sha512-fcGYucvQnjPEvKgxGdcsdJdsknS5JA9I/f/W30AN/yiyyMWWLvq2stM7c0gxEBAB5ICNa2dXx0sZtaQ1llwi8w==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tsoa/-/tsoa-4.1.3.tgz", + "integrity": "sha512-jSvH+b3hNUx3lBzscyAu1nlE/PO4cYdgDMmPTF5/3mQVRdyblE/zinRQ5lipyCNYFD07KTiRQJCFKfdtklrs8w==", "dependencies": { - "@tsoa/cli": "^3.14.1", - "@tsoa/runtime": "^3.13.0" + "@tsoa/cli": "^4.1.3", + "@tsoa/runtime": "^4.1.3" }, "bin": { "tsoa": "dist/cli.js" }, "engines": { - "node": ">=6.0.0", + "node": ">=12.0.0", "yarn": ">=1.9.4" } }, @@ -7276,9 +7359,9 @@ } }, "node_modules/uglify-js": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.1.tgz", - "integrity": "sha512-y/2wiW+ceTYR2TSSptAhfnEtpLaQ4Ups5zrjB2d3kuVxHj16j/QJwPl5PvuGy9uARb39J0+iKxcRPvtpsx4A4A==", + "version": "3.19.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.2.tgz", + "integrity": "sha512-S8KA6DDI47nQXJSi2ctQ629YzwOVs+bQML6DAtvy0wgNdpi+0ySpQK0g2pxBq2xfF2z3YCscu7NNA8nXT9PlIQ==", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -7734,7 +7817,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, "engines": { "node": ">=0.4" } diff --git a/rule-server/package.json b/rule-server/package.json index 7f36b42fd..49ded89da 100644 --- a/rule-server/package.json +++ b/rule-server/package.json @@ -21,7 +21,8 @@ "crypto-js": "^4.2.0", "express": "^4.19.2", "mkdirp": "^1.0.4", - "tsoa": "^3.14.1", + "multer": "^1.4.5-lts.1", + "tsoa": "4.1.3", "typescript": "^4.5.4" }, "devDependencies": { diff --git a/rule-server/src/tsconfig.json b/rule-server/src/tsconfig.json index 2828a9091..141f41658 100644 --- a/rule-server/src/tsconfig.json +++ b/rule-server/src/tsconfig.json @@ -4,7 +4,8 @@ "outDir": "../dist", "baseUrl": "", "module": "commonjs", - "allowJs": true + "allowJs": true, + "target": "ES6" }, "include": ["./**/*"], "exclude": ["./static"]