diff --git a/package-lock.json b/package-lock.json index 01f16932ef..9705b713b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@cfworker/json-schema": "^1.12.8", "@datadog/browser-logs": "^5.21.0", "@datadog/browser-rum": "^5.21.0", - "@floating-ui/dom": "^1.6.5", + "@floating-ui/dom": "^1.6.7", "@fortawesome/fontawesome-svg-core": "1.2.36", "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-regular-svg-icons": "^5.15.4", @@ -23,14 +23,14 @@ "@mozilla/readability": "^0.5.0", "@pixiebrix/jq-web": "^0.5.1", "@reduxjs/toolkit": "^1.9.7", - "@rjsf/bootstrap-4": "^5.18.4", - "@rjsf/core": "^5.18.4", - "@rjsf/utils": "^5.18.4", + "@rjsf/bootstrap-4": "^5.19.1", + "@rjsf/core": "^5.19.1", + "@rjsf/utils": "^5.19.1", "@uipath/robot": "1.3.1", "@vespaiach/axios-fetch-adapter": "^0.3.1", "@xobotyi/scrollbar-width": "^1.9.5", "abort-utils": "^1.2.0", - "ace-builds": "^1.35.0", + "ace-builds": "^1.35.2", "autocompleter": "^9.2.1", "axios": "^0.28.1", "axios-auth-refresh": "^3.3.6", @@ -47,7 +47,7 @@ "csharp-helpers": "^0.9.3", "css-selector-generator": "^3.6.8", "date-fns": "^3.6.0", - "dompurify": "^3.1.5", + "dompurify": "^3.1.6", "downloadjs": "^1.4.7", "exifreader": "^4.23.3", "export-to-csv": "^1.3.0", @@ -65,7 +65,7 @@ "htmlparser2": "^9.1.0", "http-status-codes": "^2.3.0", "idb": "^8.0.0", - "iframe-resizer": "^4.4.2", + "iframe-resizer": "^4.4.4", "immer": "^9.0.18", "intrinsic-scale": "^4.0.0", "intro.js": "^7.2.0", @@ -81,7 +81,7 @@ "kbar": "^0.1.0-beta.45", "lodash-es": "^4.17.21", "mark.js": "^8.11.1", - "marked": "^13.0.0", + "marked": "^13.0.2", "memoize-one": "^6.0.0", "mustache": "^4.2.0", "nunjucks": "^3.2.4", @@ -132,7 +132,7 @@ "slugify": "^1.6.6", "stemmer": "^2.0.1", "timezone-mock": "^1.3.6", - "uint8array-extras": "^1.1.0", + "uint8array-extras": "^1.3.0", "urlpattern-polyfill": "^5.0.3", "use-async-effect": "^2.2.7", "use-debounce": "^10.0.1", @@ -140,14 +140,14 @@ "uuid": "^10.0.0", "webext-content-scripts": "^2.7.0", "webext-detect": "^5.0.2", - "webext-events": "^3.0.0", - "webext-inject-on-install": "^2.2.0", + "webext-events": "^3.0.1", + "webext-inject-on-install": "^2.2.1", "webext-messenger": "^0.28.0", "webext-patterns": "^1.4.0", "webext-permissions": "^3.1.3", "webext-polyfill-kinda": "^1.0.2", "webext-storage": "^1.2.2", - "webext-storage-cache": "^6.0.1", + "webext-storage-cache": "^6.0.3", "webext-tools": "^2.0.1", "webextension-polyfill": "^0.12.0", "whatwg-mimetype": "^4.0.0", @@ -168,7 +168,7 @@ "@storybook/react": "^7.6.17", "@storybook/react-webpack5": "^7.6.17", "@svgr/webpack": "^8.1.0", - "@swc/core": "^1.6.5", + "@swc/core": "^1.6.13", "@swc/jest": "^0.2.36", "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^12.1.5", @@ -181,7 +181,7 @@ "@types/dompurify": "^3.0.5", "@types/downloadjs": "^1.4.6", "@types/gapi.client": "^1.0.8", - "@types/gapi.client.drive-v3": "^0.0.4", + "@types/gapi.client.drive-v3": "^0.0.5", "@types/gapi.client.oauth2-v2": "^0.0.4", "@types/gapi.client.sheets-v4": "^0.0.4", "@types/holderjs": "^2.9.4", @@ -195,10 +195,10 @@ "@types/jsdom": "^21.1.7", "@types/json-schema": "^7.0.15", "@types/json-stringify-safe": "^5.0.3", - "@types/lodash": "^4.17.5", + "@types/lodash": "^4.17.6", "@types/mark.js": "^8.11.12", "@types/mustache": "^4.2.5", - "@types/node": "^20.14.8", + "@types/node": "^20.14.10", "@types/nunjucks": "^3.2.6", "@types/object-hash": "^2.1.1", "@types/papaparse": "^5.3.14", @@ -222,7 +222,7 @@ "@types/webpack": "^5.28.5", "@types/webpack-env": "^1.18.5", "@types/whatwg-mimetype": "^3.0.2", - "@typescript-eslint/rule-tester": "^7.13.1", + "@typescript-eslint/rule-tester": "^7.15.0", "axios-mock-adapter": "^1.22.0", "blob-polyfill": "^7.0.20220408", "compass-mixins": "^0.12.10", @@ -266,7 +266,7 @@ "terser-webpack-plugin": "^5.3.10", "ts-loader": "^9.5.1", "type-fest": "^4.20.1", - "typescript": "^5.5.2", + "typescript": "^5.5.3", "typescript-plugin-css-modules": "^5.1.0", "webpack": "^5.91.0", "webpack-build-notifier": "^3.1.0", @@ -3155,12 +3155,12 @@ } }, "node_modules/@floating-ui/dom": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.5.tgz", - "integrity": "sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.7.tgz", + "integrity": "sha512-wmVfPG5o2xnKDU4jx/m4w5qva9FWHcnZ8BvzEe90D/RpwsJaTAVYPEPdQ8sbr/N8zZTAHlZUTQdqg8ZUbzHmng==", "dependencies": { - "@floating-ui/core": "^1.0.0", - "@floating-ui/utils": "^0.2.0" + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.4" } }, "node_modules/@floating-ui/react-dom": { @@ -3177,9 +3177,9 @@ } }, "node_modules/@floating-ui/utils": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", - "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.4.tgz", + "integrity": "sha512-dWO2pw8hhi+WrXq1YJy2yCuWoL20PddgGaqTgVe4cOS9Q6qklXCiA1tJEqX6BEwRNSCP84/afac9hd4MS+zEUA==" }, "node_modules/@fortawesome/fontawesome-common-types": { "version": "0.2.36", @@ -5378,9 +5378,9 @@ } }, "node_modules/@rjsf/bootstrap-4": { - "version": "5.18.4", - "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.18.4.tgz", - "integrity": "sha512-bgCxJ+4eBsga3tNRZCMC02Zu72V+yYiM2irPr6FrGbUX8LIH+e2eFSJj7vLEFNzHnRe9CVgMpYo+aeUGhGfkFQ==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.19.1.tgz", + "integrity": "sha512-G8i0WcJK5F4EmClzmViieJDQLG4fUpKF5YjuXLsehOd5m0tKpe67+wB91o7D+DkZaW1F1IHI7XKNwKsrnLk3eg==", "dependencies": { "@react-icons/all-files": "^4.1.0" }, @@ -5388,16 +5388,16 @@ "node": ">=14" }, "peerDependencies": { - "@rjsf/core": "^5.18.x", - "@rjsf/utils": "^5.18.x", + "@rjsf/core": "^5.19.x", + "@rjsf/utils": "^5.19.x", "react": "^16.14.0 || >=17", "react-bootstrap": "^1.6.5" } }, "node_modules/@rjsf/core": { - "version": "5.18.4", - "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.18.4.tgz", - "integrity": "sha512-OUPC+l44X1geYT9sSsmQC2pakvFWCQB+5Iy/ITfLMJq3MIjJn0gakCwYHXMMBGUAKM1SSMIyKWyCazt3kY9fhg==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.19.1.tgz", + "integrity": "sha512-kuaavQWB3+7nNCHE3XiHb6ulGyX2OE+6ZabnVn1Ek850E5A9ZSdzMe3JXfqsH91W1gQxl95PCUHHl0iG9hvvEw==", "dependencies": { "lodash": "^4.17.21", "lodash-es": "^4.17.21", @@ -5409,14 +5409,14 @@ "node": ">=14" }, "peerDependencies": { - "@rjsf/utils": "^5.18.x", + "@rjsf/utils": "^5.19.x", "react": "^16.14.0 || >=17" } }, "node_modules/@rjsf/utils": { - "version": "5.18.4", - "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.18.4.tgz", - "integrity": "sha512-svLMk5aW6q3JQRYVTJradFc9tLeQ1vX5/k6fPwxf+08eweqPbINq7aokLBSStUNr8FfYgThTl8IfehLoVP2dvw==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.19.1.tgz", + "integrity": "sha512-vA4Rq6kiLbohxyB7AC6rcfnb1y/BvGGRNVFDA8S/E7a+OT52gEY+EA6iiYUHXPVMnFOdQtuN4QBilF575cc8vQ==", "dependencies": { "json-schema-merge-allof": "^0.8.1", "jsonpointer": "^5.0.1", @@ -7554,9 +7554,9 @@ } }, "node_modules/@swc/core": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.5.tgz", - "integrity": "sha512-tyVvUK/HDOUUsK6/GmWvnqUtD9oDpPUA4f7f7JCOV8hXxtfjMtAZeBKf93yrB1XZet69TDR7EN0hFC6i4MF0Ig==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.6.13.tgz", + "integrity": "sha512-eailUYex6fkfaQTev4Oa3mwn0/e3mQU4H8y1WPuImYQESOQDtVrowwUGDSc19evpBbHpKtwM+hw8nLlhIsF+Tw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -7571,16 +7571,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.6.5", - "@swc/core-darwin-x64": "1.6.5", - "@swc/core-linux-arm-gnueabihf": "1.6.5", - "@swc/core-linux-arm64-gnu": "1.6.5", - "@swc/core-linux-arm64-musl": "1.6.5", - "@swc/core-linux-x64-gnu": "1.6.5", - "@swc/core-linux-x64-musl": "1.6.5", - "@swc/core-win32-arm64-msvc": "1.6.5", - "@swc/core-win32-ia32-msvc": "1.6.5", - "@swc/core-win32-x64-msvc": "1.6.5" + "@swc/core-darwin-arm64": "1.6.13", + "@swc/core-darwin-x64": "1.6.13", + "@swc/core-linux-arm-gnueabihf": "1.6.13", + "@swc/core-linux-arm64-gnu": "1.6.13", + "@swc/core-linux-arm64-musl": "1.6.13", + "@swc/core-linux-x64-gnu": "1.6.13", + "@swc/core-linux-x64-musl": "1.6.13", + "@swc/core-win32-arm64-msvc": "1.6.13", + "@swc/core-win32-ia32-msvc": "1.6.13", + "@swc/core-win32-x64-msvc": "1.6.13" }, "peerDependencies": { "@swc/helpers": "*" @@ -7592,9 +7592,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.5.tgz", - "integrity": "sha512-RGQhMdni2v1/ANQ/2K+F+QYdzaucekYBewZcX1ogqJ8G5sbPaBdYdDN1qQ4kHLCIkPtGP6qC7c71qPEqL2RidQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.6.13.tgz", + "integrity": "sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==", "cpu": [ "arm64" ], @@ -7608,9 +7608,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.5.tgz", - "integrity": "sha512-/pSN0/Jtcbbb9+ovS9rKxR3qertpFAM3OEJr/+Dh/8yy7jK5G5EFPIrfsw/7Q5987ERPIJIH6BspK2CBB2tgcg==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.6.13.tgz", + "integrity": "sha512-AW8akFSC+tmPE6YQQvK9S2A1B8pjnXEINg+gGgw0KRUUXunvu1/OEOeC5L2Co1wAwhD7bhnaefi06Qi9AiwOag==", "cpu": [ "x64" ], @@ -7624,9 +7624,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.5.tgz", - "integrity": "sha512-B0g/dROCE747RRegs/jPHuKJgwXLracDhnqQa80kFdgWEMjlcb7OMCgs5OX86yJGRS4qcYbiMGD0Pp7Kbqn3yw==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.6.13.tgz", + "integrity": "sha512-f4gxxvDXVUm2HLYXRd311mSrmbpQF2MZ4Ja6XCQz1hWAxXdhRl1gpnZ+LH/xIfGSwQChrtLLVrkxdYUCVuIjFg==", "cpu": [ "arm" ], @@ -7640,9 +7640,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.5.tgz", - "integrity": "sha512-W8meapgXTq8AOtSvDG4yKR8ant2WWD++yOjgzAleB5VAC+oC+aa8YJROGxj8HepurU8kurqzcialwoMeq5SZZQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.6.13.tgz", + "integrity": "sha512-Nf/eoW2CbG8s+9JoLtjl9FByBXyQ5cjdBsA4efO7Zw4p+YSuXDgc8HRPC+E2+ns0praDpKNZtLvDtmF2lL+2Gg==", "cpu": [ "arm64" ], @@ -7656,9 +7656,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.5.tgz", - "integrity": "sha512-jyCKqoX50Fg8rJUQqh4u5PqnE7nqYKXHjVH2WcYr114/MU21zlsI+YL6aOQU1XP8bJQ2gPQ1rnlnGJdEHiKS/w==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.6.13.tgz", + "integrity": "sha512-2OysYSYtdw79prJYuKIiux/Gj0iaGEbpS2QZWCIY4X9sGoETJ5iMg+lY+YCrIxdkkNYd7OhIbXdYFyGs/w5LDg==", "cpu": [ "arm64" ], @@ -7672,9 +7672,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.5.tgz", - "integrity": "sha512-G6HmUn/RRIlXC0YYFfBz2qh6OZkHS/KUPkhoG4X9ADcgWXXjOFh6JrefwsYj8VBAJEnr5iewzjNfj+nztwHaeA==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.6.13.tgz", + "integrity": "sha512-PkR4CZYJNk5hcd2+tMWBpnisnmYsUzazI1O5X7VkIGFcGePTqJ/bWlfUIVVExWxvAI33PQFzLbzmN5scyIUyGQ==", "cpu": [ "x64" ], @@ -7688,9 +7688,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.5.tgz", - "integrity": "sha512-AQpBjBnelQDSbeTJA50AXdS6+CP66LsXIMNTwhPSgUfE7Bx1ggZV11Fsi4Q5SGcs6a8Qw1cuYKN57ZfZC5QOuA==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.6.13.tgz", + "integrity": "sha512-OdsY7wryTxCKwGQcwW9jwWg3cxaHBkTTHi91+5nm7hFPpmZMz1HivJrWAMwVE7iXFw+M4l6ugB/wCvpYrUAAjA==", "cpu": [ "x64" ], @@ -7704,9 +7704,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.5.tgz", - "integrity": "sha512-MZTWM8kUwS30pVrtbzSGEXtek46aXNb/mT9D6rsS7NvOuv2w+qZhjR1rzf4LNbbn5f8VnR4Nac1WIOYZmfC5ng==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.6.13.tgz", + "integrity": "sha512-ap6uNmYjwk9M/+bFEuWRNl3hq4VqgQ/Lk+ID/F5WGqczNr0L7vEf+pOsRAn0F6EV+o/nyb3ePt8rLhE/wjHpPg==", "cpu": [ "arm64" ], @@ -7720,9 +7720,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.5.tgz", - "integrity": "sha512-WZdu4gISAr3yOm1fVwKhhk6+MrP7kVX0KMP7+ZQFTN5zXQEiDSDunEJKVgjMVj3vlR+6mnAqa/L0V9Qa8+zKlQ==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.6.13.tgz", + "integrity": "sha512-IJ8KH4yIUHTnS/U1jwQmtbfQals7zWPG0a9hbEfIr4zI0yKzjd83lmtS09lm2Q24QBWOCFGEEbuZxR4tIlvfzA==", "cpu": [ "ia32" ], @@ -7736,9 +7736,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.5.tgz", - "integrity": "sha512-ezXgucnMTzlFIxQZw7ls/5r2hseFaRoDL04cuXUOs97E8r+nJSmFsRQm/ygH5jBeXNo59nyZCalrjJAjwfgACA==", + "version": "1.6.13", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.6.13.tgz", + "integrity": "sha512-f6/sx6LMuEnbuxtiSL/EkR0Y6qUHFw1XVrh6rwzKXptTipUdOY+nXpKoh+1UsBm/r7H0/5DtOdrn3q5ZHbFZjQ==", "cpu": [ "x64" ], @@ -8302,9 +8302,9 @@ } }, "node_modules/@types/gapi.client.drive-v3": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@types/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.4.tgz", - "integrity": "sha512-jE37dJ0EzAdY0aJPFOp20xmec/aO0P4HtUIA9k07RMPyedFDOcuMlSac1r0PklwQdgXF7BHaMoObNHNAnwSQUQ==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@types/gapi.client.drive-v3/-/gapi.client.drive-v3-0.0.5.tgz", + "integrity": "sha512-yYBxiqMqJVBg4bns4Q28+f2XdJnd3tVA9dxQX1lXMVmzT2B+pZdyCi1u9HLwGveVlookSsAXuqfLfS9KO6MF6w==", "dev": true, "dependencies": { "@maxim_mazurok/gapi.client.drive-v3": "latest" @@ -8554,9 +8554,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==" + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", + "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==" }, "node_modules/@types/lodash.clonedeep": { "version": "4.5.7", @@ -8611,9 +8611,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", - "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -9171,13 +9171,13 @@ } }, "node_modules/@typescript-eslint/rule-tester": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-7.13.1.tgz", - "integrity": "sha512-rM55VW1cWHLKys8cKKa2RjRUasB5k3hniuwixZXX28oayk9QCiAhbKTJjkbYAkXjOOyfEN+ReVFTvvTNWGOvDA==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-7.15.0.tgz", + "integrity": "sha512-QyBNG3gTpUJKb+Kx0hMbfZk9K7a3VnWEcWygZyKbw6ihTt/pf7c7AaR7JNbdnrFYc0q3JOgCXdKq8JM4RsAeaA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.13.1", - "@typescript-eslint/utils": "7.13.1", + "@typescript-eslint/typescript-estree": "7.15.0", + "@typescript-eslint/utils": "7.15.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -9196,13 +9196,13 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/@typescript-eslint/scope-manager": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.1.tgz", - "integrity": "sha512-adbXNVEs6GmbzaCpymHQ0MB6E4TqoiVbC0iqG3uijR8ZYfpAXMGttouQzF4Oat3P2GxDVIrg7bMI/P65LiQZdg==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.15.0.tgz", + "integrity": "sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.13.1", - "@typescript-eslint/visitor-keys": "7.13.1" + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -9213,9 +9213,9 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/@typescript-eslint/types": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz", - "integrity": "sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.15.0.tgz", + "integrity": "sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -9226,13 +9226,13 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.1.tgz", - "integrity": "sha512-uxNr51CMV7npU1BxZzYjoVz9iyjckBduFBP0S5sLlh1tXYzHzgZ3BR9SVsNed+LmwKrmnqN3Kdl5t7eZ5TS1Yw==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.15.0.tgz", + "integrity": "sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.13.1", - "@typescript-eslint/visitor-keys": "7.13.1", + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -9254,15 +9254,15 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/@typescript-eslint/utils": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.1.tgz", - "integrity": "sha512-h5MzFBD5a/Gh/fvNdp9pTfqJAbuQC4sCN2WzuXme71lqFJsZtLbjxfSk4r3p02WIArOF9N94pdsLiGutpDbrXQ==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.15.0.tgz", + "integrity": "sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.13.1", - "@typescript-eslint/types": "7.13.1", - "@typescript-eslint/typescript-estree": "7.13.1" + "@typescript-eslint/scope-manager": "7.15.0", + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/typescript-estree": "7.15.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -9276,12 +9276,12 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.1.tgz", - "integrity": "sha512-k/Bfne7lrP7hcb7m9zSsgcBmo+8eicqqfNAJ7uUY+jkTFpKeH2FSkWpFRtimBxgkyvqfu9jTPRbYOvud6isdXA==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.15.0.tgz", + "integrity": "sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.13.1", + "@typescript-eslint/types": "7.15.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -9302,9 +9302,9 @@ } }, "node_modules/@typescript-eslint/rule-tester/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -9822,9 +9822,9 @@ } }, "node_modules/ace-builds": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.35.0.tgz", - "integrity": "sha512-bwDKqjqNccC/MSujqnYTeAS5dIR8UmGLP0R90mvsJY0FRC8NUWBSTfj34+EIzo2NWc/gV8IZTqv4fXaiZJpCtA==" + "version": "1.35.2", + "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.35.2.tgz", + "integrity": "sha512-06d00u4jDZx+ieI0jLlgy/uefx8kcgz7lhI0mCIFEu8NVWirH00U5IEP7tePHy4sjPsRcJUH4VbJZacoit2Hng==" }, "node_modules/acorn": { "version": "8.11.3", @@ -13656,9 +13656,9 @@ } }, "node_modules/dompurify": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", - "integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==" + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz", + "integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==" }, "node_modules/domutils": { "version": "2.8.0", @@ -17815,9 +17815,9 @@ ] }, "node_modules/iframe-resizer": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.4.2.tgz", - "integrity": "sha512-2SupFCq9V9osWac4q+PodF0E9QdWY5A9VdCpKrrE7HlDrcIsaTp7D6k14mkGXWoWMS9jCavYusik25wTc0YB2Q==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.4.4.tgz", + "integrity": "sha512-9E4+pTpOPEeSz3P/o04uy5hpG+z/fy+BDzQnM3PT/G1zINRqgVJNdHgO8bJ8s8szLFztjKugnjtvZdvBJ5UXWQ==", "hasInstallScript": true, "engines": { "node": ">=0.8.0" @@ -22094,9 +22094,9 @@ } }, "node_modules/marked": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.0.tgz", - "integrity": "sha512-VTeDCd9txf4KLLljUZ0nljE/Incb9SrWuueE44QVuU0pkOdh4sfCeW1Z6lPcxyDRSVY6rm8db/0OPaN75RNUmw==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.2.tgz", + "integrity": "sha512-J6CPjP8pS5sgrRqxVRvkCIkZ6MFdRIjDkwUwgJ9nL2fbmM6qGQeB2C16hi8Cc9BOzj6xXzy0jyi0iPIfnMHYzA==", "bin": { "marked": "bin/marked.js" }, @@ -28394,9 +28394,9 @@ "dev": true }, "node_modules/typescript": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", - "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -28474,9 +28474,9 @@ } }, "node_modules/uint8array-extras": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.1.0.tgz", - "integrity": "sha512-CVaBSyOmGoFHu+zOVPbetXEXykOd8KHVBHLlqvmaMWpwcq3rewj18xVNbU5uzf48hclnNQhfNaNany2cMHFK/g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.3.0.tgz", + "integrity": "sha512-npBAT0ZIX6mAIG7SF6G4LF1BIoRx3h+HVajSplHx0XmOD0Ug4qio5Yhcajn72i5OEj/qkk1OFaYh2PhqHBV33w==", "engines": { "node": ">=18" }, @@ -29131,11 +29131,11 @@ } }, "node_modules/webext-events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/webext-events/-/webext-events-3.0.0.tgz", - "integrity": "sha512-RlqJXJV0zxn3rhuCv4l8fFddLvOCIyQACu+hVTSvL/AiC+bGvU7aaXZiTJ+WCqPcWFH8iu6SPPVJgvnCCtSlhg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webext-events/-/webext-events-3.0.1.tgz", + "integrity": "sha512-GbIR9VuO0RWFLTJmvJSOCfdkM83olWg6e0vEr4QglcyBuHedZlBitIrzSfLUSV5hHoh6sr6ah9Osl5xoHFQNiA==", "dependencies": { - "webext-detect-page": "^5.0.1" + "webext-detect": "^5.0.2" }, "engines": { "node": ">=18" @@ -29145,13 +29145,13 @@ } }, "node_modules/webext-inject-on-install": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/webext-inject-on-install/-/webext-inject-on-install-2.2.0.tgz", - "integrity": "sha512-VgEkr/iv1Bb5TcFeSjKXHeH3vEuatxSZl2uK6asProQLT+qWuaMdl0lOllHhF07foptjMt0GVfRXifg54Z6kIw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/webext-inject-on-install/-/webext-inject-on-install-2.2.1.tgz", + "integrity": "sha512-GkdTjGtIV/ULkSZm+v6hab32oPMPf8BbGhPihO5FkvFOKrHv+NYqyihERmArydWvOJnF/G0RoDX/JgDGZG2cdA==", "dependencies": { - "webext-content-scripts": "^2.6.1", - "webext-detect-page": "^5.0.1", - "webext-events": "^3.0.0", + "webext-content-scripts": "^2.7.0", + "webext-detect": "^5.0.2", + "webext-events": "^3.0.1", "webext-polyfill-kinda": "^1.0.2" }, "engines": { @@ -29223,13 +29223,13 @@ } }, "node_modules/webext-storage-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/webext-storage-cache/-/webext-storage-cache-6.0.1.tgz", - "integrity": "sha512-R6Ht7w5oXHhVREW3iBugC/e7/aT2Mj/jv4XWZ4T6eHU/xDxOAQWnJ/uuXvs4EhbMJUqHSQm0uEpu25SeYnMSQw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/webext-storage-cache/-/webext-storage-cache-6.0.3.tgz", + "integrity": "sha512-oMi81QhsJno/rCIcX4N8zQ1DoWX1fv/GAillvZX6WoCvXGBAqFH7A+owCmYx5wVdi9g9kdTX5GbY6w7w+UfMlA==", "dependencies": { "@sindresorhus/to-milliseconds": "^2.0.0", - "type-fest": "^4.20.0", - "webext-detect-page": "^5.0.1", + "type-fest": "^4.20.1", + "webext-detect": "^5.0.2", "webext-polyfill-kinda": "^1.0.2" }, "engines": { diff --git a/package.json b/package.json index c49b332ead..ea6f331c36 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@cfworker/json-schema": "^1.12.8", "@datadog/browser-logs": "^5.21.0", "@datadog/browser-rum": "^5.21.0", - "@floating-ui/dom": "^1.6.5", + "@floating-ui/dom": "^1.6.7", "@fortawesome/fontawesome-svg-core": "1.2.36", "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-regular-svg-icons": "^5.15.4", @@ -49,14 +49,14 @@ "@mozilla/readability": "^0.5.0", "@pixiebrix/jq-web": "^0.5.1", "@reduxjs/toolkit": "^1.9.7", - "@rjsf/bootstrap-4": "^5.18.4", - "@rjsf/core": "^5.18.4", - "@rjsf/utils": "^5.18.4", + "@rjsf/bootstrap-4": "^5.19.1", + "@rjsf/core": "^5.19.1", + "@rjsf/utils": "^5.19.1", "@uipath/robot": "1.3.1", "@vespaiach/axios-fetch-adapter": "^0.3.1", "@xobotyi/scrollbar-width": "^1.9.5", "abort-utils": "^1.2.0", - "ace-builds": "^1.35.0", + "ace-builds": "^1.35.2", "autocompleter": "^9.2.1", "axios": "^0.28.1", "axios-auth-refresh": "^3.3.6", @@ -73,7 +73,7 @@ "csharp-helpers": "^0.9.3", "css-selector-generator": "^3.6.8", "date-fns": "^3.6.0", - "dompurify": "^3.1.5", + "dompurify": "^3.1.6", "downloadjs": "^1.4.7", "exifreader": "^4.23.3", "export-to-csv": "^1.3.0", @@ -91,7 +91,7 @@ "htmlparser2": "^9.1.0", "http-status-codes": "^2.3.0", "idb": "^8.0.0", - "iframe-resizer": "^4.4.2", + "iframe-resizer": "^4.4.4", "immer": "^9.0.18", "intrinsic-scale": "^4.0.0", "intro.js": "^7.2.0", @@ -107,7 +107,7 @@ "kbar": "^0.1.0-beta.45", "lodash-es": "^4.17.21", "mark.js": "^8.11.1", - "marked": "^13.0.0", + "marked": "^13.0.2", "memoize-one": "^6.0.0", "mustache": "^4.2.0", "nunjucks": "^3.2.4", @@ -158,7 +158,7 @@ "slugify": "^1.6.6", "stemmer": "^2.0.1", "timezone-mock": "^1.3.6", - "uint8array-extras": "^1.1.0", + "uint8array-extras": "^1.3.0", "urlpattern-polyfill": "^5.0.3", "use-async-effect": "^2.2.7", "use-debounce": "^10.0.1", @@ -166,14 +166,14 @@ "uuid": "^10.0.0", "webext-content-scripts": "^2.7.0", "webext-detect": "^5.0.2", - "webext-events": "^3.0.0", - "webext-inject-on-install": "^2.2.0", + "webext-events": "^3.0.1", + "webext-inject-on-install": "^2.2.1", "webext-messenger": "^0.28.0", "webext-patterns": "^1.4.0", "webext-permissions": "^3.1.3", "webext-polyfill-kinda": "^1.0.2", "webext-storage": "^1.2.2", - "webext-storage-cache": "^6.0.1", + "webext-storage-cache": "^6.0.3", "webext-tools": "^2.0.1", "webextension-polyfill": "^0.12.0", "whatwg-mimetype": "^4.0.0", @@ -194,7 +194,7 @@ "@storybook/react": "^7.6.17", "@storybook/react-webpack5": "^7.6.17", "@svgr/webpack": "^8.1.0", - "@swc/core": "^1.6.5", + "@swc/core": "^1.6.13", "@swc/jest": "^0.2.36", "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^12.1.5", @@ -207,7 +207,7 @@ "@types/dompurify": "^3.0.5", "@types/downloadjs": "^1.4.6", "@types/gapi.client": "^1.0.8", - "@types/gapi.client.drive-v3": "^0.0.4", + "@types/gapi.client.drive-v3": "^0.0.5", "@types/gapi.client.oauth2-v2": "^0.0.4", "@types/gapi.client.sheets-v4": "^0.0.4", "@types/holderjs": "^2.9.4", @@ -221,10 +221,10 @@ "@types/jsdom": "^21.1.7", "@types/json-schema": "^7.0.15", "@types/json-stringify-safe": "^5.0.3", - "@types/lodash": "^4.17.5", + "@types/lodash": "^4.17.6", "@types/mark.js": "^8.11.12", "@types/mustache": "^4.2.5", - "@types/node": "^20.14.8", + "@types/node": "^20.14.10", "@types/nunjucks": "^3.2.6", "@types/object-hash": "^2.1.1", "@types/papaparse": "^5.3.14", @@ -248,7 +248,7 @@ "@types/webpack": "^5.28.5", "@types/webpack-env": "^1.18.5", "@types/whatwg-mimetype": "^3.0.2", - "@typescript-eslint/rule-tester": "^7.13.1", + "@typescript-eslint/rule-tester": "^7.15.0", "axios-mock-adapter": "^1.22.0", "blob-polyfill": "^7.0.20220408", "compass-mixins": "^0.12.10", @@ -292,7 +292,7 @@ "terser-webpack-plugin": "^5.3.10", "ts-loader": "^9.5.1", "type-fest": "^4.20.1", - "typescript": "^5.5.2", + "typescript": "^5.5.3", "typescript-plugin-css-modules": "^5.1.0", "webpack": "^5.91.0", "webpack-build-notifier": "^3.1.0", diff --git a/src/types/modComponentTypes.ts b/src/types/modComponentTypes.ts index dfe812feed..953db2305a 100644 --- a/src/types/modComponentTypes.ts +++ b/src/types/modComponentTypes.ts @@ -271,6 +271,8 @@ export type HydratedModComponent = /** * Brand for nominal typing. */ + // XXX: defining our own brand vs. using type-fest's tagged type because we need to be able to apply the brand + // in cooky-cutter factory definitions _hydratedModComponentBrand: never; }; diff --git a/src/types/registryTypes.ts b/src/types/registryTypes.ts index d1eb245f1e..fbbeffadd7 100644 --- a/src/types/registryTypes.ts +++ b/src/types/registryTypes.ts @@ -17,15 +17,12 @@ import { type UUID } from "@/types/stringTypes"; import { type ApiVersion } from "@/types/runtimeTypes"; -import { type ValueOf } from "type-fest"; +import { type Tagged, type ValueOf } from "type-fest"; /** * A brick registry id conforming to `@scope/collection/name` */ -export type RegistryId = string & { - // Nominal subtyping - _registryIdBrand: never; -}; +export type RegistryId = Tagged; /** * Scope for inner definitions @@ -53,9 +50,7 @@ export type DefinitionKind = ValueOf; /** * Simple semantic version number, major.minor.patch */ -export type SemVerString = string & { - _semVerBrand: never; -}; +export type SemVerString = Tagged; /** * Metadata about a Brick, StarterBrick, Integration, or Mod. @@ -117,10 +112,7 @@ export type InnerDefinitions = Record; * A reference to an entry in the mod's `definitions` map. _Not a valid RegistryId_. * @see InnerDefinitions */ -export type InnerDefinitionRef = string & { - // Nominal subtyping - _innerDefinitionRefBrand: never; -}; +export type InnerDefinitionRef = Tagged; export interface RegistryItem { id: T; diff --git a/src/types/runtimeTypes.ts b/src/types/runtimeTypes.ts index 9c5f2d9483..471b881bf3 100644 --- a/src/types/runtimeTypes.ts +++ b/src/types/runtimeTypes.ts @@ -18,7 +18,7 @@ import { type ComponentType } from "react"; import { type SafeHTML, type UUID } from "@/types/stringTypes"; import { type SanitizedIntegrationConfig } from "@/integrations/integrationTypes"; -import { type Primitive } from "type-fest"; +import { type Primitive, type Tagged } from "type-fest"; import { type Logger } from "@/types/loggerTypes"; import { type BrickPipeline } from "@/bricks/types"; import { type PanelPayload } from "./sidebarTypes"; @@ -54,9 +54,7 @@ export function isDocument(root: SelectorRoot): root is Document { * A reference to an element on the page. * @see getReferenceForElement */ -export type ElementReference = UUID & { - _elementReferenceBrand: never; -}; +export type ElementReference = Tagged; /** * A reference to a React component produced by a Renderer brick. @@ -75,17 +73,15 @@ export type RendererOutput = SafeHTML | ComponentRef; /** * A valid identifier for a brick output key or a service key. (Does not include the preceding "@".) */ -export type OutputKey = string & { - _outputKeyBrand: never; -}; +export type OutputKey = Tagged; /** * A variable with a "@"-prefix that refers to an integration */ -export type IntegrationDependencyVarRef = string & { - // Preserve legacy branding field name for backwards compatibility - _serviceVarRefBrand: never; -}; +export type IntegrationDependencyVarRef = Tagged< + string, + "IntegrationDependencyVarRef" +>; /** * A text template engine. @@ -226,12 +222,13 @@ export type OptionsArgs = Record; * @see RenderedArgs * @see BrickConfig.outputKey */ -export type BrickArgsContext = UnknownObject & { - // Nominal typing - _blockArgsContextBrand: never; - "@input": UnknownObject; - "@options"?: OptionsArgs; -}; +export type BrickArgsContext = Tagged< + UnknownObject & { + "@input": UnknownObject; + "@options"?: OptionsArgs; + }, + "BrickArgsContext" +>; /** * Returns an object as a BrickArgsContext, or throw a TypeError if it's not a valid context. @@ -257,19 +254,16 @@ export function validateBrickArgsContext(obj: UnknownObject): BrickArgsContext { export type BrickArgs< // eslint-disable-next-line @typescript-eslint/no-explicit-any -- brick is responsible for providing shape T extends Record = Record, -> = T & { - _blockArgBrand: never; -}; +> = Tagged; /** * The non-validated arguments to pass into the `run` method of a Brick. * @see BrickArgs */ -export type RenderedArgs = UnknownObject & { - _renderedArgBrand: never; -}; +export type RenderedArgs = Tagged; export type IntegrationsContextValue = { + // NOTE: this is not a nominal type brand. The `__service` key is actually used in the runtime. __service: SanitizedIntegrationConfig; [prop: string]: string | SanitizedIntegrationConfig | null; }; diff --git a/src/types/stringTypes.ts b/src/types/stringTypes.ts index 77d9c6b9b6..15bb0aef4f 100644 --- a/src/types/stringTypes.ts +++ b/src/types/stringTypes.ts @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +import { type Tagged } from "type-fest"; + export const VALID_UUID_REGEX = /^[\dA-Fa-f]{8}-[\dA-Fa-f]{4}-[1-5][\dA-Fa-f]{3}-[89ABab][\dA-Fa-f]{3}-[\dA-Fa-f]{12}$/; @@ -23,49 +25,31 @@ export const VALID_UUID_REGEX = * @see uuidv4 * @see isUUID */ -export type UUID = string & { - // Nominal subtyping - _uuidBrand: never; -}; +export type UUID = Tagged; /** * An ISO timestamp string */ -export type Timestamp = string & { - // Nominal subtyping - _uuidTimestamp: never; -}; +export type Timestamp = Tagged; /** * Base64 encoded JSON string */ -export type EncodedJSON = string & { - // Nominal subtyping - _encodedJSONBrand: never; -}; +export type EncodedJSON = Tagged; /** * A UTC timestamp followed by a sequence number valid in the current context. * Useful to determine order of two calls to getTimedSequence. */ -export type TimedSequence = string & { - // Nominal subtyping - _timedSequence: never; -}; +export type TimedSequence = Tagged; /** * A string known not to be tainted with user-generated input. */ -export type SafeString = string & { - // Nominal subtyping - _safeStringBrand: never; -}; +export type SafeString = Tagged; /** * Rendered HTML that has been sanitized. * @see sanitize */ -export type SafeHTML = string & { - // Nominal subtyping - _safeHTMLBrand: never; -}; +export type SafeHTML = Tagged;